langtrace-python-sdk 2.0.13__py3-none-any.whl → 2.1.0__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 (28) hide show
  1. examples/pinecone_example/basic.py +7 -2
  2. examples/weaviate_example/query_text.py +1737 -0
  3. langtrace_python_sdk/__init__.py +7 -1
  4. langtrace_python_sdk/constants/instrumentation/common.py +1 -0
  5. langtrace_python_sdk/constants/instrumentation/weaviate.py +44 -0
  6. langtrace_python_sdk/instrumentation/chroma/patch.py +191 -0
  7. langtrace_python_sdk/instrumentation/openai/patch.py +1 -0
  8. langtrace_python_sdk/instrumentation/pinecone/patch.py +1 -0
  9. langtrace_python_sdk/instrumentation/qdrant/patch.py +28 -4
  10. langtrace_python_sdk/instrumentation/weaviate/__init__.py +0 -0
  11. langtrace_python_sdk/instrumentation/weaviate/instrumentation.py +66 -0
  12. langtrace_python_sdk/instrumentation/weaviate/patch.py +166 -0
  13. langtrace_python_sdk/langtrace.py +4 -0
  14. langtrace_python_sdk/types/__init__.py +1 -0
  15. langtrace_python_sdk/utils/__init__.py +0 -2
  16. langtrace_python_sdk/utils/llm.py +0 -1
  17. langtrace_python_sdk/utils/misc.py +30 -0
  18. langtrace_python_sdk/utils/types.py +19 -0
  19. langtrace_python_sdk/utils/with_root_span.py +99 -4
  20. langtrace_python_sdk/version.py +1 -1
  21. {langtrace_python_sdk-2.0.13.dist-info → langtrace_python_sdk-2.1.0.dist-info}/METADATA +30 -15
  22. {langtrace_python_sdk-2.0.13.dist-info → langtrace_python_sdk-2.1.0.dist-info}/RECORD +28 -22
  23. tests/cohere/cassettes/test_cohere_chat.yaml +19 -21
  24. tests/cohere/cassettes/test_cohere_chat_streaming.yaml +73 -135
  25. tests/cohere/cassettes/test_cohere_embed.yaml +9 -9
  26. tests/cohere/cassettes/test_cohere_rerank.yaml +8 -8
  27. {langtrace_python_sdk-2.0.13.dist-info → langtrace_python_sdk-2.1.0.dist-info}/WHEEL +0 -0
  28. {langtrace_python_sdk-2.0.13.dist-info → langtrace_python_sdk-2.1.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,19 @@
1
+ from typing import TypedDict
2
+
3
+
4
+ class LangTraceEvaluation:
5
+ # Define the class based on your needs
6
+ pass
7
+
8
+
9
+ class LangTraceApiError(Exception):
10
+ def __init__(self, message: str, status_code: int):
11
+ super().__init__(message)
12
+ self.status_code = status_code
13
+
14
+
15
+ class EvaluationAPIData(TypedDict):
16
+ userId: str
17
+ userScore: int
18
+ traceId: str
19
+ spanId: str
@@ -16,13 +16,24 @@ limitations under the License.
16
16
 
17
17
  import asyncio
18
18
  from functools import wraps
19
+ from typing import Optional
19
20
 
21
+ from langtrace_python_sdk.constants.exporter.langtrace_exporter import (
22
+ LANGTRACE_REMOTE_URL,
23
+ )
24
+ from langtrace_python_sdk.utils.types import (
25
+ EvaluationAPIData,
26
+ LangTraceApiError,
27
+ LangTraceEvaluation,
28
+ )
20
29
  from opentelemetry import baggage, context, trace
21
30
  from opentelemetry.trace import SpanKind
22
31
 
23
32
  from langtrace_python_sdk.constants.instrumentation.common import (
24
33
  LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY,
25
34
  )
35
+ import os
36
+ import requests
26
37
 
27
38
 
28
39
  def with_langtrace_root_span(
@@ -35,17 +46,37 @@ def with_langtrace_root_span(
35
46
  def sync_wrapper(*args, **kwargs):
36
47
  tracer = trace.get_tracer(__name__)
37
48
  operation_name = name if name else func.__name__
49
+ span_id = None
50
+ trace_id = None
38
51
 
39
- with tracer.start_as_current_span(operation_name, kind=kind):
52
+ with tracer.start_as_current_span(operation_name, kind=kind) as span:
53
+ span_id = str(span.get_span_context().span_id)
54
+ trace_id = str(span.get_span_context().trace_id)
40
55
 
41
- return func(*args, **kwargs)
56
+ if (
57
+ "span_id" in func.__code__.co_varnames
58
+ and "trace_id" in func.__code__.co_varnames
59
+ ):
60
+ return func(*args, span_id, trace_id, **kwargs)
61
+ else:
62
+ return func(*args, **kwargs)
42
63
 
43
64
  @wraps(func)
44
65
  async def async_wrapper(*args, **kwargs):
66
+ span_id = None
67
+ trace_id = None
45
68
  tracer = trace.get_tracer(__name__)
46
69
  operation_name = name if name else func.__name__
47
- with tracer.start_as_current_span(operation_name, kind=kind):
48
- return await func(*args, **kwargs)
70
+ with tracer.start_as_current_span(operation_name, kind=kind) as span:
71
+ span_id = span.get_span_context().span_id
72
+ trace_id = span.get_span_context().trace_id
73
+ if (
74
+ "span_id" in func.__code__.co_varnames
75
+ and "trace_id" in func.__code__.co_varnames
76
+ ):
77
+ return await func(*args, span_id, trace_id, **kwargs)
78
+ else:
79
+ return await func(*args, **kwargs)
49
80
 
50
81
  if asyncio.iscoroutinefunction(func):
51
82
  return async_wrapper
@@ -79,3 +110,67 @@ def with_additional_attributes(attributes={}):
79
110
  return sync_wrapper
80
111
 
81
112
  return decorator
113
+
114
+
115
+ def send_user_feedback(data: EvaluationAPIData) -> None:
116
+ try:
117
+ evaluation = _get_evaluation(data["spanId"])
118
+ headers = {"x-api-key": os.environ["LANGTRACE_API_KEY"]}
119
+ if evaluation is not None:
120
+ # Make a PUT request to update the evaluation
121
+ response = requests.put(
122
+ f"{LANGTRACE_REMOTE_URL}/api/evaluation",
123
+ json=data,
124
+ params={"spanId": data["spanId"]},
125
+ headers=headers,
126
+ timeout=None,
127
+ )
128
+ response.raise_for_status()
129
+ print("SENDING FEEDBACK PUT", response.status_code, response.text)
130
+
131
+ else:
132
+ # Make a POST request to create a new evaluation
133
+ response = requests.post(
134
+ f"{LANGTRACE_REMOTE_URL}/api/evaluation",
135
+ json=data,
136
+ params={"spanId": data["spanId"]},
137
+ headers=headers,
138
+ timeout=None,
139
+ )
140
+ print("Response", response.status_code, response.text)
141
+ response.raise_for_status()
142
+
143
+ except requests.RequestException as err:
144
+ # Handle specific HTTP errors or general request exceptions
145
+ error_msg = str(err)
146
+ if err.response:
147
+ try:
148
+ # Try to extract server-provided error message
149
+ error_msg = err.response.json().get("error", error_msg)
150
+ except ValueError:
151
+ # Fallback if response is not JSON
152
+ error_msg = err.response.text
153
+ raise Exception(f"API error: {error_msg}") from err
154
+
155
+
156
+ def _get_evaluation(span_id: str) -> Optional[LangTraceEvaluation]:
157
+ try:
158
+ response = requests.get(
159
+ f"{LANGTRACE_REMOTE_URL}/api/evaluation",
160
+ params={"spanId": span_id},
161
+ headers={"x-api-key": os.environ["LANGTRACE_API_KEY"]},
162
+ timeout=None,
163
+ )
164
+ evaluations = response.json()["evaluations"]
165
+ response.raise_for_status()
166
+ return None if not evaluations else evaluations[0]
167
+
168
+ except requests.RequestException as err:
169
+ if err.response is not None:
170
+ message = (
171
+ err.response.json().get("message", "")
172
+ if err.response.json().get("message", "")
173
+ else err.response.text if err.response.text else str(err)
174
+ )
175
+ raise LangTraceApiError(message, err.response.status_code)
176
+ raise LangTraceApiError(str(err), 500)
@@ -1 +1 @@
1
- __version__ = "2.0.13"
1
+ __version__ = "2.1.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: langtrace-python-sdk
3
- Version: 2.0.13
3
+ Version: 2.1.0
4
4
  Summary: Python SDK for LangTrace
5
5
  Project-URL: Homepage, https://github.com/Scale3-Labs/langtrace-python-sdk
6
6
  Author-email: Scale3 Labs <engineering@scale3labs.com>
@@ -17,7 +17,8 @@ Requires-Dist: opentelemetry-instrumentation
17
17
  Requires-Dist: opentelemetry-sdk
18
18
  Requires-Dist: pinecone-client
19
19
  Requires-Dist: tiktoken
20
- Requires-Dist: trace-attributes==3.0.5
20
+ Requires-Dist: trace-attributes>=4.0.2
21
+ Requires-Dist: weaviate-client
21
22
  Provides-Extra: dev
22
23
  Requires-Dist: anthropic; extra == 'dev'
23
24
  Requires-Dist: chromadb; extra == 'dev'
@@ -25,10 +26,10 @@ Requires-Dist: cohere; extra == 'dev'
25
26
  Requires-Dist: langchain; extra == 'dev'
26
27
  Requires-Dist: langchain-community; extra == 'dev'
27
28
  Requires-Dist: langchain-openai; extra == 'dev'
28
- Requires-Dist: llama-index; extra == 'dev'
29
29
  Requires-Dist: openai; extra == 'dev'
30
30
  Requires-Dist: python-dotenv; extra == 'dev'
31
31
  Requires-Dist: qdrant-client; extra == 'dev'
32
+ Requires-Dist: weaviate-client; extra == 'dev'
32
33
  Provides-Extra: test
33
34
  Requires-Dist: pytest; extra == 'test'
34
35
  Requires-Dist: pytest-asyncio; extra == 'test'
@@ -65,24 +66,25 @@ To use the managed SaaS version of Langtrace, follow the steps below:
65
66
 
66
67
  Get started by adding simply three lines to your code!
67
68
 
68
- ``` python
69
+ ```python
69
70
  pip install langtrace-python-sdk
70
71
  ```
71
72
 
72
- ``` python
73
+ ```python
73
74
  from langtrace_python_sdk import langtrace # Must precede any llm module imports
74
75
  langtrace.init(api_key=<your_api_key>)
75
76
  ```
76
77
 
77
78
  OR
78
79
 
79
- ``` python
80
+ ```python
80
81
  from langtrace_python_sdk import langtrace # Must precede any llm module imports
81
82
  langtrace.init() # LANGTRACE_API_KEY as an ENVIRONMENT variable
82
83
  ```
83
84
 
84
85
  ## FastAPI Quick Start
85
- Initialize FastAPI project and add this inside the ```main.py``` file
86
+
87
+ Initialize FastAPI project and add this inside the `main.py` file
86
88
 
87
89
  ```python
88
90
  from fastapi import FastAPI
@@ -104,7 +106,9 @@ def root():
104
106
  ```
105
107
 
106
108
  ## Django Quick Start
107
- Initialize django project and add this inside the ```__init.py__``` file
109
+
110
+ Initialize django project and add this inside the `__init.py__` file
111
+
108
112
  ```python
109
113
  from langtrace_python_sdk import langtrace
110
114
  from openai import OpenAI
@@ -122,7 +126,9 @@ client.chat.completions.create(
122
126
  ```
123
127
 
124
128
  ## Flask Quick Start
125
- Initialize flask project and this inside ```app.py``` file
129
+
130
+ Initialize flask project and this inside `app.py` file
131
+
126
132
  ```python
127
133
  from flask import Flask
128
134
  from langtrace_python_sdk import langtrace
@@ -147,11 +153,11 @@ def main():
147
153
 
148
154
  Get started by adding simply two lines to your code and see traces being logged to the console!
149
155
 
150
- ``` python
156
+ ```python
151
157
  pip install langtrace-python-sdk
152
158
  ```
153
159
 
154
- ``` python
160
+ ```python
155
161
  from langtrace_python_sdk import langtrace # Must precede any llm module imports
156
162
  langtrace.init(write_spans_to_console=True)
157
163
  ```
@@ -160,15 +166,26 @@ langtrace.init(write_spans_to_console=True)
160
166
 
161
167
  Get started by adding simply three lines to your code and see traces being exported to your remote location!
162
168
 
163
- ``` python
169
+ ```python
164
170
  pip install langtrace-python-sdk
165
171
  ```
166
172
 
167
- ``` python
173
+ ```python
168
174
  from langtrace_python_sdk import langtrace # Must precede any llm module imports
169
175
  langtrace.init(custom_remote_exporter=<your_exporter>, batch=<True or False>)
170
176
  ```
171
177
 
178
+ ### Configure Langtrace
179
+
180
+ | Parameter | Type | Default Value | Description |
181
+ | -------------------------- | ----------------------------------- | ----------------------------- | ------------------------------------------------------------------------------ |
182
+ | `api_key` | `str` | `LANGTRACE_API_KEY` or `None` | The API key for authentication. |
183
+ | `batch` | `bool` | `True` | Whether to batch spans before sending them. |
184
+ | `write_spans_to_console` | `bool` | `False` | Whether to write spans to the console. |
185
+ | `custom_remote_exporter` | `Optional[Exporter]` | `None` | Custom remote exporter. If `None`, a default `LangTraceExporter` will be used. |
186
+ | `api_host` | `Optional[str]` | `https://langtrace.ai/` | The API host for the remote exporter. |
187
+ | `disable_instrumentations` | `Optional[DisableInstrumentations]` | `None` | You can pass an object to disable instrumentation for specific vendors ex: `{'only': ['openai']}` or `{'all_except': ['openai']}`
188
+
172
189
  ### Additional Customization
173
190
 
174
191
  - `@with_langtrace_root_span` - this decorator is designed to organize and relate different spans, in a hierarchical manner. When you're performing multiple operations that you want to monitor together as a unit, this function helps by establishing a "parent" (`LangtraceRootSpan` or whatever is passed to `name`) span. Then, any calls to the LLM APIs made within the given function (fn) will be considered "children" of this parent span. This setup is especially useful for tracking the performance or behavior of a group of operations collectively, rather than individually.
@@ -186,7 +203,6 @@ def example():
186
203
  return response
187
204
  ```
188
205
 
189
-
190
206
  - `with_additional_attributes` - this function is designed to enhance the traces by adding custom attributes to the current context. These custom attributes provide extra details about the operations being performed, making it easier to analyze and understand their behavior.
191
207
 
192
208
  ```python
@@ -223,7 +239,6 @@ def chat_completion():
223
239
 
224
240
  - `get_prompt_from_registry` - this function is designed to fetch the desired prompt from the `Prompt Registry`. You can pass two options for filtering `prompt_version` & `variables`.
225
241
 
226
-
227
242
  ```python
228
243
  from langtrace_python_sdk import get_prompt_from_registry
229
244
 
@@ -32,23 +32,25 @@ examples/openai_example/tool_calling_nonstreaming.py,sha256=Yc848IooZRXNynHL6z0k
32
32
  examples/openai_example/tool_calling_streaming.py,sha256=mV1RbyAoVhumGRPpqPWQ6PMhnJyeifrlELd2-K1qJ_w,7015
33
33
  examples/perplexity_example/basic.py,sha256=bp7n27gaugJkaFVyt8pjaEfi66lYcqP6eFFjPewUShY,668
34
34
  examples/pinecone_example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
- examples/pinecone_example/basic.py,sha256=uwWu_UFuDtthgs-x8gOPnsUGOeBDCVPEoiz9uwSEjfg,1007
35
+ examples/pinecone_example/basic.py,sha256=ymSguqRssQ4fbzJ2MMV-z9FZwlTvUyApt2AykiJQiF4,1137
36
36
  examples/qdrant_example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
37
  examples/qdrant_example/basic.py,sha256=DCMjHSuBZKkhEjCkwy5d5La9WMyW0lCWqtcZWiFCEm4,1425
38
- langtrace_python_sdk/__init__.py,sha256=_r2S-lLZFTFFvWjf0lWBX4nzkJN5R7FHX0Dnmr76CEk,848
39
- langtrace_python_sdk/langtrace.py,sha256=o0xJInE_dwNBkAfIQRqMKPz6glCAcGdRJxEG8kasq8I,6839
40
- langtrace_python_sdk/version.py,sha256=qRJzfkgUc9bpxpBssrO665ZtIyUM0fsaZDIbahg3TLU,23
38
+ examples/weaviate_example/query_text.py,sha256=s3f0hYYi-xdbh_LlTBDHegQiVi-4bW_eACb2EnEj8J4,64533
39
+ langtrace_python_sdk/__init__.py,sha256=R4dv73QARUw4WRfCdSKkKzZTLDumF9jcSdwtVrzWhb4,962
40
+ langtrace_python_sdk/langtrace.py,sha256=2VVVeWX3b20jwDY9iqDTxeE-Zunfgt2gfgRs3SreZLU,6993
41
+ langtrace_python_sdk/version.py,sha256=Xybt2skBZamGMNlLuOX1IG-h4uIxqUDGAO8MIGWrJac,22
41
42
  langtrace_python_sdk/constants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
43
  langtrace_python_sdk/constants/exporter/langtrace_exporter.py,sha256=5MNjnAOg-4am78J3gVMH6FSwq5N8TOj72ugkhsw4vi0,46
43
44
  langtrace_python_sdk/constants/instrumentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
44
45
  langtrace_python_sdk/constants/instrumentation/anthropic.py,sha256=YX3llt3zwDY6XrYk3CB8WEVqgrzRXEw_ffyk56JoF3k,126
45
46
  langtrace_python_sdk/constants/instrumentation/chroma.py,sha256=hiPGYdHS0Yj4Kh3eaYBbuCAl_swqIygu80yFqkOgdak,955
46
47
  langtrace_python_sdk/constants/instrumentation/cohere.py,sha256=tf9sDfb5K3qOAHChEE5o8eYWPZ1io58VsOjZDCZPxfw,577
47
- langtrace_python_sdk/constants/instrumentation/common.py,sha256=v2daYzs3nul5pSClKGnzpe4vIxmXztJ_2ohveV-wMRU,754
48
+ langtrace_python_sdk/constants/instrumentation/common.py,sha256=TCHX8uqIJD2p9sONGrlX6Q3b5Mj859PTP-c729ogKcY,782
48
49
  langtrace_python_sdk/constants/instrumentation/groq.py,sha256=VFXmIl4aqGY_fS0PAmjPj_Qm7Tibxbx7Ur_e7rQpqXc,134
49
50
  langtrace_python_sdk/constants/instrumentation/openai.py,sha256=9VF6ic9Ed3bpSvdp6iNmrpx2Ppo6DPav3hoUcqSQSv0,1048
50
51
  langtrace_python_sdk/constants/instrumentation/pinecone.py,sha256=Xaqqw-xBO0JJLGk75hiCUQGztNm0HiVaLQvjtYK7VJM,472
51
52
  langtrace_python_sdk/constants/instrumentation/qdrant.py,sha256=yL7BopNQTXW7L7Z-gVM2PdusKD7r9qqcATvczFd7NtQ,1999
53
+ langtrace_python_sdk/constants/instrumentation/weaviate.py,sha256=Iytf2OpB_irZYEmvOQ7Pf483EdG5Bh59GxaBlXck0yY,1501
52
54
  langtrace_python_sdk/extensions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
55
  langtrace_python_sdk/extensions/langtrace_exporter.py,sha256=s-4zc7lba1va_JUReFdLgyBKlvwV1KmBt_OzVmWReQg,3610
54
56
  langtrace_python_sdk/instrumentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -57,7 +59,7 @@ langtrace_python_sdk/instrumentation/anthropic/instrumentation.py,sha256=-srgE8q
57
59
  langtrace_python_sdk/instrumentation/anthropic/patch.py,sha256=koAo6bA6nnRDk01fcrArqnyAmgzjxV20ofITMQyKVws,8427
58
60
  langtrace_python_sdk/instrumentation/chroma/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
61
  langtrace_python_sdk/instrumentation/chroma/instrumentation.py,sha256=nT6PS6bsrIOO9kLV5GuUeRjMe6THHHAZGvqWBP1dYog,1807
60
- langtrace_python_sdk/instrumentation/chroma/patch.py,sha256=qytjkZxntUe7XyAvVoiEvFgUIXNU52o9BnYLAnQ9M20,2809
62
+ langtrace_python_sdk/instrumentation/chroma/patch.py,sha256=1FvA4YvGw9temfBC2g33xGEzIcL1rVdABXwMVTPm3aM,8750
61
63
  langtrace_python_sdk/instrumentation/cohere/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
64
  langtrace_python_sdk/instrumentation/cohere/instrumentation.py,sha256=YQFHZIBd7SSPD4b6Va-ZR0thf_AuBCqj5yzHLHJVWnM,2121
63
65
  langtrace_python_sdk/instrumentation/cohere/patch.py,sha256=hdSWArP0cdfGs0Q5KhkaowkwrYQIzxvF8NpY4sg8p2Q,26563
@@ -81,20 +83,24 @@ langtrace_python_sdk/instrumentation/llamaindex/instrumentation.py,sha256=8iAg-O
81
83
  langtrace_python_sdk/instrumentation/llamaindex/patch.py,sha256=q99qmEBNH54Oi_sHCIGBQFpIE4zaNKVjIWARlX8fJ-M,4189
82
84
  langtrace_python_sdk/instrumentation/openai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
83
85
  langtrace_python_sdk/instrumentation/openai/instrumentation.py,sha256=G2HSZfr6DuP2n-8v0h91M60m0DJWFBcru4-1FQJl-5A,2726
84
- langtrace_python_sdk/instrumentation/openai/patch.py,sha256=kQxc_E1IlOgHZnlc0HbpGjM5rZCDR3YpNFChp2X9GbM,37263
86
+ langtrace_python_sdk/instrumentation/openai/patch.py,sha256=xi87lLHoj81xSx6MiqTAKWr3MLxXpMf84NzJ5uDm134,37288
85
87
  langtrace_python_sdk/instrumentation/pinecone/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
86
88
  langtrace_python_sdk/instrumentation/pinecone/instrumentation.py,sha256=52GbkfRK-sxXBXhHmHRRO2BGNd6zZVHDp8njLS1CQX0,2314
87
- langtrace_python_sdk/instrumentation/pinecone/patch.py,sha256=hLgYWDKTytuvTORDd6dupMpKAp19vCgOAXDOdjvWme0,4832
89
+ langtrace_python_sdk/instrumentation/pinecone/patch.py,sha256=VNZ_fCRpVQNXeg0G8hFUidBelV3L91-A_OtkKT7ZWUM,4889
88
90
  langtrace_python_sdk/instrumentation/qdrant/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
89
91
  langtrace_python_sdk/instrumentation/qdrant/instrumentation.py,sha256=vl2eKSP55aqDo1JiRlvOUBrr6kddvG9Z5dCYew2OG08,1816
90
- langtrace_python_sdk/instrumentation/qdrant/patch.py,sha256=x95PXaJe_GrOG51zZCDuchVA-bzuA7s5LHqOoWrqSA0,3883
91
- langtrace_python_sdk/types/__init__.py,sha256=QYK-kRkyfXDdzjjKmXVxi0vZ6Wpbxdf0CoZbTXO0JT8,787
92
- langtrace_python_sdk/utils/__init__.py,sha256=is6gOLiHcvrN9kPgYnUwyzkgz9vInVQ4jGe7k0zRHrA,150
93
- langtrace_python_sdk/utils/llm.py,sha256=gnmJ6YWzzdOCaVFg1C-iyNcMGDyiJ623qZeOwDYUfIQ,2162
92
+ langtrace_python_sdk/instrumentation/qdrant/patch.py,sha256=KcUWmvnS3PgPStzs1oWmlZsyomKBl3dmg8nXuR0T1C0,4654
93
+ langtrace_python_sdk/instrumentation/weaviate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
94
+ langtrace_python_sdk/instrumentation/weaviate/instrumentation.py,sha256=ZVtIgkMK98ejHK9oZLpT79mqxSQXxhBBRq3bBPv3POg,2313
95
+ langtrace_python_sdk/instrumentation/weaviate/patch.py,sha256=ig2fc33hNydEcH5cJWRycFnMXiXiJr731J-Vg5Ze4No,5634
96
+ langtrace_python_sdk/types/__init__.py,sha256=-j8cuz3bhUdOqj7N2c0w5y-j3UmcxwEgNh8BWeXwHoI,813
97
+ langtrace_python_sdk/utils/__init__.py,sha256=MbBqT4NpDCNTqqvZ0lG4tRiFFZ-tlM8Dwophg4xyrRw,148
98
+ langtrace_python_sdk/utils/llm.py,sha256=CiASOvObFvsN6T7ogWywNXfXGzI__u9misgolLxyeZk,2161
99
+ langtrace_python_sdk/utils/misc.py,sha256=CD9NWRLxLpFd0YwlHJqzlpFNedXVWtAKGOjQWnDCo8k,838
94
100
  langtrace_python_sdk/utils/prompt_registry.py,sha256=7FFB4Pj0414qgf02h5zL5vXBZgNBf74g4Iq7GdFaIO0,2689
95
101
  langtrace_python_sdk/utils/silently_fail.py,sha256=F_9EteXCO9Cyq-8MA1OT2Zy_dx8n06nt31I7t7ui24E,478
96
- langtrace_python_sdk/utils/types.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
97
- langtrace_python_sdk/utils/with_root_span.py,sha256=MXF-FmG47P0GtJQNffKM_3XGrJHVAC4hMB6GmwtnA4M,2454
102
+ langtrace_python_sdk/utils/types.py,sha256=l-N6o7cnWUyrD6dBvW7W3Pf5CkPo5QaoT__k1XLbrQg,383
103
+ langtrace_python_sdk/utils/with_root_span.py,sha256=9OkVMzoH8Ydqt7OpWPONiGrmHHBnEOXY034St2UToCE,6095
98
104
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
99
105
  tests/conftest.py,sha256=0Jo6iCZTXbdvyJVhG9UpYGkLabL75378oauCzmt-Sa8,603
100
106
  tests/utils.py,sha256=hP8sTH-M8WO6zlLkSFHPf6483ZcKEcnxul6JIIb1pLM,1396
@@ -109,10 +115,10 @@ tests/cohere/conftest.py,sha256=jBbyg-tut-ZJN5_5D64sGmaPIhT_nQQQAiW43kl5Rz4,621
109
115
  tests/cohere/test_cohere_chat.py,sha256=MioEIXB5e-4t99Vt-KpLlxd4diPbp3S6eNfnPWjEDXM,4564
110
116
  tests/cohere/test_cohere_embed.py,sha256=bFKDzUnypMyLefAOHR-6dEgvt0yys2Yw7-F0zc0uQyc,1250
111
117
  tests/cohere/test_cohere_rerank.py,sha256=ZDzvXsY9l1fiytOAKGQidpBkop3fxV6d8xEy_gQt9jE,2279
112
- tests/cohere/cassettes/test_cohere_chat.yaml,sha256=_Az6Kfhp1XmoK6zwTxqbnRYTmsm0k88McOidwQaRp3g,3436
113
- tests/cohere/cassettes/test_cohere_chat_streaming.yaml,sha256=TdWe64Pyfa5Ho9lqTMIW41YntUmUwmYQc55qWntbvas,10610
114
- tests/cohere/cassettes/test_cohere_embed.yaml,sha256=YAxJ3otY9N6jJQOKi50nQA4xY9-dknm1oXEP8KiCH5U,27312
115
- tests/cohere/cassettes/test_cohere_rerank.yaml,sha256=m5EAKAM5JEcGMyUlmjaxU-cNLiXKcenSFQyU-UaUI0U,2392
118
+ tests/cohere/cassettes/test_cohere_chat.yaml,sha256=iQIhJwmWe2AQDmdguL6L0SZOPMD6B3mhDVUKPSLodA4,3271
119
+ tests/cohere/cassettes/test_cohere_chat_streaming.yaml,sha256=tMlz7IPZYRCJUeMCwyXrA4O4zpcqIPpQ5hU9I5f352Q,8174
120
+ tests/cohere/cassettes/test_cohere_embed.yaml,sha256=Svcyw8WkVMVw4cocWQzGOdUVmWi5AM6Gb9t9VLlyOjM,27320
121
+ tests/cohere/cassettes/test_cohere_rerank.yaml,sha256=RsJ8804lTktI0FKEFCw0M4ztStZbCxb_z_VRmrw8ooQ,2393
116
122
  tests/langchain/test_langchain.py,sha256=p1YkeL1U23b0E3vhEcXonwMa3QGUswQjKNReMbV0ndA,2576
117
123
  tests/langchain/test_langchain_community.py,sha256=B7Z7YRx7v9507wEyDnXV1NKVYo4r2XU0YplugfYVsJ0,2615
118
124
  tests/langchain/test_langchain_core.py,sha256=LBeoK27-uDethSvBGykYAlCVfEwljQrN7sZL91TVCPw,4467
@@ -131,7 +137,7 @@ tests/pinecone/cassettes/test_query.yaml,sha256=b5v9G3ssUy00oG63PlFUR3JErF2Js-5A
131
137
  tests/pinecone/cassettes/test_upsert.yaml,sha256=neWmQ1v3d03V8WoLl8FoFeeCYImb8pxlJBWnFd_lITU,38607
132
138
  tests/qdrant/conftest.py,sha256=9n0uHxxIjWk9fbYc4bx-uP8lSAgLBVx-cV9UjnsyCHM,381
133
139
  tests/qdrant/test_qdrant.py,sha256=pzjAjVY2kmsmGfrI2Gs2xrolfuaNHz7l1fqGQCjp5_o,3353
134
- langtrace_python_sdk-2.0.13.dist-info/METADATA,sha256=AG-wRGpBbg8pDHDvU6lyVf0c3puz-ANxrmJVYlcvX8U,10173
135
- langtrace_python_sdk-2.0.13.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
136
- langtrace_python_sdk-2.0.13.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
137
- langtrace_python_sdk-2.0.13.dist-info/RECORD,,
140
+ langtrace_python_sdk-2.1.0.dist-info/METADATA,sha256=gTihV76AblxanByk7CiE6Cibp7ZNP1s9LA4DiZqeVLg,11722
141
+ langtrace_python_sdk-2.1.0.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
142
+ langtrace_python_sdk-2.1.0.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
143
+ langtrace_python_sdk-2.1.0.dist-info/RECORD,,
@@ -17,7 +17,7 @@ interactions:
17
17
  content-type:
18
18
  - application/json
19
19
  host:
20
- - api.cohere.ai
20
+ - api.cohere.com
21
21
  user-agent:
22
22
  - python-httpx/0.27.0
23
23
  x-fern-language:
@@ -25,27 +25,25 @@ interactions:
25
25
  x-fern-sdk-name:
26
26
  - cohere
27
27
  x-fern-sdk-version:
28
- - 5.3.2
28
+ - 5.5.3
29
29
  method: POST
30
- uri: https://api.cohere.ai/v1/chat
30
+ uri: https://api.cohere.com/v1/chat
31
31
  response:
32
32
  body:
33
- string: '{"response_id":"27cf0e2e-b4d5-427b-9866-d108307022de","text":"Argh,
33
+ string: '{"response_id":"6b2a2c29-2cd4-4e79-a05a-db8a6019b757","text":"Argh,
34
34
  many years ago, a bold explorer named Isaac Newton sat beneath an apple tree
35
- for many hours, contemplating the nature of the universe and the motions of
36
- the heavenly bodies. He posited that all objects in the universe are attracted
37
- to each other. Then one day, his theory was proven true when a juicy apple
38
- fell from the tree and struck him on the head, inspiring his theory of gravity
39
- and changing science forever.","generation_id":"2a7babaa-f1da-468f-9891-5171f137ba04","chat_history":[{"role":"USER","message":"Who
35
+ for many hours, contemplating the nature of the universe. Suddenly, an apple
36
+ fell from the sky, striking him on the head. This inspired him to devise a
37
+ theory about the forces that govern objects on Earth and altered our understanding
38
+ of the universe forevermore.","generation_id":"f3b5a0d7-409b-45a7-9324-5b89c944457e","chat_history":[{"role":"USER","message":"Who
40
39
  discovered gravity?"},{"role":"CHATBOT","message":"The man who is widely credited
41
40
  with discovering gravity is Sir Isaac Newton"},{"role":"USER","message":"Tell
42
41
  me a story in 3 sentences or less?"},{"role":"CHATBOT","message":"Argh, many
43
42
  years ago, a bold explorer named Isaac Newton sat beneath an apple tree for
44
- many hours, contemplating the nature of the universe and the motions of the
45
- heavenly bodies. He posited that all objects in the universe are attracted
46
- to each other. Then one day, his theory was proven true when a juicy apple
47
- fell from the tree and struck him on the head, inspiring his theory of gravity
48
- and changing science forever."}],"finish_reason":"COMPLETE","meta":{"api_version":{"version":"1"},"billed_units":{"input_tokens":31,"output_tokens":85},"tokens":{"input_tokens":49,"output_tokens":85}},"documents":[]}'
43
+ many hours, contemplating the nature of the universe. Suddenly, an apple fell
44
+ from the sky, striking him on the head. This inspired him to devise a theory
45
+ about the forces that govern objects on Earth and altered our understanding
46
+ of the universe forevermore."}],"finish_reason":"COMPLETE","meta":{"api_version":{"version":"1"},"billed_units":{"input_tokens":31,"output_tokens":69},"tokens":{"input_tokens":49,"output_tokens":69}},"documents":[]}'
49
47
  headers:
50
48
  Alt-Svc:
51
49
  - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
@@ -56,17 +54,17 @@ interactions:
56
54
  cache-control:
57
55
  - no-cache, no-store, no-transform, must-revalidate, private, max-age=0
58
56
  content-length:
59
- - '1420'
57
+ - '1270'
60
58
  content-type:
61
59
  - application/json
62
60
  date:
63
- - Fri, 26 Apr 2024 13:51:11 GMT
61
+ - Fri, 24 May 2024 09:38:02 GMT
64
62
  expires:
65
63
  - Thu, 01 Jan 1970 00:00:00 UTC
66
64
  num_chars:
67
65
  - '220'
68
66
  num_tokens:
69
- - '116'
67
+ - '100'
70
68
  pragma:
71
69
  - no-cache
72
70
  server:
@@ -76,15 +74,15 @@ interactions:
76
74
  x-accel-expires:
77
75
  - '0'
78
76
  x-debug-trace-id:
79
- - 6e0f777a5f86c8b5453bf374fd3fadbd
77
+ - 68cf0a1a2924c2a2534e350092097d49
80
78
  x-endpoint-monthly-call-limit:
81
79
  - '1000'
82
80
  x-envoy-upstream-service-time:
83
- - '3037'
81
+ - '2573'
84
82
  x-trial-endpoint-call-limit:
85
- - '40'
83
+ - '10'
86
84
  x-trial-endpoint-call-remaining:
87
- - '39'
85
+ - '9'
88
86
  status:
89
87
  code: 200
90
88
  message: OK