How to Route Requests to Agents with OpenSmartRoute
Routing requests to agents is a core function of the OpenSmartRoute platform. It enables the distribution of user requests to the appropriate models, skills, or tools based on predefined rules and scenarios. This guide explains the process of routing requests, the mechanisms involved, and how to implement routing in your environment.
Understanding Request Routing in OpenSmartRoute
OpenSmartRoute provides a way to direct incoming requests to specific agents or models based on the context, user input, or scenario. The platform supports various use cases across industries, where requests are matched to targets such as models, skills, or tools, according to rules defined in a YAML catalog.
Routing decisions are made through API calls, typically using the /api/v1/route endpoint. These calls include the request data and are processed by the platform to determine the most suitable target.
How to Route Requests Using the API
Routing requests involves sending a JSON payload to the platform's API endpoint. Here is an example command:
curl -s https://api.opensmartroute.ai/api/v1/route -H "Authorization: Bearer $KEY" \
-H 'Content-Type: application/json' -d '{"text": "I want a refund for order #4821, it arrived damaged."}'
