BaseChatLLM
This is the base module for all Chat LLM (Large Language Model) wrappers. Each specific Chat LLM should extend this base class.
BaseChatLLM
Bases: ABC
Base class for all Chat Large Language Models. Each specific Chat LLM should extend this class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model |
str
|
The model name used in the LLM class. |
required |
Source code in llmflows/llms/chat_llm.py
generate(message_history)
abstractmethod
Generates text from the LLM.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message_history |
MessageHistory
|
A |
required |
Returns:
| Type | Description |
|---|---|
|
A string representing the generated text. |
Source code in llmflows/llms/chat_llm.py
generate_async(message_history)
abstractmethod
async
Generates text from the LLM asynchronously.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message_history |
MessageHistory
|
A |
required |
Returns:
| Type | Description |
|---|---|
|
A string representing the generated text. |