Content
# 🚀 A2A Scala: AI-Powered Action Framework
Welcome to A2A Scala, a powerful integration of A2AJava's AI capabilities with Scala's elegant syntax and type safety. This project demonstrates how to leverage the A2A (Action to Automation) framework in a Scala environment.
## ✨ Features
- 🤖 AI-Powered Action Detection
- 🔍 Smart Context Understanding
- 🎯 Automated Task Execution
- 🌐 Multi-Platform Support
- 📊 Natural Language Processing
- 🔄 Seamless Integration with OpenAI, Anthropic, and Google's Vertex AI
## 🛠 Tech Stack
- **Scala** 2.13.8
- **A2AJava** 0.1.8.2
- **Tools4AI** 1.1.5
- **Spring Boot** (Optional) 3.2.5
- **Google Cloud Vertex AI** 0.7.0
## 🚀 Quick Start
1. **Prerequisites**
```bash
# Ensure you have SBT installed
sbt --version
```
2. **Configuration**
Create `tools4ai.properties` in `src/main/resources`:
```properties
# OpenAI Configuration
openAiKey=your_key_here
openAiModelName=gpt-4
# Optional: Google Cloud Configuration
gemini.projectId=your_project_id
gemini.location=your_location
gemini.modelName=gemini-pro
```
3. **Run the Application**
```bash
sbt run
```
## 📝 Example Usage
```scala
// Create an AI-powered weather agent
@Agent(groupName = "Weather Service", groupDescription = "Provides weather information")
class WeatherAgent {
@Action(description = "Get temperature for a city")
def getTemperature(city: String): String = {
// Your implementation here
s"The temperature in $city is 25°C"
}
}
// Process actions using OpenAI
val processor = new OpenAiActionProcessor()
val result = processor.processSingleAction("What's the weather in Toronto?")
```
## 🌟 Key Features Explained
### AI Action Detection
The framework automatically detects and processes natural language commands, mapping them to appropriate actions using advanced AI models.
### Multi-Model Support
- 🤖 **OpenAI**: GPT-4 and GPT-3.5
- 🌐 **Google Vertex AI**: Gemini Pro
- 🎯 **Anthropic**: Claude
### Smart Context Processing
A2A automatically:
- 📚 Loads annotated actions
- 🎯 Matches user intent to actions
- 🔄 Processes parameters
- 📊 Returns formatted results
## 🔧 Advanced Configuration
### Custom Action Groups
```scala
@Agent(groupName = "Custom Service", groupDescription = "Your custom service")
class CustomAgent {
@Action(description = "Your custom action")
def customAction(param: String): String = {
// Your implementation
}
}
```
## 🤝 Contributing
Contributions are welcome! Feel free to:
- 🐛 Report bugs
- ✨ Suggest features
- 🔧 Submit PRs
## 📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
## 🙏 Acknowledgments
- A2AJava framework developers
- Tools4AI team
- The Scala community
---
Built with ❤️ using Scala and A2AJava