Preserve contributor head and current main reasoning/errors. Reject malformed capability declarations and retry discovery; actual localhost HTTP ReAct round-trip verified.
Only an answered /api/show lookup is cached now, and the cache is replaced rather than mutated. A failed lookup sends no tools for that request and is retried on the next one, so a transient outage no longer disables tools for the provider's lifetime. Also annotate the test helpers and tests this PR adds.
Signed-off-by: FenjuFu <fufenjupku@gmail.com>
Tools are now forwarded only when the selected model declares tool support:
catalogued models answer from ModelInfo.supports_tools (llama3.2 and mistral
are tool models on ollama.com, codellama is not), and any other model is
looked up once through /api/show, whose capabilities list is what the
installed model declares. A failed lookup sends no tools.
Native Ollama tool calls often have no id, so each one gets a unique id, and
tool results are sent with tool_name resolved from the call they answer, so
several results stay attributable.
Signed-off-by: FenjuFu <92919259+FenjuFu@users.noreply.github.com>
OllamaProvider built the /api/chat payload without the tools from
LLMInput, so Ollama models were never told any tools existed and a
ReActAgent backed by Ollama never ran one. The response side already
parsed message.tool_calls.
Send the tools in the OpenAI function format that /api/chat accepts,
matching the other providers.
Fixes#3274
Signed-off-by: FenjuFu <fufenjupku@gmail.com>