Skip to content

base

marvin.engine.language_models.base

ChatLLM

format_messages abstractmethod

Format Marvin message objects into a prompt compatible with the LLM model

run abstractmethod async

Run the LLM model on a list of messages and optional list of functions

OpenAIFunction

args: Optional[dict] = None class-attribute instance-attribute

Base class for representing a function that can be called by an LLM. The format is identical to OpenAI's Functions API.

Parameters:

Name Type Description Default
name str

The name of the function. description (str): The description

required
of the function. parameters (dict

The parameters of the function. fn

required
(Callable)

The function to be called. args (dict): The arguments to be

required

chat_llm

Dispatches to all supported LLM providers