openlit 1.16.0__tar.gz → 1.16.2__tar.gz
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.
- {openlit-1.16.0 → openlit-1.16.2}/PKG-INFO +2 -2
- {openlit-1.16.0 → openlit-1.16.2}/pyproject.toml +2 -2
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/anthropic/anthropic.py +2 -2
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/anthropic/async_anthropic.py +2 -2
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/bedrock/__init__.py +3 -3
- openlit-1.16.2/src/openlit/instrumentation/bedrock/bedrock.py +198 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/cohere/cohere.py +2 -2
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/groq/async_groq.py +10 -10
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/groq/groq.py +10 -10
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/mistral/async_mistral.py +4 -4
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/mistral/mistral.py +4 -4
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/openai/async_azure_openai.py +12 -12
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/openai/async_openai.py +10 -10
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/openai/azure_openai.py +12 -12
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/openai/openai.py +10 -10
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/transformers/transformers.py +1 -1
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/semcov/__init__.py +3 -3
- openlit-1.16.0/src/openlit/instrumentation/bedrock/bedrock.py +0 -436
- {openlit-1.16.0 → openlit-1.16.2}/LICENSE +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/README.md +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/__helpers.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/__init__.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/anthropic/__init__.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/chroma/__init__.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/chroma/chroma.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/cohere/__init__.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/elevenlabs/__init__.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/elevenlabs/async_elevenlabs.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/elevenlabs/elevenlabs.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/embedchain/__init__.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/embedchain/embedchain.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/gpt4all/__init__.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/gpt4all/gpt4all.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/gpu/__init__.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/groq/__init__.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/haystack/__init__.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/haystack/haystack.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/langchain/__init__.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/langchain/langchain.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/llamaindex/__init__.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/llamaindex/llamaindex.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/milvus/__init__.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/milvus/milvus.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/mistral/__init__.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/ollama/__init__.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/ollama/async_ollama.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/ollama/ollama.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/openai/__init__.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/pinecone/__init__.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/pinecone/pinecone.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/qdrant/__init__.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/qdrant/qdrant.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/transformers/__init__.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/vertexai/__init__.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/vertexai/async_vertexai.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/instrumentation/vertexai/vertexai.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/otel/metrics.py +0 -0
- {openlit-1.16.0 → openlit-1.16.2}/src/openlit/otel/tracing.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: openlit
|
3
|
-
Version: 1.16.
|
3
|
+
Version: 1.16.2
|
4
4
|
Summary: OpenTelemetry-native Auto instrumentation library for monitoring LLM Applications, facilitating the integration of observability into your GenAI-driven projects
|
5
5
|
Home-page: https://github.com/openlit/openlit/tree/main/openlit/python
|
6
6
|
Keywords: OpenTelemetry,otel,otlp,llm,tracing,openai,anthropic,claude,cohere,llm monitoring,observability,monitoring,gpt,Generative AI,chatGPT
|
@@ -21,7 +21,7 @@ Requires-Dist: opentelemetry-instrumentation (>=0.45b0,<0.46)
|
|
21
21
|
Requires-Dist: opentelemetry-sdk (>=1.24.0,<2.0.0)
|
22
22
|
Requires-Dist: requests (>=2.26.0,<3.0.0)
|
23
23
|
Requires-Dist: schedule (>=1.2.2,<2.0.0)
|
24
|
-
Requires-Dist: tiktoken (>=0.
|
24
|
+
Requires-Dist: tiktoken (>=0.7.0,<0.8.0)
|
25
25
|
Project-URL: Repository, https://github.com/openlit/openlit/tree/main/openlit/python
|
26
26
|
Description-Content-Type: text/markdown
|
27
27
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "openlit"
|
3
|
-
version = "1.16.
|
3
|
+
version = "1.16.2"
|
4
4
|
description = "OpenTelemetry-native Auto instrumentation library for monitoring LLM Applications, facilitating the integration of observability into your GenAI-driven projects"
|
5
5
|
authors = ["OpenLIT"]
|
6
6
|
repository = "https://github.com/openlit/openlit/tree/main/openlit/python"
|
@@ -12,7 +12,7 @@ keywords = ["OpenTelemetry", "otel", "otlp","llm", "tracing", "openai", "anthrop
|
|
12
12
|
python = "^3.7.1"
|
13
13
|
requests = "^2.26.0"
|
14
14
|
schedule = "^1.2.2"
|
15
|
-
tiktoken = "^0.
|
15
|
+
tiktoken = "^0.7.0"
|
16
16
|
gpustat = "^1.1.1"
|
17
17
|
boto3 = "^1.34.0"
|
18
18
|
botocore = "^1.34.0"
|
@@ -120,7 +120,7 @@ def messages(gen_ai_endpoint, version, environment, application_name, tracer,
|
|
120
120
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MODEL,
|
121
121
|
kwargs.get("model", "claude-3-sonnet-20240229"))
|
122
122
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MAX_TOKENS,
|
123
|
-
kwargs.get("max_tokens",
|
123
|
+
kwargs.get("max_tokens", -1))
|
124
124
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|
125
125
|
True)
|
126
126
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
@@ -224,7 +224,7 @@ def messages(gen_ai_endpoint, version, environment, application_name, tracer,
|
|
224
224
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MODEL,
|
225
225
|
kwargs.get("model", "claude-3-sonnet-20240229"))
|
226
226
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MAX_TOKENS,
|
227
|
-
kwargs.get("max_tokens",
|
227
|
+
kwargs.get("max_tokens", -1))
|
228
228
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|
229
229
|
False)
|
230
230
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
@@ -120,7 +120,7 @@ def async_messages(gen_ai_endpoint, version, environment, application_name,
|
|
120
120
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MODEL,
|
121
121
|
kwargs.get("model", "claude-3-sonnet-20240229"))
|
122
122
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MAX_TOKENS,
|
123
|
-
kwargs.get("max_tokens",
|
123
|
+
kwargs.get("max_tokens", -1))
|
124
124
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|
125
125
|
True)
|
126
126
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
@@ -224,7 +224,7 @@ def async_messages(gen_ai_endpoint, version, environment, application_name,
|
|
224
224
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MODEL,
|
225
225
|
kwargs.get("model", "claude-3-sonnet-20240229"))
|
226
226
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MAX_TOKENS,
|
227
|
-
kwargs.get("max_tokens",
|
227
|
+
kwargs.get("max_tokens", -1))
|
228
228
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|
229
229
|
False)
|
230
230
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
@@ -6,9 +6,9 @@ import importlib.metadata
|
|
6
6
|
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
|
7
7
|
from wrapt import wrap_function_wrapper
|
8
8
|
|
9
|
-
from openlit.instrumentation.bedrock.bedrock import
|
9
|
+
from openlit.instrumentation.bedrock.bedrock import converse
|
10
10
|
|
11
|
-
_instruments = ("boto3 >= 1.34.
|
11
|
+
_instruments = ("boto3 >= 1.34.138",)
|
12
12
|
|
13
13
|
class BedrockInstrumentor(BaseInstrumentor):
|
14
14
|
"""
|
@@ -32,7 +32,7 @@ class BedrockInstrumentor(BaseInstrumentor):
|
|
32
32
|
wrap_function_wrapper(
|
33
33
|
"botocore.client",
|
34
34
|
"ClientCreator.create_client",
|
35
|
-
|
35
|
+
converse("bedrock.converse", version, environment, application_name,
|
36
36
|
tracer, pricing_info, trace_content, metrics, disable_metrics),
|
37
37
|
)
|
38
38
|
|
@@ -0,0 +1,198 @@
|
|
1
|
+
# pylint: disable=duplicate-code, broad-exception-caught, too-many-statements, unused-argument, protected-access, too-many-branches
|
2
|
+
"""
|
3
|
+
Module for monitoring Amazon Bedrock API calls.
|
4
|
+
"""
|
5
|
+
|
6
|
+
import logging
|
7
|
+
from botocore.response import StreamingBody
|
8
|
+
from botocore.exceptions import ReadTimeoutError, ResponseStreamingError
|
9
|
+
from urllib3.exceptions import ProtocolError as URLLib3ProtocolError
|
10
|
+
from urllib3.exceptions import ReadTimeoutError as URLLib3ReadTimeoutError
|
11
|
+
from opentelemetry.trace import SpanKind, Status, StatusCode
|
12
|
+
from opentelemetry.sdk.resources import TELEMETRY_SDK_NAME
|
13
|
+
from openlit.__helpers import get_chat_model_cost
|
14
|
+
from openlit.__helpers import handle_exception
|
15
|
+
from openlit.semcov import SemanticConvetion
|
16
|
+
|
17
|
+
# Initialize logger for logging potential issues and operations
|
18
|
+
logger = logging.getLogger(__name__)
|
19
|
+
|
20
|
+
class CustomStreamWrapper(StreamingBody):
|
21
|
+
"""Handle streaming responses with the ability to read multiple times."""
|
22
|
+
|
23
|
+
def __init__(self, stream_source, length):
|
24
|
+
super().__init__(stream_source, length)
|
25
|
+
self._stream_data = None
|
26
|
+
self._read_position = 0
|
27
|
+
|
28
|
+
def read(self, amt=None):
|
29
|
+
if self._stream_data is None:
|
30
|
+
try:
|
31
|
+
self._stream_data = self._raw_stream.read()
|
32
|
+
except URLLib3ReadTimeoutError as error:
|
33
|
+
raise ReadTimeoutError(endpoint_url=error.url, error=error) from error
|
34
|
+
except URLLib3ProtocolError as error:
|
35
|
+
raise ResponseStreamingError(error=error) from error
|
36
|
+
|
37
|
+
self._amount_read += len(self._stream_data)
|
38
|
+
if amt is None or (not self._stream_data and amt > 0):
|
39
|
+
self._verify_content_length()
|
40
|
+
|
41
|
+
if amt is None:
|
42
|
+
data_chunk = self._stream_data[self._read_position:]
|
43
|
+
else:
|
44
|
+
data_start = self._read_position
|
45
|
+
self._read_position += amt
|
46
|
+
data_chunk = self._stream_data[data_start:self._read_position]
|
47
|
+
|
48
|
+
return data_chunk
|
49
|
+
|
50
|
+
|
51
|
+
def converse(gen_ai_endpoint, version, environment, application_name, tracer,
|
52
|
+
pricing_info, trace_content, metrics, disable_metrics):
|
53
|
+
"""
|
54
|
+
Generates a telemetry wrapper for messages to collect metrics.
|
55
|
+
|
56
|
+
Args:
|
57
|
+
gen_ai_endpoint: Endpoint identifier for logging and tracing.
|
58
|
+
version: The monitoring package version.
|
59
|
+
environment: Deployment environment (e.g. production, staging).
|
60
|
+
application_name: Name of the application using the Bedrock API.
|
61
|
+
tracer: OpenTelemetry tracer for creating spans.
|
62
|
+
pricing_info: Information for calculating Bedrock usage cost.
|
63
|
+
trace_content: Whether to trace the actual content.
|
64
|
+
metrics: Metrics collector.
|
65
|
+
disable_metrics: Flag to toggle metrics collection.
|
66
|
+
Returns:
|
67
|
+
A function that wraps the chat method to add telemetry.
|
68
|
+
"""
|
69
|
+
|
70
|
+
def wrapper(wrapped, instance, args, kwargs):
|
71
|
+
"""
|
72
|
+
Wraps an API call to add telemetry.
|
73
|
+
|
74
|
+
Args:
|
75
|
+
wrapped: Original method.
|
76
|
+
instance: Instance of the class.
|
77
|
+
args: Positional arguments of the 'messages' method.
|
78
|
+
kwargs: Keyword arguments of the 'messages' method.
|
79
|
+
Returns:
|
80
|
+
Response from the original method.
|
81
|
+
"""
|
82
|
+
|
83
|
+
def converse_wrapper(original_method, *method_args, **method_kwargs):
|
84
|
+
"""
|
85
|
+
Adds instrumentation to the invoke model call.
|
86
|
+
|
87
|
+
Args:
|
88
|
+
original_method: The original invoke model method.
|
89
|
+
*method_args: Positional arguments for the method.
|
90
|
+
**method_kwargs: Keyword arguments for the method.
|
91
|
+
Returns:
|
92
|
+
The modified response with telemetry.
|
93
|
+
"""
|
94
|
+
with tracer.start_as_current_span(gen_ai_endpoint, kind=SpanKind.CLIENT) as span:
|
95
|
+
response = original_method(*method_args, **method_kwargs)
|
96
|
+
|
97
|
+
try:
|
98
|
+
message_prompt = method_kwargs.get("messages", "")
|
99
|
+
print(message_prompt)
|
100
|
+
formatted_messages = []
|
101
|
+
for message in message_prompt:
|
102
|
+
role = message["role"]
|
103
|
+
content = message["content"]
|
104
|
+
|
105
|
+
if isinstance(content, list):
|
106
|
+
content_str = ", ".join(
|
107
|
+
# pylint: disable=line-too-long
|
108
|
+
f'{item["type"]}: {item["text"] if "text" in item else item["image_url"]}'
|
109
|
+
if "type" in item else f'text: {item["text"]}'
|
110
|
+
for item in content
|
111
|
+
)
|
112
|
+
formatted_messages.append(f"{role}: {content_str}")
|
113
|
+
else:
|
114
|
+
formatted_messages.append(f"{role}: {content}")
|
115
|
+
prompt = "\n".join(formatted_messages)
|
116
|
+
|
117
|
+
model = method_kwargs.get("modelId", "amazon.titan-text-express-v1")
|
118
|
+
input_tokens = response["usage"]["inputTokens"]
|
119
|
+
output_tokens = response["usage"]["outputTokens"]
|
120
|
+
|
121
|
+
span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
|
122
|
+
span.set_attribute(SemanticConvetion.GEN_AI_SYSTEM,
|
123
|
+
SemanticConvetion.GEN_AI_SYSTEM_BEDROCK)
|
124
|
+
span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
|
125
|
+
gen_ai_endpoint)
|
126
|
+
span.set_attribute(SemanticConvetion.GEN_AI_ENVIRONMENT,
|
127
|
+
environment)
|
128
|
+
span.set_attribute(SemanticConvetion.GEN_AI_APPLICATION_NAME,
|
129
|
+
application_name)
|
130
|
+
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MODEL,
|
131
|
+
model)
|
132
|
+
span.set_attribute(SemanticConvetion.GEN_AI_USAGE_PROMPT_TOKENS,
|
133
|
+
input_tokens)
|
134
|
+
span.set_attribute(SemanticConvetion.GEN_AI_USAGE_COMPLETION_TOKENS,
|
135
|
+
output_tokens)
|
136
|
+
span.set_attribute(SemanticConvetion.GEN_AI_USAGE_TOTAL_TOKENS,
|
137
|
+
input_tokens + output_tokens)
|
138
|
+
|
139
|
+
# Calculate cost of the operation
|
140
|
+
cost = get_chat_model_cost(model,
|
141
|
+
pricing_info, input_tokens,
|
142
|
+
output_tokens)
|
143
|
+
span.set_attribute(SemanticConvetion.GEN_AI_USAGE_COST,
|
144
|
+
cost)
|
145
|
+
|
146
|
+
if trace_content:
|
147
|
+
span.set_attribute(SemanticConvetion.GEN_AI_CONTENT_PROMPT,
|
148
|
+
prompt)
|
149
|
+
span.set_attribute(SemanticConvetion.GEN_AI_CONTENT_COMPLETION,
|
150
|
+
response["output"]["message"]["content"][0]["text"])
|
151
|
+
|
152
|
+
span.set_status(Status(StatusCode.OK))
|
153
|
+
|
154
|
+
if disable_metrics is False:
|
155
|
+
attributes = {
|
156
|
+
TELEMETRY_SDK_NAME:
|
157
|
+
"openlit",
|
158
|
+
SemanticConvetion.GEN_AI_APPLICATION_NAME:
|
159
|
+
application_name,
|
160
|
+
SemanticConvetion.GEN_AI_SYSTEM:
|
161
|
+
SemanticConvetion.GEN_AI_SYSTEM_BEDROCK,
|
162
|
+
SemanticConvetion.GEN_AI_ENVIRONMENT:
|
163
|
+
environment,
|
164
|
+
SemanticConvetion.GEN_AI_TYPE:
|
165
|
+
SemanticConvetion.GEN_AI_TYPE_CHAT,
|
166
|
+
SemanticConvetion.GEN_AI_REQUEST_MODEL:
|
167
|
+
model
|
168
|
+
}
|
169
|
+
|
170
|
+
metrics["genai_requests"].add(1, attributes)
|
171
|
+
metrics["genai_total_tokens"].add(
|
172
|
+
input_tokens + output_tokens, attributes
|
173
|
+
)
|
174
|
+
metrics["genai_completion_tokens"].add(output_tokens, attributes)
|
175
|
+
metrics["genai_prompt_tokens"].add(input_tokens, attributes)
|
176
|
+
metrics["genai_cost"].record(cost, attributes)
|
177
|
+
|
178
|
+
return response
|
179
|
+
|
180
|
+
except Exception as e:
|
181
|
+
handle_exception(span, e)
|
182
|
+
logger.error("Error in trace creation: %s", e)
|
183
|
+
|
184
|
+
# Return original response
|
185
|
+
return response
|
186
|
+
|
187
|
+
# Get the original client instance from the wrapper
|
188
|
+
client = wrapped(*args, **kwargs)
|
189
|
+
|
190
|
+
# Replace the original method with the instrumented one
|
191
|
+
if kwargs.get("service_name") == "bedrock-runtime":
|
192
|
+
original_invoke_model = client.converse
|
193
|
+
client.converse = lambda *args, **kwargs: converse_wrapper(original_invoke_model,
|
194
|
+
*args, **kwargs)
|
195
|
+
|
196
|
+
return client
|
197
|
+
|
198
|
+
return wrapper
|
@@ -193,7 +193,7 @@ def chat(gen_ai_endpoint, version, environment, application_name, tracer,
|
|
193
193
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
194
194
|
kwargs.get("temperature", 0.3))
|
195
195
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MAX_TOKENS,
|
196
|
-
kwargs.get("max_tokens",
|
196
|
+
kwargs.get("max_tokens", -1))
|
197
197
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_SEED,
|
198
198
|
kwargs.get("seed", ""))
|
199
199
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_FREQUENCY_PENALTY,
|
@@ -336,7 +336,7 @@ def chat_stream(gen_ai_endpoint, version, environment, application_name,
|
|
336
336
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
337
337
|
kwargs.get("temperature", 0.3))
|
338
338
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MAX_TOKENS,
|
339
|
-
kwargs.get("max_tokens",
|
339
|
+
kwargs.get("max_tokens", -1))
|
340
340
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_SEED,
|
341
341
|
kwargs.get("seed", ""))
|
342
342
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_FREQUENCY_PENALTY,
|
@@ -119,15 +119,15 @@ def async_chat(gen_ai_endpoint, version, environment, application_name,
|
|
119
119
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_USER,
|
120
120
|
kwargs.get("user", ""))
|
121
121
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TOP_P,
|
122
|
-
kwargs.get("top_p", 1))
|
122
|
+
kwargs.get("top_p", 1.0))
|
123
123
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MAX_TOKENS,
|
124
|
-
kwargs.get("max_tokens",
|
124
|
+
kwargs.get("max_tokens", -1))
|
125
125
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
126
|
-
kwargs.get("temperature", 1))
|
126
|
+
kwargs.get("temperature", 1.0))
|
127
127
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_PRESENCE_PENALTY,
|
128
|
-
kwargs.get("presence_penalty", 0))
|
128
|
+
kwargs.get("presence_penalty", 0.0))
|
129
129
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_FREQUENCY_PENALTY,
|
130
|
-
kwargs.get("frequency_penalty", 0))
|
130
|
+
kwargs.get("frequency_penalty", 0.0))
|
131
131
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_SEED,
|
132
132
|
kwargs.get("seed", ""))
|
133
133
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|
@@ -221,17 +221,17 @@ def async_chat(gen_ai_endpoint, version, environment, application_name,
|
|
221
221
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MODEL,
|
222
222
|
kwargs.get("model", "llama3-8b-8192"))
|
223
223
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TOP_P,
|
224
|
-
kwargs.get("top_p", 1))
|
224
|
+
kwargs.get("top_p", 1.0))
|
225
225
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MAX_TOKENS,
|
226
|
-
kwargs.get("max_tokens",
|
226
|
+
kwargs.get("max_tokens", -1))
|
227
227
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_USER,
|
228
228
|
kwargs.get("name", ""))
|
229
229
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
230
|
-
kwargs.get("temperature", 1))
|
230
|
+
kwargs.get("temperature", 1.0))
|
231
231
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_PRESENCE_PENALTY,
|
232
|
-
kwargs.get("presence_penalty", 0))
|
232
|
+
kwargs.get("presence_penalty", 0.0))
|
233
233
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_FREQUENCY_PENALTY,
|
234
|
-
kwargs.get("frequency_penalty", 0))
|
234
|
+
kwargs.get("frequency_penalty", 0.0))
|
235
235
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_SEED,
|
236
236
|
kwargs.get("seed", ""))
|
237
237
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|
@@ -119,15 +119,15 @@ def chat(gen_ai_endpoint, version, environment, application_name,
|
|
119
119
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_USER,
|
120
120
|
kwargs.get("user", ""))
|
121
121
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TOP_P,
|
122
|
-
kwargs.get("top_p", 1))
|
122
|
+
kwargs.get("top_p", 1.0))
|
123
123
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MAX_TOKENS,
|
124
|
-
kwargs.get("max_tokens",
|
124
|
+
kwargs.get("max_tokens", -1))
|
125
125
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
126
|
-
kwargs.get("temperature", 1))
|
126
|
+
kwargs.get("temperature", 1.0))
|
127
127
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_PRESENCE_PENALTY,
|
128
|
-
kwargs.get("presence_penalty", 0))
|
128
|
+
kwargs.get("presence_penalty", 0.0))
|
129
129
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_FREQUENCY_PENALTY,
|
130
|
-
kwargs.get("frequency_penalty", 0))
|
130
|
+
kwargs.get("frequency_penalty", 0.0))
|
131
131
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_SEED,
|
132
132
|
kwargs.get("seed", ""))
|
133
133
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|
@@ -221,17 +221,17 @@ def chat(gen_ai_endpoint, version, environment, application_name,
|
|
221
221
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MODEL,
|
222
222
|
kwargs.get("model", "llama3-8b-8192"))
|
223
223
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TOP_P,
|
224
|
-
kwargs.get("top_p", 1))
|
224
|
+
kwargs.get("top_p", 1.0))
|
225
225
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MAX_TOKENS,
|
226
|
-
kwargs.get("max_tokens",
|
226
|
+
kwargs.get("max_tokens", -1))
|
227
227
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_USER,
|
228
228
|
kwargs.get("name", ""))
|
229
229
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
230
|
-
kwargs.get("temperature", 1))
|
230
|
+
kwargs.get("temperature", 1.0))
|
231
231
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_PRESENCE_PENALTY,
|
232
|
-
kwargs.get("presence_penalty", 0))
|
232
|
+
kwargs.get("presence_penalty", 0.0))
|
233
233
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_FREQUENCY_PENALTY,
|
234
|
-
kwargs.get("frequency_penalty", 0))
|
234
|
+
kwargs.get("frequency_penalty", 0.0))
|
235
235
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_SEED,
|
236
236
|
kwargs.get("seed", ""))
|
237
237
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|
@@ -95,9 +95,9 @@ def async_chat(gen_ai_endpoint, version, environment, application_name,
|
|
95
95
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
96
96
|
kwargs.get("temperature", 0.7))
|
97
97
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TOP_P,
|
98
|
-
kwargs.get("top_p", 1))
|
98
|
+
kwargs.get("top_p", 1.0))
|
99
99
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MAX_TOKENS,
|
100
|
-
kwargs.get("max_tokens",
|
100
|
+
kwargs.get("max_tokens", -1))
|
101
101
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_SEED,
|
102
102
|
kwargs.get("random_seed", ""))
|
103
103
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|
@@ -252,9 +252,9 @@ def async_chat_stream(gen_ai_endpoint, version, environment, application_name,
|
|
252
252
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
253
253
|
kwargs.get("temperature", 0.7))
|
254
254
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TOP_P,
|
255
|
-
kwargs.get("top_p", 1))
|
255
|
+
kwargs.get("top_p", 1.0))
|
256
256
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MAX_TOKENS,
|
257
|
-
kwargs.get("max_tokens",
|
257
|
+
kwargs.get("max_tokens", -1))
|
258
258
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_SEED,
|
259
259
|
kwargs.get("random_seed", ""))
|
260
260
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|
@@ -94,9 +94,9 @@ def chat(gen_ai_endpoint, version, environment, application_name,
|
|
94
94
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
95
95
|
kwargs.get("temperature", 0.7))
|
96
96
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TOP_P,
|
97
|
-
kwargs.get("top_p", 1))
|
97
|
+
kwargs.get("top_p", 1.0))
|
98
98
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MAX_TOKENS,
|
99
|
-
kwargs.get("max_tokens",
|
99
|
+
kwargs.get("max_tokens", -1))
|
100
100
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_SEED,
|
101
101
|
kwargs.get("random_seed", ""))
|
102
102
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|
@@ -251,9 +251,9 @@ def chat_stream(gen_ai_endpoint, version, environment, application_name,
|
|
251
251
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
252
252
|
kwargs.get("temperature", 0.7))
|
253
253
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TOP_P,
|
254
|
-
kwargs.get("top_p", 1))
|
254
|
+
kwargs.get("top_p", 1.0))
|
255
255
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MAX_TOKENS,
|
256
|
-
kwargs.get("max_tokens",
|
256
|
+
kwargs.get("max_tokens", -1))
|
257
257
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_SEED,
|
258
258
|
kwargs.get("random_seed", ""))
|
259
259
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|
@@ -125,11 +125,11 @@ def azure_async_chat_completions(gen_ai_endpoint, version, environment, applicat
|
|
125
125
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TOOL_CHOICE,
|
126
126
|
kwargs.get("tool_choice", ""))
|
127
127
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
128
|
-
kwargs.get("temperature", 1))
|
128
|
+
kwargs.get("temperature", 1.0))
|
129
129
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_PRESENCE_PENALTY,
|
130
|
-
kwargs.get("presence_penalty", 0))
|
130
|
+
kwargs.get("presence_penalty", 0.0))
|
131
131
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_FREQUENCY_PENALTY,
|
132
|
-
kwargs.get("frequency_penalty", 0))
|
132
|
+
kwargs.get("frequency_penalty", 0.0))
|
133
133
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_SEED,
|
134
134
|
kwargs.get("seed", ""))
|
135
135
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|
@@ -228,11 +228,11 @@ def azure_async_chat_completions(gen_ai_endpoint, version, environment, applicat
|
|
228
228
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TOOL_CHOICE,
|
229
229
|
kwargs.get("tool_choice", ""))
|
230
230
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
231
|
-
kwargs.get("temperature", 1))
|
231
|
+
kwargs.get("temperature", 1.0))
|
232
232
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_PRESENCE_PENALTY,
|
233
|
-
kwargs.get("presence_penalty", 0))
|
233
|
+
kwargs.get("presence_penalty", 0.0))
|
234
234
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_FREQUENCY_PENALTY,
|
235
|
-
kwargs.get("frequency_penalty", 0))
|
235
|
+
kwargs.get("frequency_penalty", 0.0))
|
236
236
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_SEED,
|
237
237
|
kwargs.get("seed", ""))
|
238
238
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|
@@ -425,11 +425,11 @@ def azure_async_completions(gen_ai_endpoint, version, environment, application_n
|
|
425
425
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TOOL_CHOICE,
|
426
426
|
kwargs.get("tool_choice", ""))
|
427
427
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
428
|
-
kwargs.get("temperature", 1))
|
428
|
+
kwargs.get("temperature", 1.0))
|
429
429
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_PRESENCE_PENALTY,
|
430
|
-
kwargs.get("presence_penalty", 0))
|
430
|
+
kwargs.get("presence_penalty", 0.0))
|
431
431
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_FREQUENCY_PENALTY,
|
432
|
-
kwargs.get("frequency_penalty", 0))
|
432
|
+
kwargs.get("frequency_penalty", 0.0))
|
433
433
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_SEED,
|
434
434
|
kwargs.get("seed", ""))
|
435
435
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|
@@ -509,11 +509,11 @@ def azure_async_completions(gen_ai_endpoint, version, environment, application_n
|
|
509
509
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TOOL_CHOICE,
|
510
510
|
kwargs.get("tool_choice", ""))
|
511
511
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
512
|
-
kwargs.get("temperature", 1))
|
512
|
+
kwargs.get("temperature", 1.0))
|
513
513
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_PRESENCE_PENALTY,
|
514
|
-
kwargs.get("presence_penalty", 0))
|
514
|
+
kwargs.get("presence_penalty", 0.0))
|
515
515
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_FREQUENCY_PENALTY,
|
516
|
-
kwargs.get("frequency_penalty", 0))
|
516
|
+
kwargs.get("frequency_penalty", 0.0))
|
517
517
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_SEED,
|
518
518
|
kwargs.get("seed", ""))
|
519
519
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|
@@ -122,15 +122,15 @@ def async_chat_completions(gen_ai_endpoint, version, environment, application_na
|
|
122
122
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_USER,
|
123
123
|
kwargs.get("user", ""))
|
124
124
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TOP_P,
|
125
|
-
kwargs.get("top_p", 1))
|
125
|
+
kwargs.get("top_p", 1.0))
|
126
126
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MAX_TOKENS,
|
127
|
-
kwargs.get("max_tokens",
|
127
|
+
kwargs.get("max_tokens", -1))
|
128
128
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
129
|
-
kwargs.get("temperature", 1))
|
129
|
+
kwargs.get("temperature", 1.0))
|
130
130
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_PRESENCE_PENALTY,
|
131
|
-
kwargs.get("presence_penalty", 0))
|
131
|
+
kwargs.get("presence_penalty", 0.0))
|
132
132
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_FREQUENCY_PENALTY,
|
133
|
-
kwargs.get("frequency_penalty", 0))
|
133
|
+
kwargs.get("frequency_penalty", 0.0))
|
134
134
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_SEED,
|
135
135
|
kwargs.get("seed", ""))
|
136
136
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|
@@ -224,17 +224,17 @@ def async_chat_completions(gen_ai_endpoint, version, environment, application_na
|
|
224
224
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MODEL,
|
225
225
|
kwargs.get("model", "gpt-3.5-turbo"))
|
226
226
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TOP_P,
|
227
|
-
kwargs.get("top_p", 1))
|
227
|
+
kwargs.get("top_p", 1.0))
|
228
228
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MAX_TOKENS,
|
229
|
-
kwargs.get("max_tokens",
|
229
|
+
kwargs.get("max_tokens", -1))
|
230
230
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_USER,
|
231
231
|
kwargs.get("user", ""))
|
232
232
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
233
|
-
kwargs.get("temperature", 1))
|
233
|
+
kwargs.get("temperature", 1.0))
|
234
234
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_PRESENCE_PENALTY,
|
235
|
-
kwargs.get("presence_penalty", 0))
|
235
|
+
kwargs.get("presence_penalty", 0.0))
|
236
236
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_FREQUENCY_PENALTY,
|
237
|
-
kwargs.get("frequency_penalty", 0))
|
237
|
+
kwargs.get("frequency_penalty", 0.0))
|
238
238
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_SEED,
|
239
239
|
kwargs.get("seed", ""))
|
240
240
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|
@@ -125,11 +125,11 @@ def azure_chat_completions(gen_ai_endpoint, version, environment, application_na
|
|
125
125
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TOOL_CHOICE,
|
126
126
|
kwargs.get("tool_choice", ""))
|
127
127
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
128
|
-
kwargs.get("temperature", 1))
|
128
|
+
kwargs.get("temperature", 1.0))
|
129
129
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_PRESENCE_PENALTY,
|
130
|
-
kwargs.get("presence_penalty", 0))
|
130
|
+
kwargs.get("presence_penalty", 0.0))
|
131
131
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_FREQUENCY_PENALTY,
|
132
|
-
kwargs.get("frequency_penalty", 0))
|
132
|
+
kwargs.get("frequency_penalty", 0.0))
|
133
133
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_SEED,
|
134
134
|
kwargs.get("seed", ""))
|
135
135
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|
@@ -228,11 +228,11 @@ def azure_chat_completions(gen_ai_endpoint, version, environment, application_na
|
|
228
228
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TOOL_CHOICE,
|
229
229
|
kwargs.get("tool_choice", ""))
|
230
230
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
231
|
-
kwargs.get("temperature", 1))
|
231
|
+
kwargs.get("temperature", 1.0))
|
232
232
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_PRESENCE_PENALTY,
|
233
|
-
kwargs.get("presence_penalty", 0))
|
233
|
+
kwargs.get("presence_penalty", 0.0))
|
234
234
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_FREQUENCY_PENALTY,
|
235
|
-
kwargs.get("frequency_penalty", 0))
|
235
|
+
kwargs.get("frequency_penalty", 0.0))
|
236
236
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_SEED,
|
237
237
|
kwargs.get("seed", ""))
|
238
238
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|
@@ -423,11 +423,11 @@ def azure_completions(gen_ai_endpoint, version, environment, application_name,
|
|
423
423
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TOOL_CHOICE,
|
424
424
|
kwargs.get("tool_choice", ""))
|
425
425
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
426
|
-
kwargs.get("temperature", 1))
|
426
|
+
kwargs.get("temperature", 1.0))
|
427
427
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_PRESENCE_PENALTY,
|
428
|
-
kwargs.get("presence_penalty", 0))
|
428
|
+
kwargs.get("presence_penalty", 0.0))
|
429
429
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_FREQUENCY_PENALTY,
|
430
|
-
kwargs.get("frequency_penalty", 0))
|
430
|
+
kwargs.get("frequency_penalty", 0.0))
|
431
431
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_SEED,
|
432
432
|
kwargs.get("seed", ""))
|
433
433
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|
@@ -507,11 +507,11 @@ def azure_completions(gen_ai_endpoint, version, environment, application_name,
|
|
507
507
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TOOL_CHOICE,
|
508
508
|
kwargs.get("tool_choice", ""))
|
509
509
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_TEMPERATURE,
|
510
|
-
kwargs.get("temperature", 1))
|
510
|
+
kwargs.get("temperature", 1.0))
|
511
511
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_PRESENCE_PENALTY,
|
512
|
-
kwargs.get("presence_penalty", 0))
|
512
|
+
kwargs.get("presence_penalty", 0.0))
|
513
513
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_FREQUENCY_PENALTY,
|
514
|
-
kwargs.get("frequency_penalty", 0))
|
514
|
+
kwargs.get("frequency_penalty", 0.0))
|
515
515
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_SEED,
|
516
516
|
kwargs.get("seed", ""))
|
517
517
|
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_IS_STREAM,
|