evolving_ideas.infra.llm_interface¶
evolving_ideas.infra.llm_interface
Classes¶
Abstract base class for LLM interfaces. |
Module Contents¶
- class evolving_ideas.infra.llm_interface.LLMInterface¶
Bases:
abc.ABCAbstract base class for LLM interfaces.
- abstract ask(prompt: str, context: str = 'You are a helpful assistant.') str¶
Ask the LLM a question with a given prompt and context.
- Parameters:
prompt (str) – The prompt to send to the LLM.
context (str) – Additional context for the LLM (default is “You are a helpful assistant.”).
- Returns:
The LLM’s response.
- Return type:
str
- abstract chat(chatlog: list) str¶
Start a chat session with the LLM.
- Parameters:
chatlog (list) – A list of messages to include in the chat context.
- Returns:
The LLM’s response.
- Return type:
str