usersimcrs.llm_interfaces.llm_interface
Interface for the LLM model.
Classes
Initializes the LLM interface. |
Module Contents
- class usersimcrs.llm_interfaces.llm_interface.LLMInterface(default_response: str = None)
Bases:
abc.ABCInitializes the LLM interface.
- Parameters:
default_response – Default response to be used if the LLM fails to generate a response.
- default_response = None
- abstractmethod generate_utterance(prompt: usersimcrs.simulator.llm.prompt.utterance_generation_prompt.UtteranceGenerationPrompt) dialoguekit.core.Utterance
Generates an utterance given a prompt.
- Parameters:
prompt – Prompt for generating the utterance.
- Raises:
NotImplementedError – If the method is not implemented in subclass.
- Returns:
Utterance in natural language.
- abstractmethod get_llm_api_response(prompt: str, **kwargs) str
Gets the raw response from the LLM API.
This method should be used to interact directly with the LLM API, i.e., for everything that is not related to the generation of an utterance.
- Parameters:
prompt – Prompt for the LLM.
**kwargs – Additional arguments to be passed to the API call.
- Raises:
NotImplementedError – If the method is not implemented in subclass.
- Returns:
Response from the LLM API without any post-processing.