Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lemon-mirrors-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"braintrust": minor
---

fix(ai-sdk): Don't capture message history in tool spans

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2,674 changes: 1,865 additions & 809 deletions e2e/scenarios/ai-sdk-instrumentation/__cassettes__/ai-sdk-v6.cassette.json

Large diffs are not rendered by default.

1,471 changes: 1,333 additions & 138 deletions e2e/scenarios/ai-sdk-instrumentation/__cassettes__/ai-sdk-v7.cassette.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"headers": "<omitted>"
},
"response": {
"id": "<span:1>",
"modelId": "gpt-4o-mini-2024-07-18",
"timestamp": "<timestamp>"
},
Expand Down Expand Up @@ -99,7 +98,6 @@
},
"response": {
"headers": "<omitted>",
"id": "<span:1>",
"messages": [
{
"content": [
Expand All @@ -126,7 +124,6 @@
"isContinued": false,
"response": {
"headers": "<omitted>",
"id": "<span:1>",
"messages": [
{
"content": [
Expand Down Expand Up @@ -387,14 +384,12 @@
"headers": "<omitted>"
},
"response": {
"id": "<span:1>",
"modelId": "gpt-4o-mini-2024-07-18",
"timestamp": "<timestamp>"
},
"toolCalls": [
{
"args": "{\"location\":\"Paris, France\"}",
"toolCallId": "<toolCallId:2>",
"toolCallType": "function",
"toolName": "get_weather"
}
Expand Down Expand Up @@ -424,12 +419,9 @@
"name": "get_weather",
"type": "tool",
"children": [],
"input": [
{
"location": "Paris, France"
},
{}
],
"input": {
"location": "Paris, France"
},
"output": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}"
}
],
Expand Down Expand Up @@ -479,7 +471,6 @@
},
"response": {
"headers": "<omitted>",
"id": "<span:2>",
"messages": [
{
"content": [
Expand All @@ -491,7 +482,6 @@
"args": {
"location": "Paris, France"
},
"toolCallId": "<toolCallId:1>",
"toolName": "get_weather",
"type": "tool-call"
}
Expand All @@ -502,7 +492,6 @@
"content": [
{
"result": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}",
"toolCallId": "<toolCallId:1>",
"toolName": "get_weather",
"type": "tool-result"
}
Expand All @@ -525,7 +514,6 @@
"isContinued": false,
"response": {
"headers": "<omitted>",
"id": "<span:2>",
"messages": [
{
"content": [
Expand All @@ -537,7 +525,6 @@
"args": {
"location": "Paris, France"
},
"toolCallId": "<toolCallId:1>",
"toolName": "get_weather",
"type": "tool-call"
}
Expand All @@ -548,7 +535,6 @@
"content": [
{
"result": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}",
"toolCallId": "<toolCallId:1>",
"toolName": "get_weather",
"type": "tool-result"
}
Expand All @@ -566,7 +552,6 @@
"args": {
"location": "Paris, France"
},
"toolCallId": "<toolCallId:1>",
"toolName": "get_weather",
"type": "tool-call"
}
Expand All @@ -577,7 +562,6 @@
"location": "Paris, France"
},
"result": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}",
"toolCallId": "<toolCallId:1>",
"toolName": "get_weather"
}
],
Expand All @@ -595,7 +579,6 @@
"args": {
"location": "Paris, France"
},
"toolCallId": "<toolCallId:1>",
"toolName": "get_weather",
"type": "tool-call"
}
Expand All @@ -606,7 +589,6 @@
"location": "Paris, France"
},
"result": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}",
"toolCallId": "<toolCallId:1>",
"toolName": "get_weather"
}
],
Expand Down Expand Up @@ -711,14 +693,12 @@
"headers": "<omitted>"
},
"response": {
"id": "<span:1>",
"modelId": "gpt-4o-mini-2024-07-18",
"timestamp": "<timestamp>"
},
"toolCalls": [
{
"args": "{\"city\":\"Paris\"}",
"toolCallId": "<toolCallId:2>",
"toolCallType": "function",
"toolName": "json"
}
Expand Down Expand Up @@ -787,7 +767,6 @@
},
"response": {
"headers": "<omitted>",
"id": "<span:1>",
"modelId": "gpt-4o-mini-2024-07-18",
"timestamp": "<timestamp>"
},
Expand Down Expand Up @@ -868,7 +847,6 @@
"toolCalls": [
{
"args": "{\"city\":\"Paris\"}",
"toolCallId": "<toolCallId:1>",
"toolCallType": "function",
"toolName": "json",
"type": "tool-call"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ span_tree:
│ },
│ "response": {
│ "headers": "<omitted>",
│ "id": "<span:1>",
│ "messages": [
│ {
│ "content": [
Expand All @@ -64,7 +63,6 @@ span_tree:
│ "isContinued": false,
│ "response": {
│ "headers": "<omitted>",
│ "id": "<span:1>",
│ "messages": [
│ {
│ "content": [
Expand Down Expand Up @@ -141,7 +139,6 @@ span_tree:
│ "headers": "<omitted>"
│ },
│ "response": {
│ "id": "<span:1>",
│ "modelId": "gpt-4o-mini-2024-07-18",
│ "timestamp": "<timestamp>"
│ },
Expand Down Expand Up @@ -336,7 +333,6 @@ span_tree:
│ },
│ "response": {
│ "headers": "<omitted>",
│ "id": "<span:2>",
│ "messages": [
│ {
│ "content": [
Expand All @@ -348,7 +344,6 @@ span_tree:
│ "args": {
│ "location": "Paris, France"
│ },
│ "toolCallId": "<toolCallId:1>",
│ "toolName": "get_weather",
│ "type": "tool-call"
│ }
Expand All @@ -359,7 +354,6 @@ span_tree:
│ "content": [
│ {
│ "result": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}",
│ "toolCallId": "<toolCallId:1>",
│ "toolName": "get_weather",
│ "type": "tool-result"
│ }
Expand All @@ -382,7 +376,6 @@ span_tree:
│ "isContinued": false,
│ "response": {
│ "headers": "<omitted>",
│ "id": "<span:2>",
│ "messages": [
│ {
│ "content": [
Expand All @@ -394,7 +387,6 @@ span_tree:
│ "args": {
│ "location": "Paris, France"
│ },
│ "toolCallId": "<toolCallId:1>",
│ "toolName": "get_weather",
│ "type": "tool-call"
│ }
Expand All @@ -405,7 +397,6 @@ span_tree:
│ "content": [
│ {
│ "result": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}",
│ "toolCallId": "<toolCallId:1>",
│ "toolName": "get_weather",
│ "type": "tool-result"
│ }
Expand All @@ -423,7 +414,6 @@ span_tree:
│ "args": {
│ "location": "Paris, France"
│ },
│ "toolCallId": "<toolCallId:1>",
│ "toolName": "get_weather",
│ "type": "tool-call"
│ }
Expand All @@ -434,7 +424,6 @@ span_tree:
│ "location": "Paris, France"
│ },
│ "result": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}",
│ "toolCallId": "<toolCallId:1>",
│ "toolName": "get_weather"
│ }
│ ],
Expand All @@ -452,7 +441,6 @@ span_tree:
│ "args": {
│ "location": "Paris, France"
│ },
│ "toolCallId": "<toolCallId:1>",
│ "toolName": "get_weather",
│ "type": "tool-call"
│ }
Expand All @@ -463,7 +451,6 @@ span_tree:
│ "location": "Paris, France"
│ },
│ "result": "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}",
│ "toolCallId": "<toolCallId:1>",
│ "toolName": "get_weather"
│ }
│ ],
Expand Down Expand Up @@ -561,14 +548,12 @@ span_tree:
│ │ "headers": "<omitted>"
│ │ },
│ │ "response": {
│ │ "id": "<span:1>",
│ │ "modelId": "gpt-4o-mini-2024-07-18",
│ │ "timestamp": "<timestamp>"
│ │ },
│ │ "toolCalls": [
│ │ {
│ │ "args": "{\"location\":\"Paris, France\"}",
│ │ "toolCallId": "<toolCallId:2>",
│ │ "toolCallType": "function",
│ │ "toolName": "get_weather"
│ │ }
Expand All @@ -594,12 +579,9 @@ span_tree:
│ │ "tokens": 103
│ │ }
│ └── get_weather [tool]
│ input: [
│ {
│ "location": "Paris, France"
│ },
│ {}
│ ]
│ input: {
│ "location": "Paris, France"
│ }
│ output: "{\"condition\":\"sunny\",\"location\":\"Paris, France\",\"temperatureC\":22}"
├── ai-sdk-generate-object-operation
│ metadata: {
Expand Down Expand Up @@ -649,7 +631,6 @@ span_tree:
│ },
│ "response": {
│ "headers": "<omitted>",
│ "id": "<span:1>",
│ "modelId": "gpt-4o-mini-2024-07-18",
│ "timestamp": "<timestamp>"
│ },
Expand Down Expand Up @@ -718,14 +699,12 @@ span_tree:
│ "headers": "<omitted>"
│ },
│ "response": {
│ "id": "<span:1>",
│ "modelId": "gpt-4o-mini-2024-07-18",
│ "timestamp": "<timestamp>"
│ },
│ "toolCalls": [
│ {
│ "args": "{\"city\":\"Paris\"}",
│ "toolCallId": "<toolCallId:2>",
│ "toolCallType": "function",
│ "toolName": "json"
│ }
Expand Down Expand Up @@ -848,7 +827,6 @@ span_tree:
"toolCalls": [
{
"args": "{\"city\":\"Paris\"}",
"toolCallId": "<toolCallId:1>",
"toolCallType": "function",
"toolName": "json",
"type": "tool-call"
Expand Down
Loading
Loading