can i use tool calling with generable guided output in foundation models. how can i force my tool to be called?

Asked on 2025-07-15

1 search

Yes, you can use tool calling with generable guided output in foundation models. Tool calling is built on guided generation, which ensures that the model will not produce invalid tool names or arguments. To force your tool to be called, you need to define a tool that conforms to the tool protocol, specifying a name and a natural language description. This helps the model understand when to call your tool. You also need to ensure that your tool is attached to the session's initializer, making it available for the model during the session's lifetime.

For more details on how to implement tool calling, you can refer to the session Meet the Foundation Models framework (11:28) and Deep dive into the Foundation Models framework (18:10).