llama-stack-mirror/llama_stack/models/llama/llama3
Ashwin Bharambe ef0736527d
feat(tools)!: substantial clean up of "Tool" related datatypes (#3627)
This is a sweeping change to clean up some gunk around our "Tool"
definitions.

First, we had two types `Tool` and `ToolDef`. The first of these was a
"Resource" type for the registry but we had stopped registering tools
inside the Registry long back (and only registered ToolGroups.) The
latter was for specifying tools for the Agents API. This PR removes the
former and adds an optional `toolgroup_id` field to the latter.

Secondly, as pointed out by @bbrowning in
https://github.com/llamastack/llama-stack/pull/3003#issuecomment-3245270132,
we were doing a lossy conversion from a full JSON schema from the MCP
tool specification into our ToolDefinition to send it to the model.
There is no necessity to do this -- we ourselves aren't doing any
execution at all but merely passing it to the chat completions API which
supports this. By doing this (and by doing it poorly), we encountered
limitations like not supporting array items, or not resolving $refs,
etc.

To fix this, we replaced the `parameters` field by `{ input_schema,
output_schema }` which can be full blown JSON schemas.

Finally, there were some types in our llama-related chat format
conversion which needed some cleanup. We are taking this opportunity to
clean those up.

This PR is a substantial breaking change to the API. However, given our
window for introducing breaking changes, this suits us just fine. I will
be landing a concurrent `llama-stack-client` change as well since API
shapes are changing.
2025-10-02 15:12:03 -07:00
..
multimodal refactor(logging): rename llama_stack logger categories (#3065) 2025-08-21 17:31:04 -07:00
prompt_templates feat(tools)!: substantial clean up of "Tool" related datatypes (#3627) 2025-10-02 15:12:03 -07:00
quantization chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00
__init__.py chore: remove dependency on llama_models completely (#1344) 2025-03-01 12:48:08 -08:00
args.py chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00
chat_format.py feat(tools)!: substantial clean up of "Tool" related datatypes (#3627) 2025-10-02 15:12:03 -07:00
dog.jpg chore: move all Llama Stack types from llama-models to llama-stack (#1098) 2025-02-14 09:10:59 -08:00
generation.py chore: make cprint write to stderr (#2250) 2025-05-24 23:39:57 -07:00
interface.py chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00
model.py chore: enable pyupgrade fixes (#1806) 2025-05-01 14:23:50 -07:00
pasta.jpeg chore: move all Llama Stack types from llama-models to llama-stack (#1098) 2025-02-14 09:10:59 -08:00
template_data.py refactor: move all llama code to models/llama out of meta reference (#1887) 2025-04-07 15:03:58 -07:00
tokenizer.model chore: remove dependency on llama_models completely (#1344) 2025-03-01 12:48:08 -08:00
tokenizer.py chore(pre-commit): add pre-commit hook to enforce llama_stack logger usage (#3061) 2025-08-20 07:15:35 -04:00
tool_utils.py feat(tools)!: substantial clean up of "Tool" related datatypes (#3627) 2025-10-02 15:12:03 -07:00