OllamaClient
Note that no api_key or environment variable is required for Ollama. Parameters:
Class Attributes
TOOL_CALL_MANUAL_INSTRUCTION
TOOL_CALL_MANUAL_STEP1
TOOL_CALL_MANUAL_STEP2
Static Methods
get_usage
Instance Methods
cost
create
message_retrieval
NOTE: if a list of Choice.Message is returned, it currently needs to contain the fields of OpenAI’s ChatCompletion Message object, since that is expected for function or tool calling in the rest of the codebase at the moment, unless a custom agent is being used. Parameters:
oai_messages_to_ollama_messages
We correct for any specific role orders and types, and convert tools to messages (as Ollama can’t use tool messages) Parameters: