Tools
Tool definitions in Prompt Foundry are independent of prompt definitions. This means you can define a tool once and use it across multiple prompts, allowing you to iterate on the tool separately from the prompts. These tools are managed in the Tools section of the platform.Tool Definition
The tool definition follows a JSON schema with the following properties:Property | Description |
---|---|
name | The name of the tool. |
description | A detailed description of the tool’s purpose and functionality, helping guide when the model should call the tool. |
parameters | The available input parameters for the tool call. Each parameter should have a detailed description and type so the model understands the structure and data required to call the tool. |
get_current_weather
Using Tools
To use the tool within your prompt, click the model tools button in the prompt editor. This will open a modal where you can select the tools you want to enable for your prompt.
Tool Choice
Tool choice allows you to provide additional guidance to the model on when to use the tool.Value | Description |
---|---|
auto | Enables the model to call the tool whenever it deems necessary. |
required | Requires the model to use a tool in its response, but does not specify which one. This is useful when you want the model to choose between multiple actions to perform next. |
<TOOL_NAME> | Specifies a particular tool by |