This module provides functionality for interacting with OpenAI's chat completion API. It defines request and response models, handles API interactions, and registers a chip for generating chat completions.
View source code here: GitHub
Generates a chat completion using OpenAI's API.
This is a pure wrapper around the OpenAI API, which handles the request and returns the response in a structured format. If you need to know what the API response looks like, refer to the OpenAI API documentation.
Field | Type | Description |
---|---|---|
client_settings | Configuration for the OpenAI API client. | |
create_params | Parameters for the chat completion request. |
Field | Type | Description |
---|---|---|
status | typing.Literal['OK', 'CONNECTION_ERROR', 'RATE_LIMIT', 'API_ERROR', 'ERROR'] | Status of the request. |
status_code | typing.Optional[int] | The HTTP status code of the response. |
completion | typing.Optional[openai.types.chat.chat_completion.ChatCompletion] | The chat completion result (if successful). |
© 2025 South Patron LLC. All rights reserved.
AI everywhere.