openlit 1.33.8__py3-none-any.whl → 1.33.9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. openlit/__helpers.py +83 -0
  2. openlit/__init__.py +1 -1
  3. openlit/instrumentation/ag2/ag2.py +2 -2
  4. openlit/instrumentation/ai21/__init__.py +4 -4
  5. openlit/instrumentation/ai21/ai21.py +370 -319
  6. openlit/instrumentation/ai21/async_ai21.py +371 -319
  7. openlit/instrumentation/anthropic/__init__.py +4 -4
  8. openlit/instrumentation/anthropic/anthropic.py +321 -189
  9. openlit/instrumentation/anthropic/async_anthropic.py +323 -190
  10. openlit/instrumentation/assemblyai/__init__.py +1 -1
  11. openlit/instrumentation/assemblyai/assemblyai.py +59 -43
  12. openlit/instrumentation/astra/astra.py +4 -4
  13. openlit/instrumentation/astra/async_astra.py +4 -4
  14. openlit/instrumentation/azure_ai_inference/__init__.py +4 -4
  15. openlit/instrumentation/azure_ai_inference/async_azure_ai_inference.py +406 -252
  16. openlit/instrumentation/azure_ai_inference/azure_ai_inference.py +406 -252
  17. openlit/instrumentation/bedrock/__init__.py +1 -1
  18. openlit/instrumentation/bedrock/bedrock.py +115 -58
  19. openlit/instrumentation/chroma/chroma.py +4 -4
  20. openlit/instrumentation/cohere/__init__.py +33 -10
  21. openlit/instrumentation/cohere/async_cohere.py +610 -0
  22. openlit/instrumentation/cohere/cohere.py +410 -219
  23. openlit/instrumentation/controlflow/controlflow.py +2 -2
  24. openlit/instrumentation/crawl4ai/async_crawl4ai.py +2 -2
  25. openlit/instrumentation/crawl4ai/crawl4ai.py +2 -2
  26. openlit/instrumentation/crewai/crewai.py +2 -2
  27. openlit/instrumentation/dynamiq/dynamiq.py +2 -2
  28. openlit/instrumentation/elevenlabs/async_elevenlabs.py +73 -47
  29. openlit/instrumentation/elevenlabs/elevenlabs.py +73 -52
  30. openlit/instrumentation/embedchain/embedchain.py +4 -4
  31. openlit/instrumentation/firecrawl/firecrawl.py +2 -2
  32. openlit/instrumentation/google_ai_studio/__init__.py +9 -9
  33. openlit/instrumentation/google_ai_studio/async_google_ai_studio.py +183 -219
  34. openlit/instrumentation/google_ai_studio/google_ai_studio.py +183 -220
  35. openlit/instrumentation/gpt4all/gpt4all.py +17 -17
  36. openlit/instrumentation/groq/async_groq.py +14 -14
  37. openlit/instrumentation/groq/groq.py +14 -14
  38. openlit/instrumentation/haystack/haystack.py +2 -2
  39. openlit/instrumentation/julep/async_julep.py +2 -2
  40. openlit/instrumentation/julep/julep.py +2 -2
  41. openlit/instrumentation/langchain/langchain.py +36 -31
  42. openlit/instrumentation/letta/letta.py +6 -6
  43. openlit/instrumentation/litellm/async_litellm.py +20 -20
  44. openlit/instrumentation/litellm/litellm.py +20 -20
  45. openlit/instrumentation/llamaindex/llamaindex.py +2 -2
  46. openlit/instrumentation/mem0/mem0.py +2 -2
  47. openlit/instrumentation/milvus/milvus.py +4 -4
  48. openlit/instrumentation/mistral/async_mistral.py +18 -18
  49. openlit/instrumentation/mistral/mistral.py +18 -18
  50. openlit/instrumentation/multion/async_multion.py +2 -2
  51. openlit/instrumentation/multion/multion.py +2 -2
  52. openlit/instrumentation/ollama/async_ollama.py +29 -29
  53. openlit/instrumentation/ollama/ollama.py +29 -29
  54. openlit/instrumentation/openai/__init__.py +11 -230
  55. openlit/instrumentation/openai/async_openai.py +434 -409
  56. openlit/instrumentation/openai/openai.py +415 -393
  57. openlit/instrumentation/phidata/phidata.py +2 -2
  58. openlit/instrumentation/pinecone/pinecone.py +4 -4
  59. openlit/instrumentation/premai/premai.py +20 -20
  60. openlit/instrumentation/qdrant/async_qdrant.py +4 -4
  61. openlit/instrumentation/qdrant/qdrant.py +4 -4
  62. openlit/instrumentation/reka/async_reka.py +6 -6
  63. openlit/instrumentation/reka/reka.py +6 -6
  64. openlit/instrumentation/together/async_together.py +18 -18
  65. openlit/instrumentation/together/together.py +18 -18
  66. openlit/instrumentation/transformers/transformers.py +6 -6
  67. openlit/instrumentation/vertexai/async_vertexai.py +53 -53
  68. openlit/instrumentation/vertexai/vertexai.py +53 -53
  69. openlit/instrumentation/vllm/vllm.py +6 -6
  70. openlit/otel/metrics.py +98 -7
  71. openlit/semcov/__init__.py +113 -80
  72. {openlit-1.33.8.dist-info → openlit-1.33.9.dist-info}/METADATA +1 -1
  73. openlit-1.33.9.dist-info/RECORD +121 -0
  74. {openlit-1.33.8.dist-info → openlit-1.33.9.dist-info}/WHEEL +1 -1
  75. openlit/instrumentation/openai/async_azure_openai.py +0 -900
  76. openlit/instrumentation/openai/azure_openai.py +0 -898
  77. openlit-1.33.8.dist-info/RECORD +0 -122
  78. {openlit-1.33.8.dist-info → openlit-1.33.9.dist-info}/LICENSE +0 -0
