langtrace-python-sdk 1.2.19__py3-none-any.whl → 1.2.20__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.
- langtrace_python_sdk/instrumentation/openai/patch.py +15 -4
- langtrace_python_sdk/version.py +1 -1
- {langtrace_python_sdk-1.2.19.dist-info → langtrace_python_sdk-1.2.20.dist-info}/METADATA +1 -1
- {langtrace_python_sdk-1.2.19.dist-info → langtrace_python_sdk-1.2.20.dist-info}/RECORD +6 -6
- {langtrace_python_sdk-1.2.19.dist-info → langtrace_python_sdk-1.2.20.dist-info}/WHEEL +0 -0
- {langtrace_python_sdk-1.2.19.dist-info → langtrace_python_sdk-1.2.20.dist-info}/licenses/LICENSE +0 -0
|
@@ -194,9 +194,20 @@ def chat_completions_create(original_method, version, tracer):
|
|
|
194
194
|
span.end()
|
|
195
195
|
return result
|
|
196
196
|
else:
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
)
|
|
197
|
+
# iterate over kwargs.get("messages", {}) and calculate the prompt tokens
|
|
198
|
+
prompt_tokens = 0
|
|
199
|
+
for message in kwargs.get("messages", {}):
|
|
200
|
+
prompt_tokens += calculate_prompt_tokens(
|
|
201
|
+
json.dumps(message), kwargs.get("model")
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
# iterate over kwargs.get("functions") and calculate the prompt tokens
|
|
205
|
+
if kwargs.get("functions") is not None:
|
|
206
|
+
for function in kwargs.get("functions"):
|
|
207
|
+
prompt_tokens += calculate_prompt_tokens(
|
|
208
|
+
json.dumps(function), kwargs.get("model")
|
|
209
|
+
)
|
|
210
|
+
|
|
200
211
|
return handle_streaming_response(
|
|
201
212
|
result,
|
|
202
213
|
span,
|
|
@@ -289,7 +300,7 @@ def chat_completions_create(original_method, version, tracer):
|
|
|
289
300
|
{
|
|
290
301
|
"message": {
|
|
291
302
|
"role": "assistant",
|
|
292
|
-
"
|
|
303
|
+
"content": "".join(result_content),
|
|
293
304
|
}
|
|
294
305
|
}
|
|
295
306
|
),
|
langtrace_python_sdk/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.2.
|
|
1
|
+
__version__ = "1.2.20"
|
|
@@ -18,7 +18,7 @@ examples/pinecone_example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
|
|
|
18
18
|
examples/pinecone_example/basic.py,sha256=hdV6-5Fmol9zeyFzDtdabD62vkqUJ4lCHG2YcVNpIpI,933
|
|
19
19
|
langtrace_python_sdk/__init__.py,sha256=SlHg447-nQBbw8exRNJP_OyHUZ39Sldb7aaQ35hIRm8,262
|
|
20
20
|
langtrace_python_sdk/langtrace.py,sha256=sWC7WqbOdOUB1sZ_hzLZVp0_Q8fBTRJRMUvOPyO6f20,3170
|
|
21
|
-
langtrace_python_sdk/version.py,sha256=
|
|
21
|
+
langtrace_python_sdk/version.py,sha256=nQtXpLTEUbMtAPecTV_hZAJZb9EhWc8glRv6hgKyvG4,23
|
|
22
22
|
langtrace_python_sdk/constants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
23
|
langtrace_python_sdk/constants/exporter/langtrace_exporter.py,sha256=OfgvphRBPENwsAizqzka9lFu9aDw-A7ErYJ0atl3bpI,56
|
|
24
24
|
langtrace_python_sdk/constants/instrumentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -50,14 +50,14 @@ langtrace_python_sdk/instrumentation/llamaindex/instrumentation.py,sha256=wVSvxS
|
|
|
50
50
|
langtrace_python_sdk/instrumentation/llamaindex/patch.py,sha256=NqBsPM4eE3yMu1aIev8p8yH5Thsv72JL68ABEZNe2ug,2043
|
|
51
51
|
langtrace_python_sdk/instrumentation/openai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
52
52
|
langtrace_python_sdk/instrumentation/openai/instrumentation.py,sha256=stlFopPggB8mgnn4QdVh41rmA8mlzH5x-C00XHfApCE,1408
|
|
53
|
-
langtrace_python_sdk/instrumentation/openai/patch.py,sha256=
|
|
53
|
+
langtrace_python_sdk/instrumentation/openai/patch.py,sha256=Owy_M5dwsCNSeYQVcYKof1Cr-s2AnEXG4IN5ch3Nn84,15764
|
|
54
54
|
langtrace_python_sdk/instrumentation/pinecone/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
55
|
langtrace_python_sdk/instrumentation/pinecone/instrumentation.py,sha256=o0EUd5jvHaDKOUTj4NjnL5UfDHDHxyXkWGlTW4oeRDk,1784
|
|
56
56
|
langtrace_python_sdk/instrumentation/pinecone/patch.py,sha256=5lF7hQmg2-U2EWtOC0w8_peRaNMysBomb0fjiNoS6eQ,2200
|
|
57
57
|
langtrace_python_sdk/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
58
58
|
langtrace_python_sdk/utils/llm.py,sha256=4z2e-md_ELXCEuOIRVWracR6qH2pmsOxCqpkuF9_3Nw,1589
|
|
59
59
|
langtrace_python_sdk/utils/with_root_span.py,sha256=N7ONrcF0myZbHBy5gpQffDbX-Kf63Crsz9szG0i3m08,1889
|
|
60
|
-
langtrace_python_sdk-1.2.
|
|
61
|
-
langtrace_python_sdk-1.2.
|
|
62
|
-
langtrace_python_sdk-1.2.
|
|
63
|
-
langtrace_python_sdk-1.2.
|
|
60
|
+
langtrace_python_sdk-1.2.20.dist-info/METADATA,sha256=dGcm1zAGjaNqo-ahHvoc89V8L6hT_NZUSBZZIQb-PzI,7695
|
|
61
|
+
langtrace_python_sdk-1.2.20.dist-info/WHEEL,sha256=as-1oFTWSeWBgyzh0O_qF439xqBe6AbBgt4MfYe5zwY,87
|
|
62
|
+
langtrace_python_sdk-1.2.20.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
63
|
+
langtrace_python_sdk-1.2.20.dist-info/RECORD,,
|
|
File without changes
|
{langtrace_python_sdk-1.2.19.dist-info → langtrace_python_sdk-1.2.20.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|