Classes | |
| class | OllamaConversationEntity |
Functions | |
| Any | _fix_invalid_arguments (Any value) |
| dict[str, Any] | _format_tool (llm.Tool tool, Callable[[Any], Any]|None custom_serializer) |
| dict[str, Any] | _parse_tool_args (dict[str, Any] arguments) |
| None | async_setup_entry (HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities) |
Variables | |
| _LOGGER = logging.getLogger(__name__) | |
| int | MAX_TOOL_ITERATIONS = 10 |
The conversation platform for the Ollama integration.
|
private |
Attempt to repair incorrectly formatted json function arguments. Small models (for example llama3.1 8B) may produce invalid argument values which we attempt to repair here.
Definition at line 68 of file conversation.py.
|
private |
Format tool specification.
Definition at line 55 of file conversation.py.
|
private |
Rewrite ollama tool arguments. This function improves tool use quality by fixing common mistakes made by small local tool use models. This will repair invalid json arguments and omit unnecessary arguments with empty values that will fail intent parsing.
Definition at line 86 of file conversation.py.
| None homeassistant.components.ollama.conversation.async_setup_entry | ( | HomeAssistant | hass, |
| ConfigEntry | config_entry, | ||
| AddEntitiesCallback | async_add_entities | ||
| ) |
Set up conversation entities.
Definition at line 45 of file conversation.py.
|
private |
Definition at line 42 of file conversation.py.
| int homeassistant.components.ollama.conversation.MAX_TOOL_ITERATIONS = 10 |
Definition at line 40 of file conversation.py.