Tools
Many models support the use of external tools to enrich data or provide additional context. These tools can be used to call external APIs, run custom scripts, or perform any other operation that can be defined in code.
The definitions of these tools are passed into the model as part of the prompt, making the model aware of their functionality. This allows the model to call the tool when needed via a structured response.
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. |
Here is an example of a tool definition for a tool that gets the 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 |
Was this page helpful?