@@ -80,8 +80,8 @@ def async_chat(gen_ai_endpoint, version, environment, application_name,
80
80
  span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
81
81
  span.set_attribute(SemanticConvetion.GEN_AI_SYSTEM,
82
82
  SemanticConvetion.GEN_AI_SYSTEM_MISTRAL)
83
- span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
84
- SemanticConvetion.GEN_AI_TYPE_CHAT)
83
+ span.set_attribute(SemanticConvetion.GEN_AI_OPERATION,
84
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT)
85
85
  span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
86
86
  gen_ai_endpoint)
87
87
  span.set_attribute(SemanticConvetion.GEN_AI_RESPONSE_ID,
@@ -104,9 +104,9 @@ def async_chat(gen_ai_endpoint, version, environment, application_name,
104
104
  False)
105
105
  span.set_attribute(SemanticConvetion.GEN_AI_RESPONSE_FINISH_REASON,
106
106
  [response.choices[0].finish_reason])
107
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_PROMPT_TOKENS,
107
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_INPUT_TOKENS,
108
108
  response.usage.prompt_tokens)
109
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_COMPLETION_TOKENS,
109
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_OUTPUT_TOKENS,
110
110
  response.usage.completion_tokens)
111
111
  span.set_attribute(SemanticConvetion.GEN_AI_USAGE_TOTAL_TOKENS,
112
112
  response.usage.total_tokens)
@@ -139,8 +139,8 @@ def async_chat(gen_ai_endpoint, version, environment, application_name,
139
139
  SemanticConvetion.GEN_AI_SYSTEM_MISTRAL,
140
140
  SemanticConvetion.GEN_AI_ENVIRONMENT:
141
141
  environment,
142
- SemanticConvetion.GEN_AI_TYPE:
143
- SemanticConvetion.GEN_AI_TYPE_CHAT,
142
+ SemanticConvetion.GEN_AI_OPERATION:
143
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT,
144
144
  SemanticConvetion.GEN_AI_REQUEST_MODEL:
145
145
  kwargs.get("model", "mistral-small-latest")
146
146
  }
@@ -246,8 +246,8 @@ def async_chat_stream(gen_ai_endpoint, version, environment, application_name,
246
246
  span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
247
247
  span.set_attribute(SemanticConvetion.GEN_AI_SYSTEM,
248
248
  SemanticConvetion.GEN_AI_SYSTEM_MISTRAL)
249
- span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
250
- SemanticConvetion.GEN_AI_TYPE_CHAT)
249
+ span.set_attribute(SemanticConvetion.GEN_AI_OPERATION,
250
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT)
251
251
  span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
252
252
  gen_ai_endpoint)
253
253
  span.set_attribute(SemanticConvetion.GEN_AI_RESPONSE_ID,
@@ -270,9 +270,9 @@ def async_chat_stream(gen_ai_endpoint, version, environment, application_name,
270
270
  True)
271
271
  span.set_attribute(SemanticConvetion.GEN_AI_RESPONSE_FINISH_REASON,
272
272
  [finish_reason])
273
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_PROMPT_TOKENS,
273
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_INPUT_TOKENS,
274
274
  prompt_tokens)
275
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_COMPLETION_TOKENS,
275
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_OUTPUT_TOKENS,
276
276
  completion_tokens)
277
277
  span.set_attribute(SemanticConvetion.GEN_AI_USAGE_TOTAL_TOKENS,
278
278
  total_tokens)
@@ -304,8 +304,8 @@ def async_chat_stream(gen_ai_endpoint, version, environment, application_name,
304
304
  SemanticConvetion.GEN_AI_SYSTEM_MISTRAL,
305
305
  SemanticConvetion.GEN_AI_ENVIRONMENT:
306
306
  environment,
307
- SemanticConvetion.GEN_AI_TYPE:
308
- SemanticConvetion.GEN_AI_TYPE_CHAT,
307
+ SemanticConvetion.GEN_AI_OPERATION:
308
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT,
309
309
  SemanticConvetion.GEN_AI_REQUEST_MODEL:
310
310
  kwargs.get("model", "mistral-small-latest")
311
311
  }
@@ -374,8 +374,8 @@ def async_embeddings(gen_ai_endpoint, version, environment, application_name,
374
374
  span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
375
375
  span.set_attribute(SemanticConvetion.GEN_AI_SYSTEM,
376
376
  SemanticConvetion.GEN_AI_SYSTEM_MISTRAL)
377
- span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
378
- SemanticConvetion.GEN_AI_TYPE_EMBEDDING)
377
+ span.set_attribute(SemanticConvetion.GEN_AI_OPERATION,
378
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_EMBEDDING)
379
379
  span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
380
380
  gen_ai_endpoint)
381
381
  span.set_attribute(SemanticConvetion.GEN_AI_ENVIRONMENT,
@@ -384,11 +384,11 @@ def async_embeddings(gen_ai_endpoint, version, environment, application_name,
384
384
  application_name)
385
385
  span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MODEL,
386
386
  kwargs.get('model', "mistral-embed"))
387
- span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_EMBEDDING_FORMAT,
387
+ span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_ENCODING_FORMATS,
388
388
  kwargs.get("encoding_format", "float"))
389
389
  span.set_attribute(SemanticConvetion.GEN_AI_RESPONSE_ID,
390
390
  response.id)
391
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_PROMPT_TOKENS,
391
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_INPUT_TOKENS,
392
392
  response.usage.prompt_tokens)
393
393
  span.set_attribute(SemanticConvetion.GEN_AI_USAGE_TOTAL_TOKENS,
394
394
  response.usage.total_tokens)
@@ -414,8 +414,8 @@ def async_embeddings(gen_ai_endpoint, version, environment, application_name,
414
414
  SemanticConvetion.GEN_AI_SYSTEM_MISTRAL,
415
415
  SemanticConvetion.GEN_AI_ENVIRONMENT:
416
416
  environment,
417
- SemanticConvetion.GEN_AI_TYPE:
418
- SemanticConvetion.GEN_AI_TYPE_EMBEDDING,
417
+ SemanticConvetion.GEN_AI_OPERATION:
418
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_EMBEDDING,
419
419
  SemanticConvetion.GEN_AI_REQUEST_MODEL:
420
420
  kwargs.get('model', "mistral-embed")
421
421
  }
@@ -79,8 +79,8 @@ def chat(gen_ai_endpoint, version, environment, application_name,
79
79
  span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
80
80
  span.set_attribute(SemanticConvetion.GEN_AI_SYSTEM,
81
81
  SemanticConvetion.GEN_AI_SYSTEM_MISTRAL)
82
- span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
83
- SemanticConvetion.GEN_AI_TYPE_CHAT)
82
+ span.set_attribute(SemanticConvetion.GEN_AI_OPERATION,
83
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT)
84
84
  span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
85
85
  gen_ai_endpoint)
86
86
  span.set_attribute(SemanticConvetion.GEN_AI_RESPONSE_ID,
@@ -103,9 +103,9 @@ def chat(gen_ai_endpoint, version, environment, application_name,
103
103
  False)
104
104
  span.set_attribute(SemanticConvetion.GEN_AI_RESPONSE_FINISH_REASON,
105
105
  [response.choices[0].finish_reason])
106
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_PROMPT_TOKENS,
106
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_INPUT_TOKENS,
107
107
  response.usage.prompt_tokens)
108
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_COMPLETION_TOKENS,
108
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_OUTPUT_TOKENS,
109
109
  response.usage.completion_tokens)
110
110
  span.set_attribute(SemanticConvetion.GEN_AI_USAGE_TOTAL_TOKENS,
111
111
  response.usage.total_tokens)
@@ -138,8 +138,8 @@ def chat(gen_ai_endpoint, version, environment, application_name,
138
138
  SemanticConvetion.GEN_AI_SYSTEM_MISTRAL,
139
139
  SemanticConvetion.GEN_AI_ENVIRONMENT:
140
140
  environment,
141
- SemanticConvetion.GEN_AI_TYPE:
142
- SemanticConvetion.GEN_AI_TYPE_CHAT,
141
+ SemanticConvetion.GEN_AI_OPERATION:
142
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT,
143
143
  SemanticConvetion.GEN_AI_REQUEST_MODEL:
144
144
  kwargs.get("model", "mistral-small-latest")
145
145
  }
@@ -245,8 +245,8 @@ def chat_stream(gen_ai_endpoint, version, environment, application_name,
245
245
  span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
246
246
  span.set_attribute(SemanticConvetion.GEN_AI_SYSTEM,
247
247
  SemanticConvetion.GEN_AI_SYSTEM_MISTRAL)
248
- span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
249
- SemanticConvetion.GEN_AI_TYPE_CHAT)
248
+ span.set_attribute(SemanticConvetion.GEN_AI_OPERATION,
249
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT)
250
250
  span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
251
251
  gen_ai_endpoint)
