Expand description
§Chat Completions functionality and route handler.
Functions§
- chatcompletions
- OpenAI-compatible chat completions endpoint handler.
- create_
streamer - Creates a SSE streamer for chat completions with optional callbacks.
- handle_
error - Handle route / generation errors and logging them.
- match_
responses - Matches and processes different types of model responses into appropriate chat completion responses.
- parse_
request - Parses and validates a chat completion request.
- process_
non_ streaming_ response - Process non-streaming chat completion responses.
Type Aliases§
- Chat
Completion OnChunk Callback - A callback function that processes streaming response chunks before they are sent to the client.
- Chat
Completion OnDone Callback - A callback function that is executed when the streaming response completes.
- Chat
Completion Responder - Represents different types of chat completion responses.
- Chat
Completion Streamer - A streaming response handler.