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
2 changes: 2 additions & 0 deletions packages/ai-semantic-conventions/src/SemanticAttributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export const SpanAttributes = {
LLM_USAGE_PROMPT_TOKENS: "gen_ai.usage.prompt_tokens",
LLM_USAGE_COMPLETION_TOKENS: "gen_ai.usage.completion_tokens",

GEN_AI_AGENT_NAME: "gen_ai.agent.name",

// LLM
LLM_REQUEST_TYPE: "llm.request.type",
LLM_USAGE_TOTAL_TOKENS: "llm.usage.total_tokens",
Expand Down
2 changes: 1 addition & 1 deletion packages/sample-app/src/sample_vercel_ai_tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const searchRestaurants = tool({
});

async function planTrip(destination: string) {
return await traceloop.withWorkflow(
return await traceloop.withAgent(
{ name: "plan_trip" },
async () => {
console.log(`\n🌟 Planning a trip to ${destination}...\n`);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
{
"log": {
"_recordingName": "Test Agent Decorator/should create spans for agents using decoration syntax",
"creator": {
"comment": "persister:fs",
"name": "Polly.JS",
"version": "6.0.6"
},
"entries": [
{
"_id": "80b48c70cae76a3c38b9af59d5273e33",
"_order": 0,
"cache": {},
"request": {
"bodySize": 139,
"cookies": [],
"headers": [
{
"_fromType": "array",
"name": "content-length",
"value": "139"
},
{
"_fromType": "array",
"name": "accept",
"value": "application/json"
},
{
"_fromType": "array",
"name": "content-type",
"value": "application/json"
},
{
"_fromType": "array",
"name": "user-agent",
"value": "OpenAI/JS 4.38.3"
},
{
"_fromType": "array",
"name": "x-stainless-lang",
"value": "js"
},
{
"_fromType": "array",
"name": "x-stainless-package-version",
"value": "4.38.3"
},
{
"_fromType": "array",
"name": "x-stainless-os",
"value": "MacOS"
},
{
"_fromType": "array",
"name": "x-stainless-arch",
"value": "arm64"
},
{
"_fromType": "array",
"name": "x-stainless-runtime",
"value": "node"
},
{
"_fromType": "array",
"name": "x-stainless-runtime-version",
"value": "v20.11.1"
},
{
"_fromType": "array",
"name": "accept-encoding",
"value": "gzip,deflate"
},
{
"name": "host",
"value": "api.openai.com"
}
],
"headersSize": 583,
"httpVersion": "HTTP/1.1",
"method": "POST",
"postData": {
"mimeType": "application/json",
"params": [],
"text": "{\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Tell me a joke about OpenTelemetry\"\n }\n ],\n \"model\": \"gpt-3.5-turbo\"\n}"
},
"queryString": [],
"url": "https://api.openai.com/v1/chat/completions"
},
"response": {
"bodySize": 651,
"content": {
"encoding": "base64",
"mimeType": "application/json",
"size": 651,
"text": "[\"H4sIAAAAAAAAAwAAAP//\",\"jFLLjhMxELzPVzS+cElWSdjsIxcE7AkOgIS0CLQa9dg9M816bK/dwxJW+XfkyWMSHhIXH7q6yt1V/VQAKDZqBUq3KLoLdvrm6ub8nf18k17Rdf1gq2jslw8/w+Pb2cPHWzXJDF99Iy171pn2XbAk7N0W1pFQKKvOL5cXs8vF1fXFAHTekM20Jsj0xdlyKn2s/HQ2Xyx3zNazpqRW8LUAAHga3jyjM/RDrWA22Vc6SgkbUqtDE4CK3uaKwpQ4CTpRkxHU3gm5Yezbdg2GDUhL8D6Q+0SWOpK4BstVxLiGKhLeQx/gkaUFlgQNR1tHJmdewmvS2CcCFtC+t8Y9F2jRGUuAEMliNiO1vKOjtSAtClTYNNjQs+OxItV9wmyL6609AtA5L1ulbMjdDtkcLLC+CdFX6TeqqtlxastImLzL6ybxQQ3opgC4G6zuT9xTIfouSCn+nobv5sutnBrDHcHFHhQvaMf6+S6eU7XSkCDbdBSV0qhbMiNzzBV7w/4IKI52/nOYv2lv92bX/I/8CGhNQciUIZJhfbrw2BYpn/6/2g4eDwOrRPE7ayqFKeYcDNXY2+1RqrROQl1Zs2sohsjDZeYci03xCwAA//8DAEaTkYeYAwAA\"]"
},
"cookies": [
{
"domain": ".api.openai.com",
"expires": "2025-08-24T22:31:37.000Z",
"httpOnly": true,
"name": "__cf_bm",
"path": "/",
"sameSite": "None",
"secure": true,
"value": ".o0a7QV1g5p2PGVThh2GmiCx5a8.gEUKTV5wQkJcV2o-1756072897-1.0.1.1-p53oAolAr8UafMy5McpEJ9rhTr5Z82LsQPQVeQ5Wca5wKQEq9kaa9EnemekZ6_KBaRWxhl5F.Kf4qkjUGsFC5a3LGZVtl9qnhZompi2UvS0"
},
{
"domain": ".api.openai.com",
"httpOnly": true,
"name": "_cfuvid",
"path": "/",
"sameSite": "None",
"secure": true,
"value": "YH._SGFPHKE16IZLGfcgZL0Vqk..kuHrGz0kglvAD94-1756072897170-0.0.1.1-604800000"
}
],
"headers": [
{
"name": "date",
"value": "Sun, 24 Aug 2025 22:01:37 GMT"
},
{
"name": "content-type",
"value": "application/json"
},
{
"name": "transfer-encoding",
"value": "chunked"
},
{
"name": "connection",
"value": "keep-alive"
},
{
"name": "access-control-expose-headers",
"value": "X-Request-ID"
},
{
"name": "openai-organization",
"value": "traceloop"
},
{
"name": "openai-processing-ms",
"value": "334"
},
{
"name": "openai-project",
"value": "proj_tzz1TbPPOXaf6j9tEkVUBIAa"
},
{
"name": "openai-version",
"value": "2020-10-01"
},
{
"name": "x-envoy-upstream-service-time",
"value": "414"
},
{
"name": "x-ratelimit-limit-requests",
"value": "10000"
},
{
"name": "x-ratelimit-limit-tokens",
"value": "50000000"
},
{
"name": "x-ratelimit-remaining-requests",
"value": "9999"
},
{
"name": "x-ratelimit-remaining-tokens",
"value": "49999989"
},
{
"name": "x-ratelimit-reset-requests",
"value": "6ms"
},
{
"name": "x-ratelimit-reset-tokens",
"value": "0s"
},
{
"name": "x-request-id",
"value": "req_fc8ecede554a4503985a45721f1b8aa9"
},
{
"name": "cf-cache-status",
"value": "DYNAMIC"
},
{
"_fromType": "array",
"name": "set-cookie",
"value": "__cf_bm=.o0a7QV1g5p2PGVThh2GmiCx5a8.gEUKTV5wQkJcV2o-1756072897-1.0.1.1-p53oAolAr8UafMy5McpEJ9rhTr5Z82LsQPQVeQ5Wca5wKQEq9kaa9EnemekZ6_KBaRWxhl5F.Kf4qkjUGsFC5a3LGZVtl9qnhZompi2UvS0; path=/; expires=Sun, 24-Aug-25 22:31:37 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None"
},
{
"_fromType": "array",
"name": "set-cookie",
"value": "_cfuvid=YH._SGFPHKE16IZLGfcgZL0Vqk..kuHrGz0kglvAD94-1756072897170-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": "x-content-type-options",
"value": "nosniff"
},
{
"name": "server",
"value": "cloudflare"
},
{
"name": "cf-ray",
"value": "97462113aa47c224-TLV"
},
{
"name": "content-encoding",
"value": "gzip"
},
{
"name": "alt-svc",
"value": "h3=\":443\"; ma=86400"
}
],
"headersSize": 1294,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2025-08-24T22:01:36.384Z",
"time": 612,
"timings": {
"blocked": -1,
"connect": -1,
"dns": -1,
"receive": 0,
"send": 0,
"ssl": -1,
"wait": 612
}
}
],
"pages": [],
"version": "1.2"
}
}
Loading