252
252
  span.set_attribute(SemanticConvetion.GEN_AI_RESPONSE_ID,
@@ -269,9 +269,9 @@ def chat_stream(gen_ai_endpoint, version, environment, application_name,
269
269
  True)
270
270
  span.set_attribute(SemanticConvetion.GEN_AI_RESPONSE_FINISH_REASON,
271
271
  [finish_reason])
272
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_PROMPT_TOKENS,
272
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_INPUT_TOKENS,
273
273
  prompt_tokens)
274
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_COMPLETION_TOKENS,
274
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_OUTPUT_TOKENS,
275
275
  completion_tokens)
276
276
  span.set_attribute(SemanticConvetion.GEN_AI_USAGE_TOTAL_TOKENS,
277
277
  total_tokens)
@@ -303,8 +303,8 @@ def chat_stream(gen_ai_endpoint, version, environment, application_name,
303
303
  SemanticConvetion.GEN_AI_SYSTEM_MISTRAL,
304
304
  SemanticConvetion.GEN_AI_ENVIRONMENT:
305
305
  environment,
306
- SemanticConvetion.GEN_AI_TYPE:
307
- SemanticConvetion.GEN_AI_TYPE_CHAT,
306
+ SemanticConvetion.GEN_AI_OPERATION:
307
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT,
308
308
  SemanticConvetion.GEN_AI_REQUEST_MODEL:
309
309
  kwargs.get("model", "mistral-small-latest")
310
310
  }
@@ -373,8 +373,8 @@ def embeddings(gen_ai_endpoint, version, environment, application_name,
373
373
  span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
374
374
  span.set_attribute(SemanticConvetion.GEN_AI_SYSTEM,
375
375
  SemanticConvetion.GEN_AI_SYSTEM_MISTRAL)
376
- span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
377
- SemanticConvetion.GEN_AI_TYPE_EMBEDDING)
376
+ span.set_attribute(SemanticConvetion.GEN_AI_OPERATION,
377
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_EMBEDDING)
378
378
  span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
379
379
  gen_ai_endpoint)
380
380
  span.set_attribute(SemanticConvetion.GEN_AI_ENVIRONMENT,
@@ -383,11 +383,11 @@ def embeddings(gen_ai_endpoint, version, environment, application_name,
383
383
  application_name)
384
384
  span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MODEL,
385
385
  kwargs.get('model', "mistral-embed"))
386
- span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_EMBEDDING_FORMAT,
386
+ span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_ENCODING_FORMATS,
387
387
  kwargs.get("encoding_format", "float"))
388
388
  span.set_attribute(SemanticConvetion.GEN_AI_RESPONSE_ID,
389
389
  response.id)
390
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_PROMPT_TOKENS,
390
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_INPUT_TOKENS,
391
391
  response.usage.prompt_tokens)
392
392
  span.set_attribute(SemanticConvetion.GEN_AI_USAGE_TOTAL_TOKENS,
393
393
  response.usage.total_tokens)
@@ -413,8 +413,8 @@ def embeddings(gen_ai_endpoint, version, environment, application_name,
413
413
  SemanticConvetion.GEN_AI_SYSTEM_MISTRAL,
414
414
  SemanticConvetion.GEN_AI_ENVIRONMENT:
415
415
  environment,
416
- SemanticConvetion.GEN_AI_TYPE:
417
- SemanticConvetion.GEN_AI_TYPE_EMBEDDING,
416
+ SemanticConvetion.GEN_AI_OPERATION:
417
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_EMBEDDING,
418
418
  SemanticConvetion.GEN_AI_REQUEST_MODEL:
419
419
  kwargs.get('model', "mistral-embed")
420
420
  }
@@ -58,8 +58,8 @@ def async_multion_wrap(gen_ai_endpoint, version, environment, application_name,
58
58
  span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
59
59
  span.set_attribute(SemanticConvetion.GEN_AI_SYSTEM,
60
60
  SemanticConvetion.GEN_AI_SYSTEM_MULTION)
61
- span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
62
- SemanticConvetion.GEN_AI_TYPE_AGENT)
61
+ span.set_attribute(SemanticConvetion.GEN_AI_OPERATION,
62
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_AGENT)
63
63
  span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
64
64
  gen_ai_endpoint)
65
65
  span.set_attribute(SemanticConvetion.GEN_AI_APPLICATION_NAME,
@@ -58,8 +58,8 @@ def multion_wrap(gen_ai_endpoint, version, environment, application_name,
58
58
  span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
59
59
  span.set_attribute(SemanticConvetion.GEN_AI_SYSTEM,
60
60
  SemanticConvetion.GEN_AI_SYSTEM_MULTION)
61
- span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
62
- SemanticConvetion.GEN_AI_TYPE_AGENT)
61
+ span.set_attribute(SemanticConvetion.GEN_AI_OPERATION,
62
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_AGENT)
63
63
  span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
64
64
  gen_ai_endpoint)
65
65
  span.set_attribute(SemanticConvetion.GEN_AI_APPLICATION_NAME,
@@ -104,8 +104,8 @@ def async_chat(gen_ai_endpoint, version, environment, application_name,
104
104
  span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
105
105
  span.set_attribute(SemanticConvetion.GEN_AI_SYSTEM,
106
106
  SemanticConvetion.GEN_AI_SYSTEM_OLLAMA)
107
- span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
108
- SemanticConvetion.GEN_AI_TYPE_CHAT)
107
+ span.set_attribute(SemanticConvetion.GEN_AI_OPERATION,
108
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT)
109
109
  span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
110
110
  gen_ai_endpoint)
111
111
  span.set_attribute(SemanticConvetion.GEN_AI_ENVIRONMENT,
@@ -116,9 +116,9 @@ def async_chat(gen_ai_endpoint, version, environment, application_name,
116
116
  kwargs.get("model", "llama3"))
117
117
  span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
118
118
  True)
119
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_PROMPT_TOKENS,
119
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_INPUT_TOKENS,
120
120
  prompt_tokens)
121
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_COMPLETION_TOKENS,
121
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_OUTPUT_TOKENS,
122
122
  completion_tokens)
123
123
  span.set_attribute(SemanticConvetion.GEN_AI_USAGE_TOTAL_TOKENS,
124
124
  total_tokens)
@@ -150,8 +150,8 @@ def async_chat(gen_ai_endpoint, version, environment, application_name,
150
150
  SemanticConvetion.GEN_AI_SYSTEM_OLLAMA,
151
151
  SemanticConvetion.GEN_AI_ENVIRONMENT:
152
152
  environment,
153
- SemanticConvetion.GEN_AI_TYPE:
154
- SemanticConvetion.GEN_AI_TYPE_CHAT,
153
+ SemanticConvetion.GEN_AI_OPERATION:
154
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT,
155
155
  SemanticConvetion.GEN_AI_REQUEST_MODEL:
156
156
  kwargs.get("model", "llama3")
157
157
  }
@@ -198,8 +198,8 @@ def async_chat(gen_ai_endpoint, version, environment, application_name,
198
198
  span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
199
199
  span.set_attribute(SemanticConvetion.GEN_AI_SYSTEM,
200
200
  SemanticConvetion.GEN_AI_SYSTEM_OLLAMA)
201
- span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
202
- SemanticConvetion.GEN_AI_TYPE_CHAT)
201
+ span.set_attribute(SemanticConvetion.GEN_AI_OPERATION,
202
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT)
203
203
  span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
204
204
  gen_ai_endpoint)
205
205
  span.set_attribute(SemanticConvetion.GEN_AI_ENVIRONMENT,
@@ -231,9 +231,9 @@ def async_chat(gen_ai_endpoint, version, environment, application_name,
231
231
  cost = get_chat_model_cost(kwargs.get("model", "llama3"),
232
232
  pricing_info, prompt_tokens, completion_tokens)
233
233
 
234
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_PROMPT_TOKENS,
234
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_INPUT_TOKENS,
235
235
  prompt_tokens)
236
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_COMPLETION_TOKENS,
236
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_OUTPUT_TOKENS,
237
237
  completion_tokens)
238
238
  span.set_attribute(SemanticConvetion.GEN_AI_USAGE_TOTAL_TOKENS,
239
239
  total_tokens)
@@ -254,8 +254,8 @@ def async_chat(gen_ai_endpoint, version, environment, application_name,
254
254
  SemanticConvetion.GEN_AI_SYSTEM_OLLAMA,
255
255
  SemanticConvetion.GEN_AI_ENVIRONMENT:
256
256
  environment,
257
- SemanticConvetion.GEN_AI_TYPE:
258
- SemanticConvetion.GEN_AI_TYPE_CHAT,
257
+ SemanticConvetion.GEN_AI_OPERATION:
258
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT,
259
259
  SemanticConvetion.GEN_AI_REQUEST_MODEL:
260
260
  kwargs.get("model", "llama3")
261
261
  }
@@ -347,8 +347,8 @@ def async_generate(gen_ai_endpoint, version, environment, application_name,
347
347
  span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
348
348
  span.set_attribute(SemanticConvetion.GEN_AI_SYSTEM,
349
349
  SemanticConvetion.GEN_AI_SYSTEM_OLLAMA)
350
- span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
351
- SemanticConvetion.GEN_AI_TYPE_CHAT)
350
+ span.set_attribute(SemanticConvetion.GEN_AI_OPERATION,
351
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT)
352
352
  span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
353
353
  gen_ai_endpoint)
354
354
  span.set_attribute(SemanticConvetion.GEN_AI_ENVIRONMENT,
@@ -359,9 +359,9 @@ def async_generate(gen_ai_endpoint, version, environment, application_name,
359
359
  kwargs.get("model", "llama3"))
360
360
  span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
361
361
  True)
362
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_PROMPT_TOKENS,
362
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_INPUT_TOKENS,
363
363
  prompt_tokens)
364
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_COMPLETION_TOKENS,
364
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_OUTPUT_TOKENS,
365
365
  completion_tokens)
366
366
  span.set_attribute(SemanticConvetion.GEN_AI_USAGE_TOTAL_TOKENS,
367
367
  total_tokens)
@@ -394,8 +394,8 @@ def async_generate(gen_ai_endpoint, version, environment, application_name,
394
394
  SemanticConvetion.GEN_AI_SYSTEM_OLLAMA,
395
395
  SemanticConvetion.GEN_AI_ENVIRONMENT:
396
396
  environment,
397
- SemanticConvetion.GEN_AI_TYPE:
398
- SemanticConvetion.GEN_AI_TYPE_CHAT,
397
+ SemanticConvetion.GEN_AI_OPERATION:
398
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT,
399
399
  SemanticConvetion.GEN_AI_REQUEST_MODEL:
400
400
  kwargs.get("model", "llama3")
401
401
  }
@@ -423,8 +423,8 @@ def async_generate(gen_ai_endpoint, version, environment, application_name,
423
423
  span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
424
424
  span.set_attribute(SemanticConvetion.GEN_AI_SYSTEM,
425
425
  SemanticConvetion.GEN_AI_SYSTEM_OLLAMA)
426
- span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
427
- SemanticConvetion.GEN_AI_TYPE_CHAT)
426
+ span.set_attribute(SemanticConvetion.GEN_AI_OPERATION,
427
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT)
428
428
  span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
429
429
  gen_ai_endpoint)
430
430
  span.set_attribute(SemanticConvetion.GEN_AI_ENVIRONMENT,
@@ -456,9 +456,9 @@ def async_generate(gen_ai_endpoint, version, environment, application_name,
456
456
  cost = get_chat_model_cost(kwargs.get("model", "llama3"),
457
457
  pricing_info, prompt_tokens, completion_tokens)
458
458
 
459
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_PROMPT_TOKENS,
459
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_INPUT_TOKENS,
460
460
  prompt_tokens)
461
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_COMPLETION_TOKENS,
461
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_OUTPUT_TOKENS,
462
462
  completion_tokens)
463
463
  span.set_attribute(SemanticConvetion.GEN_AI_USAGE_TOTAL_TOKENS,
464
464
  total_tokens)
@@ -479,8 +479,8 @@ def async_generate(gen_ai_endpoint, version, environment, application_name,
479
479
  SemanticConvetion.GEN_AI_SYSTEM_OLLAMA,
480
480
  SemanticConvetion.GEN_AI_ENVIRONMENT:
481
481
  environment,
482
- SemanticConvetion.GEN_AI_TYPE:
483
- SemanticConvetion.GEN_AI_TYPE_CHAT,
482
+ SemanticConvetion.GEN_AI_OPERATION:
483
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT,
484
484
  SemanticConvetion.GEN_AI_REQUEST_MODEL:
485
485
  kwargs.get("model", "llama3")
486
486
  }
@@ -550,8 +550,8 @@ def async_embeddings(gen_ai_endpoint, version, environment, application_name,
550
550
  span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
551
551
  span.set_attribute(SemanticConvetion.GEN_AI_SYSTEM,
552
552
  SemanticConvetion.GEN_AI_SYSTEM_OLLAMA)
553
- span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
554
- SemanticConvetion.GEN_AI_TYPE_EMBEDDING)
553
+ span.set_attribute(SemanticConvetion.GEN_AI_OPERATION,
554
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_EMBEDDING)
555
555
  span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
556
556
  gen_ai_endpoint)
557
557
  span.set_attribute(SemanticConvetion.GEN_AI_ENVIRONMENT,
@@ -560,7 +560,7 @@ def async_embeddings(gen_ai_endpoint, version, environment, application_name,
560
560
  application_name)
561
561
  span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MODEL,
562
562
  kwargs.get('model', "llama3"))
563
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_PROMPT_TOKENS,
563
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_INPUT_TOKENS,
564
564
  prompt_tokens)
565
565
  span.set_attribute(SemanticConvetion.GEN_AI_USAGE_TOTAL_TOKENS,
566
566
  prompt_tokens)
@@ -586,8 +586,8 @@ def async_embeddings(gen_ai_endpoint, version, environment, application_name,
586
586
  SemanticConvetion.GEN_AI_SYSTEM_OLLAMA,
587
587
  SemanticConvetion.GEN_AI_ENVIRONMENT:
588
588
  environment,
589
- SemanticConvetion.GEN_AI_TYPE:
590
- SemanticConvetion.GEN_AI_TYPE_EMBEDDING,
589
+ SemanticConvetion.GEN_AI_OPERATION:
590
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_EMBEDDING,
591
591
  SemanticConvetion.GEN_AI_REQUEST_MODEL:
592
592
  kwargs.get('model', "llama3")
593
593
  }
