BaseLLM
This is the base module for all LLM (Large Language Model) wrappers. Each specific LLM should extend this base class.
BaseLLM
Bases: ABC
Base class for all Large Language Models (LLMs). Each specific 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/llm.py
generate(prompt)
abstractmethod
Generates text from the LLM.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prompt |
str
|
A string representing the prompt to generate text from. |
required |
Returns:
Type | Description |
---|---|
A string representing the generated text. |
generate_async(prompt)
abstractmethod
async
Generates text from the LLM asynchronously.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prompt |
str
|
A string representing the prompt to generate text from. |
required |
Returns:
Type | Description |
---|---|
A string representing the generated text. |