Expand description
§Completions functionality and route handler.
Functions§
- completions
- OpenAI-compatible 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 completion responses.
- parse_
request - Parses and validates a completion request.
- process_
non_ streaming_ response - Process non-streaming completion responses.
Type Aliases§
- Completion
OnChunk Callback - A callback function that processes streaming response chunks before they are sent to the client.
- Completion
OnDone Callback - A callback function that is executed when the streaming response completes.
- Completion
Responder - Represents different types of completion responses.
- Completion
Streamer - A streaming response handler.