Response + Function Calling on the same model call #180

Closed
opened 2026-02-15 16:28:31 -05:00 by yindo · 1 comment
Owner

Originally created by @rsanchezmo on GitHub (Dec 5, 2024).

I was unable to get both a function call and an output on the same model inference (I used llama 3.1:8b). I mean, for a ReAct agent for example, you can ask first to do the THOUGHT process and choose the tools that help you achieve the plan (or the initial steps of it). Then You will feedback the model with the tool output as you did and let the model decide between giving a final answer or replaning (or moving to next step) and call to another set of tools until the agent completed the task.

Is incompatible function calling + generation on the same step in Ollama? meaning thinking a bit then deciding what tools to use? It has demonstrated to be more performant... I saw this example on https://langchain-ai.github.io/langgraph/how-tos/tool-calling/#react-agent and makes me think this is possible and should be possible.

Thanks in advance!

Originally created by @rsanchezmo on GitHub (Dec 5, 2024). I was unable to get both a function call and an output on the same model inference (I used llama 3.1:8b). I mean, for a ReAct agent for example, you can ask first to do the THOUGHT process and choose the tools that help you achieve the plan (or the initial steps of it). Then You will feedback the model with the tool output as you did and let the model decide between giving a final answer or replaning (or moving to next step) and call to another set of tools until the agent completed the task. Is incompatible function calling + generation on the same step in Ollama? meaning thinking a bit then deciding what tools to use? It has demonstrated to be more performant... I saw this example on https://langchain-ai.github.io/langgraph/how-tos/tool-calling/#react-agent and makes me think this is possible and should be possible. Thanks in advance!
yindo closed this issue 2026-02-15 16:28:31 -05:00
Author
Owner

@ParthSareen commented on GitHub (Dec 5, 2024):

Hey! Yeah we only support output at a time. You can still do the same prompt it just won't be outputted in the contents.

@ParthSareen commented on GitHub (Dec 5, 2024): Hey! Yeah we only support output at a time. You can still do the same prompt it just won't be outputted in the contents.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#180