langtrace-python-sdk 1.2.14__py3-none-any.whl → 1.2.16__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/extensions/langtrace_exporter.py +0 -2
- langtrace_python_sdk/instrumentation/anthropic/instrumentation.py +4 -0
- langtrace_python_sdk/instrumentation/chroma/instrumentation.py +3 -0
- langtrace_python_sdk/instrumentation/langchain/instrumentation.py +4 -0
- langtrace_python_sdk/instrumentation/llamaindex/instrumentation.py +4 -0
- langtrace_python_sdk/instrumentation/openai/instrumentation.py +4 -1
- langtrace_python_sdk/instrumentation/openai/patch.py +1 -3
- langtrace_python_sdk/instrumentation/pinecone/instrumentation.py +4 -0
- langtrace_python_sdk/version.py +1 -1
- {langtrace_python_sdk-1.2.14.dist-info → langtrace_python_sdk-1.2.16.dist-info}/METADATA +1 -1
- {langtrace_python_sdk-1.2.14.dist-info → langtrace_python_sdk-1.2.16.dist-info}/RECORD +13 -13
- {langtrace_python_sdk-1.2.14.dist-info → langtrace_python_sdk-1.2.16.dist-info}/WHEEL +0 -0
- {langtrace_python_sdk-1.2.14.dist-info → langtrace_python_sdk-1.2.16.dist-info}/licenses/LICENSE +0 -0
|
@@ -90,10 +90,8 @@ class LangTraceExporter(SpanExporter):
|
|
|
90
90
|
data=json.dumps(data),
|
|
91
91
|
headers={"Content-Type": "application/json", "x-api-key": self.api_key},
|
|
92
92
|
)
|
|
93
|
-
print(f"Traces sent To {LANGTRACE_REMOTE_URL}")
|
|
94
93
|
return SpanExportResult.SUCCESS
|
|
95
94
|
except Exception as e:
|
|
96
|
-
print("Error sending data to remote URL", e)
|
|
97
95
|
return SpanExportResult.FAILURE
|
|
98
96
|
|
|
99
97
|
def shutdown(self) -> None:
|
|
@@ -11,6 +11,10 @@ from wrapt import wrap_function_wrapper
|
|
|
11
11
|
|
|
12
12
|
from langtrace_python_sdk.instrumentation.anthropic.patch import messages_create
|
|
13
13
|
|
|
14
|
+
import logging
|
|
15
|
+
|
|
16
|
+
logging.basicConfig(level=logging.FATAL)
|
|
17
|
+
|
|
14
18
|
|
|
15
19
|
class AnthropicInstrumentation(BaseInstrumentor):
|
|
16
20
|
"""
|
|
@@ -11,6 +11,9 @@ from wrapt import wrap_function_wrapper
|
|
|
11
11
|
|
|
12
12
|
from langtrace_python_sdk.constants.instrumentation.chroma import APIS
|
|
13
13
|
from langtrace_python_sdk.instrumentation.chroma.patch import collection_patch
|
|
14
|
+
import logging
|
|
15
|
+
|
|
16
|
+
logging.basicConfig(level=logging.FATAL)
|
|
14
17
|
|
|
15
18
|
|
|
16
19
|
class ChromaInstrumentation(BaseInstrumentor):
|
|
@@ -12,6 +12,10 @@ from wrapt import wrap_function_wrapper
|
|
|
12
12
|
|
|
13
13
|
from langtrace_python_sdk.instrumentation.langchain.patch import generic_patch
|
|
14
14
|
|
|
15
|
+
import logging
|
|
16
|
+
|
|
17
|
+
logging.basicConfig(level=logging.FATAL)
|
|
18
|
+
|
|
15
19
|
|
|
16
20
|
def patch_module_classes(
|
|
17
21
|
module_name, tracer, version, task, trace_output=True, trace_input=True
|
|
@@ -12,6 +12,10 @@ from wrapt import wrap_function_wrapper
|
|
|
12
12
|
|
|
13
13
|
from langtrace_python_sdk.instrumentation.llamaindex.patch import generic_patch
|
|
14
14
|
|
|
15
|
+
import logging
|
|
16
|
+
|
|
17
|
+
logging.basicConfig(level=logging.FATAL)
|
|
18
|
+
|
|
15
19
|
|
|
16
20
|
class LlamaindexInstrumentation(BaseInstrumentor):
|
|
17
21
|
"""
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import importlib.metadata
|
|
2
2
|
from typing import Collection
|
|
3
3
|
|
|
4
|
-
import openai
|
|
5
4
|
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
|
|
6
5
|
from opentelemetry.trace import get_tracer
|
|
7
6
|
from wrapt import wrap_function_wrapper
|
|
@@ -12,6 +11,10 @@ from langtrace_python_sdk.instrumentation.openai.patch import (
|
|
|
12
11
|
images_generate,
|
|
13
12
|
)
|
|
14
13
|
|
|
14
|
+
import logging
|
|
15
|
+
|
|
16
|
+
logging.basicConfig(level=logging.FATAL)
|
|
17
|
+
|
|
15
18
|
|
|
16
19
|
class OpenAIInstrumentation(BaseInstrumentor):
|
|
17
20
|
|
|
@@ -133,7 +133,7 @@ def chat_completions_create(original_method, version, tracer):
|
|
|
133
133
|
try:
|
|
134
134
|
# Attempt to call the original method
|
|
135
135
|
result = wrapped(*args, **kwargs)
|
|
136
|
-
if kwargs.get("stream") is False:
|
|
136
|
+
if kwargs.get("stream") is False or kwargs.get("stream") is None:
|
|
137
137
|
span.set_attribute("llm.model", result.model)
|
|
138
138
|
if hasattr(result, "choices") and result.choices is not None:
|
|
139
139
|
responses = [
|
|
@@ -338,8 +338,6 @@ def embeddings_create(original_method, version, tracer):
|
|
|
338
338
|
APIS["EMBEDDINGS_CREATE"]["METHOD"], kind=SpanKind.CLIENT
|
|
339
339
|
) as span:
|
|
340
340
|
|
|
341
|
-
print("Inside embeddings_create", trace.get_current_span())
|
|
342
|
-
|
|
343
341
|
for field, value in attributes.model_dump(by_alias=True).items():
|
|
344
342
|
if value is not None:
|
|
345
343
|
span.set_attribute(field, value)
|
|
@@ -14,6 +14,10 @@ from wrapt import wrap_function_wrapper
|
|
|
14
14
|
from langtrace_python_sdk.constants.instrumentation.pinecone import APIS
|
|
15
15
|
from langtrace_python_sdk.instrumentation.pinecone.patch import generic_patch
|
|
16
16
|
|
|
17
|
+
import logging
|
|
18
|
+
|
|
19
|
+
logging.basicConfig(level=logging.FATAL)
|
|
20
|
+
|
|
17
21
|
|
|
18
22
|
class PineconeInstrumentation(BaseInstrumentor):
|
|
19
23
|
"""
|
langtrace_python_sdk/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.2.
|
|
1
|
+
__version__ = "1.2.16"
|
|
@@ -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=7RIJ-Nh9kHJf5O5NvahUeP8DNXq6oIzbYcIt_yKv0lQ,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
|
|
@@ -28,16 +28,16 @@ langtrace_python_sdk/constants/instrumentation/common.py,sha256=KzNCWEl_44pkZ5Dc
|
|
|
28
28
|
langtrace_python_sdk/constants/instrumentation/openai.py,sha256=9VF6ic9Ed3bpSvdp6iNmrpx2Ppo6DPav3hoUcqSQSv0,1048
|
|
29
29
|
langtrace_python_sdk/constants/instrumentation/pinecone.py,sha256=Xaqqw-xBO0JJLGk75hiCUQGztNm0HiVaLQvjtYK7VJM,472
|
|
30
30
|
langtrace_python_sdk/extensions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
|
-
langtrace_python_sdk/extensions/langtrace_exporter.py,sha256=
|
|
31
|
+
langtrace_python_sdk/extensions/langtrace_exporter.py,sha256=dEMSwkbqVMMToD6mH1m3x4i0Dk0g4I8-oNhOmoFZDBA,3980
|
|
32
32
|
langtrace_python_sdk/instrumentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
33
|
langtrace_python_sdk/instrumentation/anthropic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
|
-
langtrace_python_sdk/instrumentation/anthropic/instrumentation.py,sha256=
|
|
34
|
+
langtrace_python_sdk/instrumentation/anthropic/instrumentation.py,sha256=DTvz6fNMMxYc2z6oqOveBX6mIXHoOFeOoosyXB2HJ6Y,1159
|
|
35
35
|
langtrace_python_sdk/instrumentation/anthropic/patch.py,sha256=_-dNjxJbJTgJfHfwC_zGoxAXupL86jfBLlZefLuCBKk,7115
|
|
36
36
|
langtrace_python_sdk/instrumentation/chroma/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
37
|
-
langtrace_python_sdk/instrumentation/chroma/instrumentation.py,sha256=
|
|
37
|
+
langtrace_python_sdk/instrumentation/chroma/instrumentation.py,sha256=9k8KueizRJuicJnuYmSvjLwdeCNszZ1KpwZPMsQ_7ig,1280
|
|
38
38
|
langtrace_python_sdk/instrumentation/chroma/patch.py,sha256=IORHg5GMrzFiuzMWzAbrZzmxQTRu-zzksgh5RDPGoG8,2245
|
|
39
39
|
langtrace_python_sdk/instrumentation/langchain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
40
|
-
langtrace_python_sdk/instrumentation/langchain/instrumentation.py,sha256=
|
|
40
|
+
langtrace_python_sdk/instrumentation/langchain/instrumentation.py,sha256=UBUx31IErih1zDGkwez5ZFT2qGvCHxhdGHvJsEyhvEo,2938
|
|
41
41
|
langtrace_python_sdk/instrumentation/langchain/patch.py,sha256=z_brH_5BSze1MWjWBycyOPMrJAAw65OUM5vcvvatoZM,3236
|
|
42
42
|
langtrace_python_sdk/instrumentation/langchain_community/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
43
|
langtrace_python_sdk/instrumentation/langchain_community/instrumentation.py,sha256=CS6oAxnhQ98gjD5Xj7LrWDE9i-FVjWI3kOwZ4phspnU,4677
|
|
@@ -46,18 +46,18 @@ langtrace_python_sdk/instrumentation/langchain_core/__init__.py,sha256=47DEQpj8H
|
|
|
46
46
|
langtrace_python_sdk/instrumentation/langchain_core/instrumentation.py,sha256=1Y4q_F2nN79y-dap_if35vH9oowIuDi6mo0ELYIltNI,5417
|
|
47
47
|
langtrace_python_sdk/instrumentation/langchain_core/patch.py,sha256=zr5nvqeOX6IlD1gDbRLRz7Frep40EvrOSz8BCy1XgJc,7843
|
|
48
48
|
langtrace_python_sdk/instrumentation/llamaindex/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
|
-
langtrace_python_sdk/instrumentation/llamaindex/instrumentation.py,sha256=
|
|
49
|
+
langtrace_python_sdk/instrumentation/llamaindex/instrumentation.py,sha256=wVSvxSJb1owoEBCSqPQRzsbdEkPAQzTqXKKSxGk0sSY,2488
|
|
50
50
|
langtrace_python_sdk/instrumentation/llamaindex/patch.py,sha256=wTWmyTD09J44ULGoMVmgmq72VN1H0xmdrISTdzqo1Yw,1985
|
|
51
51
|
langtrace_python_sdk/instrumentation/openai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
52
|
-
langtrace_python_sdk/instrumentation/openai/instrumentation.py,sha256=
|
|
53
|
-
langtrace_python_sdk/instrumentation/openai/patch.py,sha256=
|
|
52
|
+
langtrace_python_sdk/instrumentation/openai/instrumentation.py,sha256=stlFopPggB8mgnn4QdVh41rmA8mlzH5x-C00XHfApCE,1408
|
|
53
|
+
langtrace_python_sdk/instrumentation/openai/patch.py,sha256=YBEv4OEXIvKQXmRxGmNsFEOqPtQU2mzZ7jNS3bdWk4A,14917
|
|
54
54
|
langtrace_python_sdk/instrumentation/pinecone/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
|
-
langtrace_python_sdk/instrumentation/pinecone/instrumentation.py,sha256=
|
|
55
|
+
langtrace_python_sdk/instrumentation/pinecone/instrumentation.py,sha256=o0EUd5jvHaDKOUTj4NjnL5UfDHDHxyXkWGlTW4oeRDk,1784
|
|
56
56
|
langtrace_python_sdk/instrumentation/pinecone/patch.py,sha256=lvWL_xM7mxTQ1D-eY5Gh949c45BAKrN2N5IzKRkUhMY,2142
|
|
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.16.dist-info/METADATA,sha256=S-mgSIqMpKlKju44vtCpxjfESTY0ohot-O3kvh8QFgY,7695
|
|
61
|
+
langtrace_python_sdk-1.2.16.dist-info/WHEEL,sha256=uNdcs2TADwSd5pVaP0Z_kcjcvvTUklh2S7bxZMF8Uj0,87
|
|
62
|
+
langtrace_python_sdk-1.2.16.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
63
|
+
langtrace_python_sdk-1.2.16.dist-info/RECORD,,
|
|
File without changes
|
{langtrace_python_sdk-1.2.14.dist-info → langtrace_python_sdk-1.2.16.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|