OpenAILLM#
classDiagram
LLMBase <|-- OpenAIChatCompletionsModel
Monitorable <|-- LLMBase
OpenAIChatCompletionsModel <|-- OpenAILLM
- class council.llm.OpenAILLM(config: OpenAILLMConfiguration)[source]#
Bases:
OpenAIChatCompletionsModelRepresents an OpenAI large language model hosted on OpenAI.
- post_chat_request(context: LLMContext, messages: List[LLMMessage], **kwargs: Any) LLMResult#
Sends a chat request to the language model.
- Parameters:
context (LLMContext) – a context to track execution metrics
messages (List[LLMMessage]) – A list of LLMMessage objects representing the chat messages.
**kwargs – Additional keyword arguments for the chat request.
- Returns:
The response from the language model.
- Return type:
LLMResult
- Raises:
LLMTokenLimitException – If messages exceed the maximum number of tokens.
Exception – If an error occurs during the execution of the chat request.