This file contains the API routes for the application. It includes routes for sending messages, calling functions, transcribing audio, generating text-to-speech, and retrieving data from the database.
create_router(handler: MainHandler, CONFIG)
: Creates the router object and defines the API routes.
POST /chat/send_message
: Receives the chatlog from the user and answers. It takes aChatRequest
object as input and returns a response.POST /chat/function_call
: Receives the function call from the frontend and executes it. It takes aFunctionCall
object as input and returns a response.POST /chat/transcribe
: Receives the audio file from the frontend and transcribes it. It takes anAudioTranscriptRequest
object as input and returns a response.POST /chat/tts
: Receives the text from the frontend and generates the audio file. It takes anAudioTTSRequest
object as input and returns a response.GET /restaurants/
: Retrieves all restaurants from the database. It doesn't require any input and returns a list ofRestaurant
objects.GET /restaurants/{restaurant_id}/foods/
: Retrieves all foods from a specific restaurant. It takes arestaurant_id
as input and returns a list ofFoods
objects.