This project demonstrate the usage of super route core abstraction AgentRoutingSpecsResolver
- Configure environment variable OPENAI_API_KEY={YOUR_API_KEY}
- Boot up
SuperRouteGatewayApplication
on port:8080 - Boot up
AgentsApplication
on port:9090 with option:-Dserver.port=9090
- Now ask queries to the gateway on either of the categories = offers or service.
As per the intent in the user query the request will be forwarded by the gateway to either of the endpoint
http://localhost:9090/agents/offer-agent
orhttp://localhost:9090/agents/service-agent
curl --location 'http://localhost:8080/agents?userQuery=I%20have%20some%20issue%20with%20my%20services'
curl --location 'http://localhost:8080/agents?userQuery=what%20are%20the%20best%20offers%20for%20me'
AgentRoutingSpecsProvider
has been configured with SimpleAgentRoutingSpecProvider
SimpleAgentRoutingSpecProvider().add(
AgentRoutingSpecBuilder().name("offer-agent").description("This agent is responsible for offer management")
.version("1.0.0").address(Address(uri = "/agents/offer-agent")).build()
)
.add(
AgentRoutingSpecBuilder().name("service-agent").description("This agent is responsible for service management")
.version("1.0.0").address(Address(uri = "/agents/service-agent")).build()
)
LLMAgentRoutingSpecResolver
has been used to resolve Agent Spec.
Refer GatewayConfiguration
for more details.