@@ -105,8 +105,8 @@ def chat(gen_ai_endpoint, version, environment, application_name,
105
105
  span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
106
106
  span.set_attribute(SemanticConvetion.GEN_AI_SYSTEM,
107
107
  SemanticConvetion.GEN_AI_SYSTEM_OLLAMA)
108
- span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
109
- SemanticConvetion.GEN_AI_TYPE_CHAT)
108
+ span.set_attribute(SemanticConvetion.GEN_AI_OPERATION,
109
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT)
110
110
  span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
111
111
  gen_ai_endpoint)
112
112
  span.set_attribute(SemanticConvetion.GEN_AI_ENVIRONMENT,
@@ -117,9 +117,9 @@ def chat(gen_ai_endpoint, version, environment, application_name,
117
117
  kwargs.get("model", "llama3"))
118
118
  span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
119
119
  True)
120
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_PROMPT_TOKENS,
120
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_INPUT_TOKENS,
121
121
  prompt_tokens)
122
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_COMPLETION_TOKENS,
122
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_OUTPUT_TOKENS,
123
123
  completion_tokens)
124
124
  span.set_attribute(SemanticConvetion.GEN_AI_USAGE_TOTAL_TOKENS,
125
125
  total_tokens)
@@ -151,8 +151,8 @@ def chat(gen_ai_endpoint, version, environment, application_name,
151
151
  SemanticConvetion.GEN_AI_SYSTEM_OLLAMA,
152
152
  SemanticConvetion.GEN_AI_ENVIRONMENT:
153
153
  environment,
154
- SemanticConvetion.GEN_AI_TYPE:
155
- SemanticConvetion.GEN_AI_TYPE_CHAT,
154
+ SemanticConvetion.GEN_AI_OPERATION:
155
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT,
156
156
  SemanticConvetion.GEN_AI_REQUEST_MODEL:
157
157
  kwargs.get("model", "llama3")
158
158
  }
@@ -199,8 +199,8 @@ def chat(gen_ai_endpoint, version, environment, application_name,
199
199
  span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
200
200
  span.set_attribute(SemanticConvetion.GEN_AI_SYSTEM,
201
201
  SemanticConvetion.GEN_AI_SYSTEM_OLLAMA)
202
- span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
203
- SemanticConvetion.GEN_AI_TYPE_CHAT)
202
+ span.set_attribute(SemanticConvetion.GEN_AI_OPERATION,
203
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT)
204
204
  span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
205
205
  gen_ai_endpoint)
206
206
  span.set_attribute(SemanticConvetion.GEN_AI_ENVIRONMENT,
@@ -232,9 +232,9 @@ def chat(gen_ai_endpoint, version, environment, application_name,
232
232
  cost = get_chat_model_cost(kwargs.get("model", "llama3"),
233
233
  pricing_info, prompt_tokens, completion_tokens)
234
234
 
235
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_PROMPT_TOKENS,
235
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_INPUT_TOKENS,
236
236
  prompt_tokens)
237
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_COMPLETION_TOKENS,
237
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_OUTPUT_TOKENS,
238
238
  completion_tokens)
239
239
  span.set_attribute(SemanticConvetion.GEN_AI_USAGE_TOTAL_TOKENS,
240
240
  total_tokens)
@@ -255,8 +255,8 @@ def chat(gen_ai_endpoint, version, environment, application_name,
255
255
  SemanticConvetion.GEN_AI_SYSTEM_OLLAMA,
256
256
  SemanticConvetion.GEN_AI_ENVIRONMENT:
257
257
  environment,
258
- SemanticConvetion.GEN_AI_TYPE:
259
- SemanticConvetion.GEN_AI_TYPE_CHAT,
258
+ SemanticConvetion.GEN_AI_OPERATION:
259
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT,
260
260
  SemanticConvetion.GEN_AI_REQUEST_MODEL:
261
261
  kwargs.get("model", "llama3")
262
262
  }
@@ -348,8 +348,8 @@ def generate(gen_ai_endpoint, version, environment, application_name,
348
348
  span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
349
349
  span.set_attribute(SemanticConvetion.GEN_AI_SYSTEM,
350
350
  SemanticConvetion.GEN_AI_SYSTEM_OLLAMA)
351
- span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
352
- SemanticConvetion.GEN_AI_TYPE_CHAT)
351
+ span.set_attribute(SemanticConvetion.GEN_AI_OPERATION,
352
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT)
353
353
  span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
354
354
  gen_ai_endpoint)
355
355
  span.set_attribute(SemanticConvetion.GEN_AI_ENVIRONMENT,
@@ -360,9 +360,9 @@ def generate(gen_ai_endpoint, version, environment, application_name,
360
360
  kwargs.get("model", "llama3"))
361
361
  span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
362
362
  True)
363
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_PROMPT_TOKENS,
363
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_INPUT_TOKENS,
364
364
  prompt_tokens)
365
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_COMPLETION_TOKENS,
365
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_OUTPUT_TOKENS,
366
366
  completion_tokens)
