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.
- 🤖 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
- 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
-
Prerequisites
# Ensure you have SBT installed sbt --version
-
Configuration Create
tools4ai.properties
insrc/main/resources
:# 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
-
Run the Application
sbt run
// 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?")
The framework automatically detects and processes natural language commands, mapping them to appropriate actions using advanced AI models.
- 🤖 OpenAI: GPT-4 and GPT-3.5
- 🌐 Google Vertex AI: Gemini Pro
- 🎯 Anthropic: Claude
A2A automatically:
- 📚 Loads annotated actions
- 🎯 Matches user intent to actions
- 🔄 Processes parameters
- 📊 Returns formatted results
@Agent(groupName = "Custom Service", groupDescription = "Your custom service")
class CustomAgent {
@Action(description = "Your custom action")
def customAction(param: String): String = {
// Your implementation
}
}
Contributions are welcome! Feel free to:
- 🐛 Report bugs
- ✨ Suggest features
- 🔧 Submit PRs
This project is licensed under the MIT License - see the LICENSE file for details.
- A2AJava framework developers
- Tools4AI team
- The Scala community
Built with ❤️ using Scala and A2AJava