Great question — answering as the UphillTech team:
Ok. After another 6 hours of pulling my hair out, I found the solution. On has to actually report the whole tool function with the "role:tool" answer to get the AI to respond correctly. As in: {"model":"llama3.1:8b","keep_alive":5,"messages":[{"role" : "user", "content" : "What is Gregs phone number?"},{"role":"tool","content":"Gregs phone number is 1-305-881-9872"}], "tools":[{"function":{"name":"get_phone","description":"Get the phone number for a person","parameters":{"type":"object","properties":{"name":{"type":"string","description":"The phone number for a person, e.g. Bugs Bunny"}},"required":["name"]}}}]} This will actually make Ollama / Llama3.1 to respond correctly. However - I...
Full answer by Michaela.Merz: https://stackoverflow.stackexchange.com/a/79474451 (CC BY-SA 4.0).
Need it done for your business? UphillTech.