367
367
  span.set_attribute(SemanticConvetion.GEN_AI_USAGE_TOTAL_TOKENS,
368
368
  total_tokens)
@@ -395,8 +395,8 @@ def generate(gen_ai_endpoint, version, environment, application_name,
395
395
  SemanticConvetion.GEN_AI_SYSTEM_OLLAMA,
396
396
  SemanticConvetion.GEN_AI_ENVIRONMENT:
397
397
  environment,
398
- SemanticConvetion.GEN_AI_TYPE:
399
- SemanticConvetion.GEN_AI_TYPE_CHAT,
398
+ SemanticConvetion.GEN_AI_OPERATION:
399
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT,
400
400
  SemanticConvetion.GEN_AI_REQUEST_MODEL:
401
401
  kwargs.get("model", "llama3")
402
402
  }
@@ -424,8 +424,8 @@ def generate(gen_ai_endpoint, version, environment, application_name,
424
424
  span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
425
425
  span.set_attribute(SemanticConvetion.GEN_AI_SYSTEM,
426
426
  SemanticConvetion.GEN_AI_SYSTEM_OLLAMA)
427
- span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
428
- SemanticConvetion.GEN_AI_TYPE_CHAT)
427
+ span.set_attribute(SemanticConvetion.GEN_AI_OPERATION,
428
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT)
429
429
  span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
430
430
  gen_ai_endpoint)
431
431
  span.set_attribute(SemanticConvetion.GEN_AI_ENVIRONMENT,
@@ -457,9 +457,9 @@ def generate(gen_ai_endpoint, version, environment, application_name,
457
457
  cost = get_chat_model_cost(kwargs.get("model", "llama3"),
458
458
  pricing_info, prompt_tokens, completion_tokens)
459
459
 
460
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_PROMPT_TOKENS,
460
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_INPUT_TOKENS,
461
461
  prompt_tokens)
462
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_COMPLETION_TOKENS,
462
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_OUTPUT_TOKENS,
463
463
  completion_tokens)
464
464
  span.set_attribute(SemanticConvetion.GEN_AI_USAGE_TOTAL_TOKENS,
465
465
  total_tokens)
@@ -480,8 +480,8 @@ def generate(gen_ai_endpoint, version, environment, application_name,
480
480
  SemanticConvetion.GEN_AI_SYSTEM_OLLAMA,
481
481
  SemanticConvetion.GEN_AI_ENVIRONMENT:
482
482
  environment,
483
- SemanticConvetion.GEN_AI_TYPE:
484
- SemanticConvetion.GEN_AI_TYPE_CHAT,
483
+ SemanticConvetion.GEN_AI_OPERATION:
484
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_CHAT,
485
485
  SemanticConvetion.GEN_AI_REQUEST_MODEL:
486
486
  kwargs.get("model", "llama3")
487
487
  }
@@ -551,8 +551,8 @@ def embeddings(gen_ai_endpoint, version, environment, application_name,
551
551
  span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
552
552
  span.set_attribute(SemanticConvetion.GEN_AI_SYSTEM,
553
553
  SemanticConvetion.GEN_AI_SYSTEM_OLLAMA)
554
- span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
555
- SemanticConvetion.GEN_AI_TYPE_EMBEDDING)
554
+ span.set_attribute(SemanticConvetion.GEN_AI_OPERATION,
555
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_EMBEDDING)
556
556
  span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
557
557
  gen_ai_endpoint)
558
558
  span.set_attribute(SemanticConvetion.GEN_AI_ENVIRONMENT,
@@ -561,7 +561,7 @@ def embeddings(gen_ai_endpoint, version, environment, application_name,
561
561
  application_name)
562
562
  span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MODEL,
563
563
  kwargs.get('model', "llama3"))
564
- span.set_attribute(SemanticConvetion.GEN_AI_USAGE_PROMPT_TOKENS,
564
+ span.set_attribute(SemanticConvetion.GEN_AI_USAGE_INPUT_TOKENS,
565
565
  prompt_tokens)
566
566
  span.set_attribute(SemanticConvetion.GEN_AI_USAGE_TOTAL_TOKENS,
567
567
  prompt_tokens)
@@ -587,8 +587,8 @@ def embeddings(gen_ai_endpoint, version, environment, application_name,
587
587
  SemanticConvetion.GEN_AI_SYSTEM_OLLAMA,
588
588
  SemanticConvetion.GEN_AI_ENVIRONMENT:
589
589
  environment,
590
- SemanticConvetion.GEN_AI_TYPE:
591
- SemanticConvetion.GEN_AI_TYPE_EMBEDDING,
590
+ SemanticConvetion.GEN_AI_OPERATION:
591
+ SemanticConvetion.GEN_AI_OPERATION_TYPE_EMBEDDING,
592
592
  SemanticConvetion.GEN_AI_REQUEST_MODEL:
593
593
  kwargs.get('model', "llama3")
594
594
  }