can i use tool calling with generable in foundation models

Asked on 2025-07-15

1 search

Yes, you can use tool calling with generable types in the Foundation Models framework. Tool calling is built on guided generation, which ensures that the model will not produce invalid tool names or arguments. By defining your argument type as generable, you can ensure that the model generates valid input arguments for your tools. This allows the model to call your custom functions and incorporate the tool's output into its final response. For more details, you can refer to the session Meet the Foundation Models framework (11:28) and Deep dive into the Foundation Models framework (18:10).

can i use tool calling with generable in foundation models | Ask WWDC