Chain of thought tool use

Anthropic Claude newly has a tool functionality which allows to prompt the model to first reason and only then decide on which (if any) tool to select.

Is anything like that possible with OpenAI API?

Edit:

{
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": "<thinking>To answer this question, I will: 1. Use the get_weather tool to get the current weather in San Francisco. 2. Use the get_time tool to get the current time in the America/Los_Angeles timezone, which covers San Francisco, CA.</thinking>"
    },
    {
      "type": "tool_use",
      "id": "toolu_01A09q90qw90lq917835lq9",
      "name": "get_weather",
      "input": {"location": "San Francisco, CA"}
    }
  ]
}
1 Like

How is that different from GPT?

“reasoning” is controversial :slight_smile:

1 Like

Hi!
From the link you posted it says that one can prompt the smaller models to show their reasoning before invoking any tools.

This was also my first idea, which would resemble a simple chain-of-thought prompt where the model explains it’s process of creating a reply to a request while replying.

I suppose if you really want to get this information every time, fine-tuning would be an option.

When using tools, Claude will often show its “chain of thought”, i.e. the step-by-step reasoning it uses to break down the problem and decide which tools to use. The Claude 3 Opus model will always do this, and Sonnet and Haiku can be prompted into doing it.

2 Likes