@@ -45,6 +45,14 @@ class SpanAttributes:
45
45
"""
46
46
The name of the model being used.
47
47
"""
48
+ LLM_PROVIDER = "llm.provider"
49
+ """
50
+ The provider of the model, such as OpenAI, Azure, Google, etc.
51
+ """
52
+ LLM_SYSTEM = "llm.system"
53
+ """
54
+ The AI product as identified by the client or server
55
+ """
48
56
LLM_PROMPTS = "llm.prompts"
49
57
"""
50
58
Prompts provided to a completions API.
@@ -65,15 +73,40 @@ class SpanAttributes:
65
73
"""
66
74
Number of tokens in the prompt.
67
75
"""
76
+ LLM_TOKEN_COUNT_PROMPT_DETAILS_CACHE_WRITE = "llm.token_count.prompt_details.cache_write"
77
+ """
78
+ Number of tokens in the prompt that were written to cache.
79
+ """
80
+ LLM_TOKEN_COUNT_PROMPT_DETAILS_CACHE_READ = "llm.token_count.prompt_details.cache_read"
81
+ """
82
+ Number of tokens in the prompt that were read from cache.
83
+ """
84
+ LLM_TOKEN_COUNT_PROMPT_DETAILS_AUDIO = "llm.token_count.prompt_details.audio"
85
+ """
86
+ The number of audio input tokens presented in the prompt
87
+ """
68
88
LLM_TOKEN_COUNT_COMPLETION = "llm.token_count.completion"
69
89
"""
70
90
Number of tokens in the completion.
71
91
"""
92
+ LLM_TOKEN_COUNT_COMPLETION_DETAILS_REASONING = "llm.token_count.completion_details.reasoning"
93
+ """
94
+ Number of tokens used for reasoning steps in the completion.
95
+ """
96
+ LLM_TOKEN_COUNT_COMPLETION_DETAILS_AUDIO = "llm.token_count.completion_details.audio"
97
+ """
98
+ The number of audio input tokens generated by the model
99
+ """
72
100
LLM_TOKEN_COUNT_TOTAL = "llm.token_count.total"
73
101
"""
74
102
Total number of tokens, including both prompt and completion.
75
103
"""
76
104
105
+ LLM_TOOLS = "llm.tools"
106
+ """
107
+ List of tools that are advertised to the LLM to be able to call
108
+ """
109
+
77
110
TOOL_NAME = "tool.name"
78
111
"""
79
112
Name of the tool being used.
@@ -112,6 +145,19 @@ class SpanAttributes:
112
145
The id of the user
113
146
"""
114
147
148
+ PROMPT_VENDOR = "prompt.vendor"
149
+ """
150
+ The vendor or origin of the prompt, e.g. a prompt library, a specialized service, etc.
151
+ """
152
+ PROMPT_ID = "prompt.id"
153
+ """
154
+ A vendor-specific id used to locate the prompt.
155
+ """
156
+ PROMPT_URL = "prompt.url"
157
+ """
158
+ A vendor-specific url used to locate the prompt.
159
+ """
160
+
115
161
116
162
class MessageAttributes :
117
163
"""
@@ -151,6 +197,10 @@ class MessageAttributes:
151
197
The JSON string representing the arguments passed to the function
152
198
during a function call.
153
199
"""
200
+ MESSAGE_TOOL_CALL_ID = "message.tool_call_id"
201
+ """
202
+ The id of the tool call.
203
+ """
154
204
155
205
156
206
class MessageContentAttributes :
@@ -186,6 +236,25 @@ class ImageAttributes:
186
236
"""
187
237
188
238
239
+ class AudioAttributes :
240
+ """
241
+ Attributes for audio
242
+ """
243
+
244
+ AUDIO_URL = "audio.url"
245
+ """
246
+ The url to an audio file
247
+ """
248
+ AUDIO_MIME_TYPE = "audio.mime_type"
249
+ """
250
+ The mime type of the audio file
251
+ """
252
+ AUDIO_TRANSCRIPT = "audio.transcript"
253
+ """
254
+ The transcript of the audio file
255
+ """
256
+
257
+
189
258
class DocumentAttributes :
190
259
"""
191
260
Attributes for a document.
@@ -257,6 +326,10 @@ class ToolCallAttributes:
257
326
Attributes for a tool call
258
327
"""
259
328
329
+ TOOL_CALL_ID = "tool_call.id"
330
+ """
331
+ The id of the tool call.
332
+ """
260
333
TOOL_CALL_FUNCTION_NAME = "tool_call.function.name"
261
334
"""
262
335
The name of function that is being called during a tool call.
@@ -268,6 +341,18 @@ class ToolCallAttributes:
268
341
"""
269
342
270
343
344
+ class ToolAttributes :
345
+ """
346
+ Attributes for a tools
347
+ """
348
+
349
+ TOOL_JSON_SCHEMA = "tool.json_schema"
350
+ """
351
+ The json schema of a tool input, It is RECOMMENDED that this be in the
352
+ OpenAI tool calling format: https://platform.openai.com/docs/assistants/tools
353
+ """
354
+
355
+
271
356
class OpenInferenceSpanKindValues (Enum ):
272
357
TOOL = "TOOL"
273
358
CHAIN = "CHAIN"
@@ -284,3 +369,21 @@ class OpenInferenceSpanKindValues(Enum):
284
369
class OpenInferenceMimeTypeValues (Enum ):
285
370
TEXT = "text/plain"
286
371
JSON = "application/json"
372
+
373
+
374
+ class OpenInferenceLLMSystemValues (Enum ):
375
+ OPENAI = "openai"
376
+ ANTHROPIC = "anthropic"
377
+ COHERE = "cohere"
378
+ MISTRALAI = "mistralai"
379
+ VERTEXAI = "vertexai"
380
+
381
+
382
+ class OpenInferenceLLMProviderValues (Enum ):
383
+ OPENAI = "openai"
384
+ ANTHROPIC = "anthropic"
385
+ COHERE = "cohere"
386
+ MISTRALAI = "mistralai"
387
+ GOOGLE = "google"
388
+ AZURE = "azure"
389
+ AWS = "aws"
0 commit comments