Functions
FUNC add_tools_from_model_options
FUNC add_tools_from_context_actions
FUNC convert_tools_to_json
- Huggingface transformers library lets you pass in an array of functions but doesn’t like methods.
- WatsonxAI uses
from langchain_ibm.chat_models import convert_to_openai_toolin their demos, but it gives the same values. - OpenAI uses the same format / schema.
FUNC json_extraction
FUNC find_func
...{"name": string, "arguments": {}}...
FUNC parse_tools
FUNC convert_function_to_tool
Classes
CLASS SubscriptableBaseModel
Class imported from Ollama.
Methods:
FUNC get
msg = Message(role=‘user’) msg.get(‘role’) ‘user’ msg = Message(role=‘user’) msg.get(‘nonexistent’) msg = Message(role=‘user’) msg.get(‘nonexistent’, ‘default’) ‘default’ msg = Message(role=‘user’, tool_calls=[ Message.ToolCall(function=Message.ToolCall.Function(name=‘foo’, arguments=))]) msg.get(‘tool_calls’)[0][‘function’][‘name’] ‘foo’