Overview

Tools enhance the capabilities of language models, allowing them to perform specific tasks or access external information. In ModelBench, tools are defined using JSON schema and can be easily integrated into your prompts.

Adding Tools

To add a tool in the ModelBench Playground:

  1. Navigate to the tool section.
  2. Paste the JSON schema of your tool.
  3. Press “Save Changes” to make the tool available to your selected models.

Example Tools

Here are two example tools you can use in your prompts:

1. Get Weather Tool

This tool allows the model to fetch current weather information for a given location.

{
  "name": "get_weather",
  "description": "Get the current weather for a specified location",
  "parameters": {
    "type": "object",
    "properties": {
      "location": {
        "type": "string",
        "description": "The city and state, e.g. San Francisco, CA"
      }
    },
    "required": ["location"]
  }
}

2. Fetch URL Tool

This tool enables the model to fetch content from a given URL.

{
  "name": "fetch_url_content",
  "description": "Fetch the content of a specified URL",
  "parameters": {
    "type": "object",
    "properties": {
      "url": {
        "type": "string",
        "description": "The URL to fetch content from"
      }
    },
    "required": ["url"]
  }
}

Using Tools in Prompts

Once a tool is added, you can instruct the model to use it in your prompt. For example:

You have access to a tool called fetch_url_content. Use this tool to fetch the content of https://example.com and summarize it in 3 sentences.

Remember to provide clear instructions on when and how to use the tool in your prompt.

Best Practices

  1. Only add tools that are necessary for your specific use case.
  2. Provide clear instructions in your prompt on how and when to use the tools.
  3. Be aware of any limitations or potential issues with tool use, such as rate limits or content restrictions.
  4. Test your prompts with tools thoroughly to ensure they’re being used correctly and effectively.

By leveraging tools effectively, you can significantly expand the capabilities of your LLM applications.