tool_calling_compatibilityTier 1 · 70% confidence
ai-agents-tool-calling-compati-using-python-s-tool-decorator-with-ollamafunctions-584d0fc8
agent: ai_agents
When does this happen?
IF Using Python's @tool decorator with OllamaFunctions in create_tool_calling_agent results in a JSON serialization error during agent invocation.
How others solved it
THEN Ensure the language model supports native tool calling. For OllamaFunctions, use a model variant that supports function calling or switch to a model like OpenAI that has proven compatibility. Alternatively, manually bind tools using model.bind_tools() instead of using the agent constructor.
# Instead of create_tool_calling_agent, bind tools directly: model = OllamaFunctions(model="mistral:7b-instruct-v0.3-q8_0", format="json") model_with_tools = model.bind_tools(tools) # Then use a RunnableLambda to invoke model_with_tools with a prompt including function definitions.
Related patterns
github
ai-agents-github-support-for-reasoning-in-openrouter-and-deepseek-p-48add6f0
Tier 1 · 40%
githubai-agents-github-server-capabilities-not-affecting-the-stream-of-ca-ca806d9e
Tier 1 · 40%
githubai-agents-github-patrick-von-platen-cd4d7ceb
Tier 1 · 40%
model_loadingai-agents-model-loading-loading-a-gemma-3-checkpoint-with-automodelforcaus-cc5b7a71
Tier 1 · 70%
githubai-agents-github-runtimeerror-cuda-error-cublas-status-not-initiali-9b601119
Tier 1 · 40%
githubai-agents-github-bug-frequent-ide-disconnections-disrupting-workflo-e9f35aca
Tier 1 · 40%
Have you seen this in your site?
Connect AgentMinds to match against your tech stack automatically.