weave icon indicating copy to clipboard operation
weave copied to clipboard

Anthropic (Bedrock: when model outputs both tool and text, only text is captured

Open ChuckJonas opened this issue 3 months ago • 1 comments

If a model outputs both a tool_call & text (as is common with Anthropic models), only the text is captured in weaves trace output.

Example the following response:

{
  "stop_reason": "tool_use",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": "I need to call the get_weather function, and the user wants SF, which is likely San Francisco, CA."
    },
    {
      "type": "tool_use",
      "id": "toolu_01A09q90qw90lq917835lq9",
      "name": "get_weather",
      "input": {"location": "San Francisco, CA", "unit": "celsius"}
    }
  ]
}

Might be captured like this in the weave trace output:

{
  "role": "assistant",
  "content": "I need to call the get_weather function, and the user wants SF, which is likely San Francisco, CA.",
  "stop_reason": "tool_use",
  "usage": {
    ...
  },
  "latency_ms": 2265
}

From what I can tell, this only applies to streaming outputs.

ChuckJonas avatar Sep 03 '25 22:09 ChuckJonas

May be related to #5420

ChuckJonas avatar Sep 03 '25 22:09 ChuckJonas