Skip to content

Usage of Call Chat Agents

This document outlines how to use the Call Chat Agents application, including the available API endpoints, request formats, and examples.

API Endpoints

Dispatch Agent

  • Endpoint: /agent/dispatch_agent
  • Method: POST
  • Description: This endpoint is used to dispatch an agent based on the specified language.

Request Format

The request should be a JSON object containing the language preference. The following is the expected format:

{
  "language": "English"
}

Supported Languages

The application currently supports the following languages:

  • English
  • Spanish
  • French
  • German
  • Chinese

Example Request

Here is an example of how to make a request to the dispatch agent endpoint using curl:

curl -X POST "http://localhost:8000/agent/dispatch_agent" \
-H "Content-Type: application/json" \
-d '{"language": "Spanish"}'

Example Response

A successful response will return a JSON object with the following structure:

{
  "message": "agent dispatched successfully",
  "room_id": "room-1634567890",
  "token": "your_generated_token",
  "participant_identity": "user-123e4567-e89b-12d3-a456-426614174000"
}

In case of an error, the response will include an error message:

{
  "detail": "Error message here"
}

Conclusion

This document provides a brief overview of how to use the Call Chat Agents application. For further details, please refer to the other documentation files or the API source code.