Skip to content
Open
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
3 changes: 3 additions & 0 deletions packages/ai-semantic-conventions/src/SemanticAttributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export const SpanAttributes = {
LLM_USAGE_COMPLETION_TOKENS: "gen_ai.usage.completion_tokens",
LLM_USAGE_INPUT_TOKENS: ATTR_GEN_AI_USAGE_INPUT_TOKENS,
LLM_USAGE_OUTPUT_TOKENS: ATTR_GEN_AI_USAGE_OUTPUT_TOKENS,
LLM_USAGE_CACHE_CREATION_INPUT_TOKENS:
"gen_ai.usage.cache_creation_input_tokens",
LLM_USAGE_CACHE_READ_INPUT_TOKENS: "gen_ai.usage.cache_read_input_tokens",

GEN_AI_AGENT_NAME: "gen_ai.agent.name",

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
{
"log": {
"_recordingName": "Test AI SDK Agent Integration with Recording/should preserve original AI SDK span name when no agent metadata is provided",
"creator": {
"comment": "persister:fs",
"name": "Polly.JS",
"version": "6.0.6"
},
"entries": [
{
"_id": "9b04bce29b1900d3b2a6a9d7046cadaf",
"_order": 0,
"cache": {},
"request": {
"bodySize": 669,
"cookies": [],
"headers": [
{
"name": "content-type",
"value": "application/json"
}
],
"headersSize": 165,
"httpVersion": "HTTP/1.1",
"method": "POST",
"postData": {
"mimeType": "application/json",
"params": [],
"text": "{\"model\":\"gpt-4o-mini\",\"input\":[{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Calculate 10 + 5 using the calculator tool\"}]}],\"tools\":[{\"type\":\"function\",\"name\":\"calculate\",\"description\":\"Perform basic mathematical calculations\",\"parameters\":{\"type\":\"object\",\"properties\":{\"operation\":{\"type\":\"string\",\"enum\":[\"add\",\"subtract\",\"multiply\",\"divide\"],\"description\":\"The mathematical operation to perform\"},\"a\":{\"type\":\"number\",\"description\":\"First number\"},\"b\":{\"type\":\"number\",\"description\":\"Second number\"}},\"required\":[\"operation\",\"a\",\"b\"],\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"},\"strict\":false}],\"tool_choice\":\"auto\"}"
},
"queryString": [],
"url": "https://api.openai.com/v1/responses"
},
"response": {
"bodySize": 2246,
"content": {
"mimeType": "application/json",
"size": 2246,
"text": "{\n \"id\": \"resp_0344a918ad130e3500692c6b9b6c6c81948d2136ba18a4b7da\",\n \"object\": \"response\",\n \"created_at\": 1764518811,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"output\": [\n {\n \"id\": \"fc_0344a918ad130e3500692c6b9c484c81949e4d78cd2cd5e3f1\",\n \"type\": \"function_call\",\n \"status\": \"completed\",\n \"arguments\": \"{\\\"operation\\\":\\\"add\\\",\\\"a\\\":10,\\\"b\\\":5}\",\n \"call_id\": \"call_bUdyZcVeNChXGxWMEhK4d1yC\",\n \"name\": \"calculate\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"prompt_cache_retention\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [\n {\n \"type\": \"function\",\n \"description\": \"Perform basic mathematical calculations\",\n \"name\": \"calculate\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"operation\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\",\n \"subtract\",\n \"multiply\",\n \"divide\"\n ],\n \"description\": \"The mathematical operation to perform\"\n },\n \"a\": {\n \"type\": \"number\",\n \"description\": \"First number\"\n },\n \"b\": {\n \"type\": \"number\",\n \"description\": \"Second number\"\n }\n },\n \"required\": [\n \"operation\",\n \"a\",\n \"b\"\n ],\n \"additionalProperties\": false\n },\n \"strict\": false\n }\n ],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 79,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 22,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 101\n },\n \"user\": null,\n \"metadata\": {}\n}"
},
"cookies": [
{
"domain": ".api.openai.com",
"httpOnly": true,
"name": "_cfuvid",
"path": "/",
"sameSite": "None",
"secure": true,
"value": "qhF6jlfO3kBMCCEAUYYudNtdTel7T9a5wnIXPIIsHQ0-1764518813656-0.0.1.1-604800000"
}
],
"headers": [
{
"name": "alt-svc",
"value": "h3=\":443\"; ma=86400"
},
{
"name": "cf-cache-status",
"value": "DYNAMIC"
},
{
"name": "cf-ray",
"value": "9a6b982abaa5935b-TLV"
},
{
"name": "connection",
"value": "keep-alive"
},
{
"name": "content-encoding",
"value": "br"
},
{
"name": "content-type",
"value": "application/json"
},
{
"name": "date",
"value": "Sun, 30 Nov 2025 16:06:53 GMT"
},
{
"name": "openai-organization",
"value": "traceloop"
},
{
"name": "openai-processing-ms",
"value": "2161"
},
{
"name": "openai-project",
"value": "proj_tzz1TbPPOXaf6j9tEkVUBIAa"
},
{
"name": "openai-version",
"value": "2020-10-01"
},
{
"name": "server",
"value": "cloudflare"
},
{
"name": "set-cookie",
"value": "_cfuvid=qhF6jlfO3kBMCCEAUYYudNtdTel7T9a5wnIXPIIsHQ0-1764518813656-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None"
},
{
"name": "strict-transport-security",
"value": "max-age=31536000; includeSubDomains; preload"
},
{
"name": "transfer-encoding",
"value": "chunked"
},
{
"name": "x-content-type-options",
"value": "nosniff"
},
{
"name": "x-envoy-upstream-service-time",
"value": "2163"
},
{
"name": "x-ratelimit-limit-requests",
"value": "30000"
},
{
"name": "x-ratelimit-limit-tokens",
"value": "150000000"
},
{
"name": "x-ratelimit-remaining-requests",
"value": "29999"
},
{
"name": "x-ratelimit-remaining-tokens",
"value": "149999705"
},
{
"name": "x-ratelimit-reset-requests",
"value": "2ms"
},
{
"name": "x-ratelimit-reset-tokens",
"value": "0s"
},
{
"name": "x-request-id",
"value": "req_96d279fdabd64f3abe3f1805c8183b32"
}
],
"headersSize": 958,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2025-11-30T16:06:51.063Z",
"time": 2435,
"timings": {
"blocked": -1,
"connect": -1,
"dns": -1,
"receive": 0,
"send": 0,
"ssl": -1,
"wait": 2435
}
}
],
"pages": [],
"version": "1.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"value": "application/json"
}
],
"headersSize": 273,
"headersSize": 165,
"httpVersion": "HTTP/1.1",
"method": "POST",
"postData": {
Expand All @@ -36,7 +36,7 @@
"content": {
"mimeType": "application/json",
"size": 2245,
"text": "{\n \"id\": \"resp_0e754fd2dd3ca4a000692453dad96881a2b18b96c11135ab3f\",\n \"object\": \"response\",\n \"created_at\": 1763988442,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"output\": [\n {\n \"id\": \"fc_0e754fd2dd3ca4a000692453dbc09881a2a3ba7ee0f18e00bd\",\n \"type\": \"function_call\",\n \"status\": \"completed\",\n \"arguments\": \"{\\\"operation\\\":\\\"add\\\",\\\"a\\\":5,\\\"b\\\":3}\",\n \"call_id\": \"call_SebJXbaRXHEV4MBI8sUrXIQ4\",\n \"name\": \"calculate\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"prompt_cache_retention\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [\n {\n \"type\": \"function\",\n \"description\": \"Perform basic mathematical calculations\",\n \"name\": \"calculate\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"operation\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\",\n \"subtract\",\n \"multiply\",\n \"divide\"\n ],\n \"description\": \"The mathematical operation to perform\"\n },\n \"a\": {\n \"type\": \"number\",\n \"description\": \"First number\"\n },\n \"b\": {\n \"type\": \"number\",\n \"description\": \"Second number\"\n }\n },\n \"required\": [\n \"operation\",\n \"a\",\n \"b\"\n ],\n \"additionalProperties\": false\n },\n \"strict\": false\n }\n ],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 79,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 22,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 101\n },\n \"user\": null,\n \"metadata\": {}\n}"
"text": "{\n \"id\": \"resp_06cd1796e6db213500692c69152cc8819597676548987937a6\",\n \"object\": \"response\",\n \"created_at\": 1764518165,\n \"status\": \"completed\",\n \"background\": false,\n \"billing\": {\n \"payer\": \"developer\"\n },\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"max_tool_calls\": null,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"output\": [\n {\n \"id\": \"fc_06cd1796e6db213500692c6915bfc481958fbfc020bb9bca71\",\n \"type\": \"function_call\",\n \"status\": \"completed\",\n \"arguments\": \"{\\\"operation\\\":\\\"add\\\",\\\"a\\\":5,\\\"b\\\":3}\",\n \"call_id\": \"call_aOLh0xzqYmJsdRu2SZCAjXGk\",\n \"name\": \"calculate\"\n }\n ],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"prompt_cache_key\": null,\n \"prompt_cache_retention\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"safety_identifier\": null,\n \"service_tier\": \"default\",\n \"store\": true,\n \"temperature\": 1.0,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n },\n \"verbosity\": \"medium\"\n },\n \"tool_choice\": \"auto\",\n \"tools\": [\n {\n \"type\": \"function\",\n \"description\": \"Perform basic mathematical calculations\",\n \"name\": \"calculate\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"operation\": {\n \"type\": \"string\",\n \"enum\": [\n \"add\",\n \"subtract\",\n \"multiply\",\n \"divide\"\n ],\n \"description\": \"The mathematical operation to perform\"\n },\n \"a\": {\n \"type\": \"number\",\n \"description\": \"First number\"\n },\n \"b\": {\n \"type\": \"number\",\n \"description\": \"Second number\"\n }\n },\n \"required\": [\n \"operation\",\n \"a\",\n \"b\"\n ],\n \"additionalProperties\": false\n },\n \"strict\": false\n }\n ],\n \"top_logprobs\": 0,\n \"top_p\": 1.0,\n \"truncation\": \"disabled\",\n \"usage\": {\n \"input_tokens\": 79,\n \"input_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"output_tokens\": 22,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 0\n },\n \"total_tokens\": 101\n },\n \"user\": null,\n \"metadata\": {}\n}"
},
"cookies": [
{
Expand All @@ -46,7 +46,7 @@
"path": "/",
"sameSite": "None",
"secure": true,
"value": "z_WEIpdzjXm_j82pEGjPUPhnguWZO_xLh5fJ5MhUC3U-1763988445029-0.0.1.1-604800000"
"value": "N40DOLChO8bYrUpZbE8kW.gmAfTegj0z2o735W66OzA-1764518167404-0.0.1.1-604800000"
}
],
"headers": [
Expand All @@ -60,7 +60,7 @@
},
{
"name": "cf-ray",
"value": "9a3903b48d891f5a-TLV"
"value": "9a6b88639cf90bed-TLV"
},
{
"name": "connection",
Expand All @@ -76,15 +76,15 @@
},
{
"name": "date",
"value": "Mon, 24 Nov 2025 12:47:25 GMT"
"value": "Sun, 30 Nov 2025 15:56:07 GMT"
},
{
"name": "openai-organization",
"value": "traceloop"
},
{
"name": "openai-processing-ms",
"value": "2132"
"value": "2157"
},
{
"name": "openai-project",
Expand All @@ -100,7 +100,7 @@
},
{
"name": "set-cookie",
"value": "_cfuvid=z_WEIpdzjXm_j82pEGjPUPhnguWZO_xLh5fJ5MhUC3U-1763988445029-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None"
"value": "_cfuvid=N40DOLChO8bYrUpZbE8kW.gmAfTegj0z2o735W66OzA-1764518167404-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None"
},
{
"name": "strict-transport-security",
Expand All @@ -116,7 +116,7 @@
},
{
"name": "x-envoy-upstream-service-time",
"value": "2135"
"value": "2160"
},
{
"name": "x-ratelimit-limit-requests",
Expand All @@ -132,7 +132,7 @@
},
{
"name": "x-ratelimit-remaining-tokens",
"value": "149999702"
"value": "149999705"
},
{
"name": "x-ratelimit-reset-requests",
Expand All @@ -144,7 +144,7 @@
},
{
"name": "x-request-id",
"value": "req_72a75431374546598089e1714e871c10"
"value": "req_2ecc43caa6014cb082a97679c52223bf"
}
],
"headersSize": 958,
Expand All @@ -153,16 +153,16 @@
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2025-11-24T12:47:22.157Z",
"time": 2873,
"startedDateTime": "2025-11-30T15:56:04.893Z",
"time": 2441,
"timings": {
"blocked": -1,
"connect": -1,
"dns": -1,
"receive": 0,
"send": 0,
"ssl": -1,
"wait": 2873
"wait": 2441
}
}
],
Expand Down
Loading