langtrace-python-sdk 2.2.25__py3-none-any.whl → 2.2.26__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.
@@ -12,9 +12,9 @@ class TravelAgents:
12
12
  def __init__(self):
13
13
  self.OpenAIGPT35 = ChatOpenAI(model_name="gpt-3.5-turbo", temperature=0.7)
14
14
  self.OpenAIGPT4 = ChatOpenAI(model_name="gpt-4", temperature=0.7)
15
- self.Ollama = ChatOllama(model="openhermes")
15
+ self.Ollama = ChatOllama(model="llama3")
16
16
  self.Cohere = ChatCohere(model="command-r")
17
- self.Anthropic = ChatAnthropic(model="claude-3-5-sonnet")
17
+ self.Anthropic = ChatAnthropic(model="claude-3-5-sonnet-20240620")
18
18
 
19
19
  def expert_travel_agent(self):
20
20
  return Agent(
@@ -28,7 +28,7 @@ class TravelAgents:
28
28
  # tools=[tool_1, tool_2],
29
29
  allow_delegation=False,
30
30
  verbose=True,
31
- llm=self.OpenAIGPT4,
31
+ llm=self.Cohere,
32
32
  )
33
33
 
34
34
  def city_selection_expert(self):
@@ -39,7 +39,7 @@ class TravelAgents:
39
39
  # tools=[tool_1, tool_2],
40
40
  allow_delegation=False,
41
41
  verbose=True,
42
- llm=self.OpenAIGPT4,
42
+ llm=self.Cohere,
43
43
  )
44
44
 
45
45
  def local_tour_guide(self):
@@ -50,5 +50,5 @@ class TravelAgents:
50
50
  # tools=[tool_1, tool_2],
51
51
  allow_delegation=False,
52
52
  verbose=True,
53
- llm=self.OpenAIGPT4,
53
+ llm=self.Cohere,
54
54
  )
@@ -0,0 +1,98 @@
1
+ from langtrace_python_sdk import with_langtrace_root_span, langtrace
2
+ from dotenv import load_dotenv
3
+ from litellm import completion, acompletion
4
+ import litellm
5
+ import asyncio
6
+
7
+ load_dotenv()
8
+
9
+
10
+ litellm.success_callback = ["langtrace"]
11
+ langtrace.init()
12
+ litellm.set_verbose = False
13
+
14
+
15
+ @with_langtrace_root_span("Litellm Example OpenAI")
16
+ def openAI(streaming=False):
17
+ response = completion(
18
+ model="gpt-3.5-turbo",
19
+ messages=[
20
+ {"content": "respond only in Yoda speak.", "role": "system"},
21
+ {"content": "Hello, how are you?", "role": "user"},
22
+ ],
23
+ stream=streaming,
24
+ stream_options={"include_usage": True},
25
+ )
26
+ if streaming:
27
+ for _ in response:
28
+ pass
29
+ else:
30
+ return response
31
+
32
+
33
+ # @with_langtrace_root_span("Litellm Example Anthropic Completion")
34
+ def anthropic(streaming=False):
35
+ try:
36
+
37
+ response = completion(
38
+ model="claude-2.1",
39
+ messages=[
40
+ {"content": "respond only in Yoda speak.", "role": "system"},
41
+ {"content": "what is 2 + 2?", "role": "user"},
42
+ ],
43
+ temperature=0.5,
44
+ top_p=0.5,
45
+ n=1,
46
+ stream=streaming,
47
+ stream_options={"include_usage": True},
48
+ )
49
+ # print(response)
50
+ if streaming:
51
+ for _ in response:
52
+ pass
53
+ else:
54
+ return response
55
+ except Exception as e:
56
+ print("ERORRRR", e)
57
+
58
+
59
+ # @with_langtrace_root_span("Litellm Example OpenAI Async Streaming")
60
+ async def async_anthropic(streaming=False):
61
+ response = await acompletion(
62
+ model="claude-2.1",
63
+ messages=[{"content": "Hello, how are you?", "role": "user"}],
64
+ stream=streaming,
65
+ stream_options={"include_usage": True},
66
+ temperature=0.5,
67
+ top_p=0.5,
68
+ n=1,
69
+ )
70
+ if streaming:
71
+ async for _ in response:
72
+ pass
73
+ else:
74
+ return response
75
+
76
+
77
+ def cohere(streaming=False):
78
+ response = completion(
79
+ model="command-r",
80
+ messages=[
81
+ {"content": "respond only in Yoda speak.", "role": "system"},
82
+ {"content": "Hello, how are you?", "role": "user"},
83
+ ],
84
+ stream=streaming,
85
+ stream_options={"include_usage": True},
86
+ )
87
+ if streaming:
88
+ for _ in response:
89
+ pass
90
+ else:
91
+ return response
92
+
93
+
94
+ if __name__ == "__main__":
95
+ # openAI()
96
+ anthropic(streaming=False)
97
+ cohere(streaming=True)
98
+ # asyncio.run(async_anthropic(streaming=True))
@@ -0,0 +1,14 @@
1
+ import asyncio
2
+ from examples.mistral_example.complete import chat_complete
3
+ from examples.mistral_example.complete_async import complete_async
4
+ from examples.mistral_example.embeddings import embeddings_create
5
+ from langtrace_python_sdk import langtrace, with_langtrace_root_span
6
+
7
+ langtrace.init()
8
+
9
+ class MistralRunner:
10
+ @with_langtrace_root_span("Mistral")
11
+ def run(self):
12
+ chat_complete()
13
+ asyncio.run(complete_async())
14
+ embeddings_create()
@@ -0,0 +1,18 @@
1
+ import os
2
+ from langtrace_python_sdk import with_langtrace_root_span
3
+ from mistralai import Mistral
4
+
5
+ @with_langtrace_root_span("chat_complete")
6
+ def chat_complete():
7
+ model = "mistral-large-latest"
8
+ client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])
9
+ chat_response = client.chat.complete(
10
+ model= model,
11
+ messages = [
12
+ {
13
+ "role": "user",
14
+ "content": "I need 10 cocktail recipes with tequila other than the classics like margarita, tequila"
15
+ },
16
+ ]
17
+ )
18
+ print(chat_response.choices[0].message.content)
@@ -0,0 +1,16 @@
1
+ import os
2
+ from langtrace_python_sdk import with_langtrace_root_span
3
+ from mistralai import Mistral
4
+
5
+ @with_langtrace_root_span("chat_complete_async")
6
+ async def complete_async():
7
+ client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])
8
+ res = await client.chat.complete_async(model="mistral-small-latest", messages=[
9
+ {
10
+ "content": "Which locations should I visit when I travel to New york? Answer in one short sentence.",
11
+ "role": "user",
12
+ },
13
+ ])
14
+ if res is not None:
15
+ # handle response
16
+ print(res.choices[0].message.content)
@@ -0,0 +1,17 @@
1
+ import os
2
+ from langtrace_python_sdk import with_langtrace_root_span
3
+ from mistralai import Mistral
4
+
5
+
6
+ @with_langtrace_root_span("create_embeddings")
7
+ def embeddings_create():
8
+ model = "mistral-embed"
9
+
10
+ client = Mistral(api_key=os.environ["MISTRAL_API_KEY"])
11
+
12
+ embeddings_batch_response = client.embeddings.create(
13
+ model=model,
14
+ inputs=["Embed this sentence.", "As well as this one."],
15
+ )
16
+
17
+ print(embeddings_batch_response.data[0].embedding)
@@ -29,6 +29,7 @@ SERVICE_PROVIDERS = {
29
29
  "OLLAMA": "Ollama",
30
30
  "VERTEXAI": "VertexAI",
31
31
  "GEMINI": "Gemini",
32
+ "MISTRAL": "Mistral",
32
33
  }
33
34
 
34
35
  LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY = "langtrace_additional_attributes"
@@ -0,0 +1,24 @@
1
+ from langtrace.trace_attributes import MistralMethods
2
+
3
+ APIS = {
4
+ "CHAT_COMPLETE": {
5
+ "METHOD": MistralMethods.CHAT_COMPLETE.value,
6
+ "ENDPOINT": "/v1/chat/completions",
7
+ },
8
+ "ASYNC_CHAT_COMPLETE": {
9
+ "METHOD": MistralMethods.ASYNC_CHAT_COMPLETE.value,
10
+ "ENDPOINT": "/v1/chat/completions",
11
+ },
12
+ "CHAT_STREAM": {
13
+ "METHOD": MistralMethods.CHAT_STREAM.value,
14
+ "ENDPOINT": "/v1/chat/completions",
15
+ },
16
+ "EMBEDDINGS_CREATE": {
17
+ "METHOD": MistralMethods.EMBEDDINGS_CREATE.value,
18
+ "ENDPOINT": "/v1/embeddings",
19
+ },
20
+ "ASYNC_EMBEDDINGS_CREATE": {
21
+ "METHOD": MistralMethods.ASYNC_EMBEDDINGS_CREATE.value,
22
+ "ENDPOINT": "/v1/embeddings",
23
+ },
24
+ }
@@ -16,6 +16,7 @@ from .ollama import OllamaInstrumentor
16
16
  from .dspy import DspyInstrumentation
17
17
  from .vertexai import VertexAIInstrumentation
18
18
  from .gemini import GeminiInstrumentation
19
+ from .mistral import MistralInstrumentation
19
20
 
20
21
  __all__ = [
21
22
  "AnthropicInstrumentation",
@@ -36,4 +37,5 @@ __all__ = [
36
37
  "DspyInstrumentation",
37
38
  "VertexAIInstrumentation",
38
39
  "GeminiInstrumentation",
40
+ "MistralInstrumentation",
39
41
  ]
@@ -0,0 +1,3 @@
1
+ from .instrumentation import MistralInstrumentation
2
+
3
+ __all__ = ["MistralInstrumentation"]
@@ -0,0 +1,73 @@
1
+ """
2
+ Copyright (c) 2024 Scale3 Labs
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ """
16
+
17
+ import importlib.metadata
18
+ import logging
19
+ from typing import Collection
20
+
21
+ from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
22
+ from opentelemetry.trace import get_tracer
23
+ from wrapt import wrap_function_wrapper as _W
24
+
25
+ from langtrace_python_sdk.instrumentation.mistral.patch import (
26
+ chat_complete,
27
+ embeddings_create,
28
+ )
29
+
30
+ logging.basicConfig(level=logging.FATAL)
31
+
32
+ class MistralInstrumentation(BaseInstrumentor):
33
+
34
+ def instrumentation_dependencies(self) -> Collection[str]:
35
+ return ["mistralai >= 1.0.1"]
36
+
37
+ def _instrument(self, **kwargs):
38
+ tracer_provider = kwargs.get("tracer_provider")
39
+ tracer = get_tracer(__name__, "", tracer_provider)
40
+ version = importlib.metadata.version("mistralai")
41
+
42
+ _W(
43
+ module="mistralai.chat",
44
+ name="Chat.complete",
45
+ wrapper=chat_complete("mistral.chat.complete", version, tracer),
46
+ )
47
+
48
+ _W(
49
+ module="mistralai.chat",
50
+ name="Chat.stream",
51
+ wrapper=chat_complete("mistral.chat.stream", version, tracer, is_streaming=True),
52
+ )
53
+
54
+ _W(
55
+ module="mistralai.chat",
56
+ name="Chat.complete_async",
57
+ wrapper=chat_complete("mistral.chat.complete_async", version, tracer, is_async=True),
58
+ )
59
+
60
+ _W(
61
+ module="mistralai.embeddings",
62
+ name="Embeddings.create",
63
+ wrapper=embeddings_create("mistral.embeddings.create", version, tracer),
64
+ )
65
+
66
+ _W(
67
+ module="mistralai.embeddings",
68
+ name="Embeddings.create_async",
69
+ wrapper=embeddings_create("mistral.embeddings.create_async", version, tracer, is_async=True),
70
+ )
71
+
72
+ def _uninstrument(self, **kwargs):
73
+ pass
@@ -0,0 +1,192 @@
1
+ """
2
+ Copyright (c) 2024 Scale3 Labs
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ """
16
+
17
+ import json
18
+
19
+ from langtrace.trace_attributes import (
20
+ LLMSpanAttributes,
21
+ SpanAttributes,
22
+ )
23
+ from langtrace_python_sdk.utils import set_span_attribute
24
+ from langtrace_python_sdk.utils.silently_fail import silently_fail
25
+ from opentelemetry import trace
26
+ from opentelemetry.trace import SpanKind
27
+ from opentelemetry.trace.status import Status, StatusCode
28
+ from opentelemetry.trace.propagation import set_span_in_context
29
+ from langtrace_python_sdk.constants.instrumentation.common import (
30
+ SERVICE_PROVIDERS,
31
+ )
32
+ from langtrace_python_sdk.constants.instrumentation.mistral import APIS
33
+ from langtrace_python_sdk.utils.llm import (
34
+ get_extra_attributes,
35
+ get_langtrace_attributes,
36
+ get_llm_request_attributes,
37
+ get_llm_url,
38
+ get_span_name,
39
+ set_event_completion,
40
+ StreamWrapper,
41
+ set_span_attributes,
42
+ set_usage_attributes,
43
+ )
44
+
45
+ from langtrace_python_sdk.instrumentation.openai.patch import extract_content
46
+
47
+
48
+ def chat_complete(original_method, version, tracer, is_async=False, is_streaming=False):
49
+
50
+ def traced_method(wrapped, instance, args, kwargs):
51
+ service_provider = SERVICE_PROVIDERS["MISTRAL"]
52
+ llm_prompts = []
53
+ for item in kwargs.get("messages", []):
54
+ llm_prompts.append(item)
55
+
56
+ api = "ASYNC_CHAT_COMPLETE" if is_async else "CHAT_COMPLETE"
57
+
58
+ span_attributes = {
59
+ **get_langtrace_attributes(version, service_provider, vendor_type="llm"),
60
+ **get_llm_request_attributes(kwargs, prompts=llm_prompts),
61
+ **get_llm_url(instance),
62
+ SpanAttributes.LLM_PATH: APIS[api]["ENDPOINT"],
63
+ **get_extra_attributes(),
64
+ }
65
+
66
+ attributes = LLMSpanAttributes(**span_attributes)
67
+
68
+
69
+ span = tracer.start_span(
70
+ name=get_span_name(APIS[api]["METHOD"]),
71
+ kind=SpanKind.CLIENT,
72
+ context=set_span_in_context(trace.get_current_span()),
73
+ )
74
+ _set_input_attributes(span, kwargs, attributes)
75
+
76
+ try:
77
+ result = wrapped(*args, **kwargs)
78
+ if is_streaming:
79
+ return StreamWrapper(
80
+ result,
81
+ span,
82
+ function_call=kwargs.get("functions") is not None,
83
+ tool_calls=kwargs.get("tools") is not None,
84
+ )
85
+ else:
86
+ _set_response_attributes(span, kwargs, result)
87
+ span.set_status(StatusCode.OK)
88
+ span.end()
89
+ return result
90
+
91
+
92
+ except Exception as error:
93
+ span.record_exception(error)
94
+ span.set_status(Status(StatusCode.ERROR, str(error)))
95
+ span.end()
96
+ raise
97
+
98
+ return traced_method
99
+
100
+
101
+ def embeddings_create(original_method, version, tracer, is_async=False):
102
+ """
103
+ Wrap the `create` method of the `Embeddings` class to trace it.
104
+ """
105
+
106
+ def traced_method(wrapped, instance, args, kwargs):
107
+ service_provider = SERVICE_PROVIDERS["MISTRAL"]
108
+
109
+ api = "ASYNC_EMBEDDINGS_CREATE" if is_async else "EMBEDDINGS_CREATE"
110
+
111
+ span_attributes = {
112
+ **get_langtrace_attributes(version, service_provider, vendor_type="llm"),
113
+ **get_llm_request_attributes(kwargs, operation_name="embed"),
114
+ **get_llm_url(instance),
115
+ SpanAttributes.LLM_PATH: APIS[api]["ENDPOINT"],
116
+ SpanAttributes.LLM_REQUEST_DIMENSIONS: kwargs.get("dimensions"),
117
+ **get_extra_attributes(),
118
+ }
119
+
120
+ encoding_format = kwargs.get("encoding_format")
121
+ if encoding_format is not None:
122
+ if not isinstance(encoding_format, list):
123
+ encoding_format = [encoding_format]
124
+ span_attributes[SpanAttributes.LLM_REQUEST_ENCODING_FORMATS] = (
125
+ encoding_format
126
+ )
127
+
128
+ if kwargs.get("inputs") is not None:
129
+ span_attributes[SpanAttributes.LLM_REQUEST_EMBEDDING_INPUTS] = json.dumps(
130
+ [kwargs.get("inputs", [])]
131
+ )
132
+
133
+ attributes = LLMSpanAttributes(**span_attributes)
134
+
135
+ with tracer.start_as_current_span(
136
+ name=get_span_name(APIS[api]["METHOD"]),
137
+ kind=SpanKind.CLIENT,
138
+ context=set_span_in_context(trace.get_current_span()),
139
+ ) as span:
140
+
141
+ set_span_attributes(span, attributes)
142
+ try:
143
+ # Attempt to call the original method
144
+ result = wrapped(*args, **kwargs)
145
+ span.set_status(StatusCode.OK)
146
+ return result
147
+ except Exception as err:
148
+ # Record the exception in the span
149
+ span.record_exception(err)
150
+
151
+ # Set the span status to indicate an error
152
+ span.set_status(Status(StatusCode.ERROR, str(err)))
153
+
154
+ # Reraise the exception to ensure it's not swallowed
155
+ raise err
156
+
157
+ return traced_method
158
+
159
+
160
+ @silently_fail
161
+ def _set_input_attributes(span, kwargs, attributes):
162
+ tools = []
163
+ for field, value in attributes.model_dump(by_alias=True).items():
164
+ set_span_attribute(span, field, value)
165
+
166
+ if kwargs.get("tools") is not None:
167
+ tools.append(json.dumps(kwargs.get("tools")))
168
+
169
+ if tools:
170
+ set_span_attribute(span, SpanAttributes.LLM_TOOLS, json.dumps(tools))
171
+
172
+
173
+ @silently_fail
174
+ def _set_response_attributes(span, kwargs, result):
175
+ set_span_attribute(span, SpanAttributes.LLM_RESPONSE_MODEL, result.model)
176
+ if hasattr(result, "choices") and result.choices is not None:
177
+ responses = [
178
+ {
179
+ "role": (
180
+ choice.message.role
181
+ if choice.message and choice.message.role
182
+ else "assistant"
183
+ ),
184
+ "content": extract_content(choice),
185
+ }
186
+ for choice in result.choices
187
+ ]
188
+ set_event_completion(span, responses)
189
+
190
+ # Get the usage
191
+ if hasattr(result, "usage") and result.usage is not None:
192
+ set_usage_attributes(span, result.usage)
@@ -56,6 +56,7 @@ from langtrace_python_sdk.instrumentation import (
56
56
  DspyInstrumentation,
57
57
  VertexAIInstrumentation,
58
58
  GeminiInstrumentation,
59
+ MistralInstrumentation,
59
60
  )
60
61
  from opentelemetry.instrumentation.sqlalchemy import SQLAlchemyInstrumentor
61
62
  from colorama import Fore
@@ -72,7 +73,7 @@ def init(
72
73
  disable_instrumentations: Optional[DisableInstrumentations] = None,
73
74
  disable_tracing_for_functions: Optional[InstrumentationMethods] = None,
74
75
  service_name: Optional[str] = None,
75
- disable_logging = False
76
+ disable_logging=False,
76
77
  ):
77
78
  if disable_logging:
78
79
  sys.stdout = open(os.devnull, "w")
@@ -93,7 +94,9 @@ def init(
93
94
  provider = TracerProvider(resource=resource, sampler=sampler)
94
95
 
95
96
  remote_write_exporter = (
96
- LangTraceExporter(api_key=api_key, api_host=host, disable_logging=disable_logging)
97
+ LangTraceExporter(
98
+ api_key=api_key, api_host=host, disable_logging=disable_logging
99
+ )
97
100
  if custom_remote_exporter is None
98
101
  else custom_remote_exporter
99
102
  )
@@ -125,6 +128,7 @@ def init(
125
128
  "crewai": CrewAIInstrumentation(),
126
129
  "vertexai": VertexAIInstrumentation(),
127
130
  "gemini": GeminiInstrumentation(),
131
+ "mistral": MistralInstrumentation(),
128
132
  }
129
133
 
130
134
  init_instrumentations(disable_instrumentations, all_instrumentations)
@@ -7,6 +7,7 @@ class InstrumentationType(Enum):
7
7
  COHERE = "cohere"
8
8
  ANTHROPIC = "anthropic"
9
9
  GROQ = "groq"
10
+ MISTRAL = "mistral"
10
11
  PINECONE = "pinecone"
11
12
  LLAMAINDEX = "llamaindex"
12
13
  CHROMADB = "chromadb"
@@ -43,6 +44,11 @@ class VendorMethods(TypedDict):
43
44
  "openai.images.generate",
44
45
  "openai.images.edit",
45
46
  ]
47
+ MistralMethods = Literal[
48
+ "mistral.chat.complete",
49
+ "mistral.chat.stream",
50
+ "mistral.embeddings.create",
51
+ ]
46
52
 
47
53
  ChromadbMethods = Literal[
48
54
  "chromadb.collection.add",
@@ -93,6 +99,7 @@ class VendorMethods(TypedDict):
93
99
  class InstrumentationMethods(TypedDict):
94
100
  open_ai: List[VendorMethods.OpenaiMethods]
95
101
  groq: List[VendorMethods.GroqMethods]
102
+ mistral: List[VendorMethods.MistralMethods]
96
103
  pinecone: List[VendorMethods.PineconeMethods]
97
104
  llamaindex: List[VendorMethods.LlamaIndexMethods]
98
105
  chromadb: List[VendorMethods.ChromadbMethods]
@@ -411,6 +411,12 @@ class StreamWrapper:
411
411
  self.completion_tokens = chunk["eval_count"]
412
412
 
413
413
  def process_chunk(self, chunk):
414
+ # Mistral nests the chunk data under a `data` attribute
415
+ if (
416
+ hasattr(chunk, "data") and chunk.data is not None
417
+ and hasattr(chunk.data, "choices") and chunk.data.choices is not None
418
+ ):
419
+ chunk = chunk.data
414
420
  self.set_response_model(chunk=chunk)
415
421
  self.build_streaming_response(chunk=chunk)
416
422
  self.set_usage_attributes(chunk=chunk)
@@ -1 +1 @@
1
- __version__ = "2.2.25"
1
+ __version__ = "2.2.26"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: langtrace-python-sdk
3
- Version: 2.2.25
3
+ Version: 2.2.26
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>
@@ -20,7 +20,7 @@ Requires-Dist: opentelemetry-instrumentation>=0.47b0
20
20
  Requires-Dist: opentelemetry-sdk>=1.25.0
21
21
  Requires-Dist: sqlalchemy
22
22
  Requires-Dist: tiktoken>=0.1.1
23
- Requires-Dist: trace-attributes==7.0.3
23
+ Requires-Dist: trace-attributes==7.0.4
24
24
  Provides-Extra: dev
25
25
  Requires-Dist: anthropic; extra == 'dev'
26
26
  Requires-Dist: chromadb; extra == 'dev'
@@ -31,6 +31,7 @@ Requires-Dist: groq; extra == 'dev'
31
31
  Requires-Dist: langchain; extra == 'dev'
32
32
  Requires-Dist: langchain-community; extra == 'dev'
33
33
  Requires-Dist: langchain-openai; extra == 'dev'
34
+ Requires-Dist: mistralai; extra == 'dev'
34
35
  Requires-Dist: ollama; extra == 'dev'
35
36
  Requires-Dist: openai; extra == 'dev'
36
37
  Requires-Dist: pinecone-client; extra == 'dev'
@@ -291,6 +292,7 @@ Langtrace automatically captures traces from the following vendors:
291
292
  | Groq | LLM | :x: | :white_check_mark: |
292
293
  | Perplexity | LLM | :white_check_mark: | :white_check_mark: |
293
294
  | Gemini | LLM | :x: | :white_check_mark: |
295
+ | Mistral | LLM | :x: | :white_check_mark: |
294
296
  | Langchain | Framework | :x: | :white_check_mark: |
295
297
  | LlamaIndex | Framework | :white_check_mark: | :white_check_mark: |
296
298
  | Langgraph | Framework | :x: | :white_check_mark: |
@@ -16,7 +16,7 @@ examples/crewai_example/simple_agent/agents.py,sha256=Lq_5zeftH7TV-dsDRxfxi6sfE3
16
16
  examples/crewai_example/simple_agent/main.py,sha256=MJq3Xd24RIUHaSDAUpQtZb5ht5YUu5xPwgYxEY4moJk,1223
17
17
  examples/crewai_example/simple_agent/tasks.py,sha256=bfx_vP59akrrjNRUbVT7GDzdZlEqTQXAtGcCOCk_UFY,796
18
18
  examples/crewai_example/trip_planner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
- examples/crewai_example/trip_planner/agents.py,sha256=IpzLbgrmdMa-9mj6awjJUcOumX8Cg71OzRQ1L8fIog4,2378
19
+ examples/crewai_example/trip_planner/agents.py,sha256=bSmtD83qcB3PF21zjqdvAYe0vVvl0nhGVXX5oPeSGY8,2371
20
20
  examples/crewai_example/trip_planner/main.py,sha256=Ju001KRksiH1Svu6p83CfTybAPq9hruJVH9p3BmtG_c,2623
21
21
  examples/crewai_example/trip_planner/tasks.py,sha256=ZGRaTAgkA66IN7q9EYbJqM8xWhUTxcF4ynnqTyBcSL4,5667
22
22
  examples/crewai_example/trip_planner/tools/calculator.py,sha256=bMfxJDAwbn6D26pe880S4BB3rcFeyvEyb15QR00T8kI,522
@@ -39,10 +39,15 @@ examples/langchain_example/groq_example.py,sha256=egrg3FHCnSJ-kV22Z2_t9ElJfKildd
39
39
  examples/langchain_example/langgraph_example.py,sha256=7C2a4Sg0PKbbab03CVkStO3MzT7C-O1UtdmObvBXurM,2005
40
40
  examples/langchain_example/sagemaker.py,sha256=V-rTZRyaErHCuo3kfrrZD8AELHJVi3wF7n1YrixfF1s,2330
41
41
  examples/langchain_example/tool.py,sha256=8T8_IDbgA58XbsfyH5_xhA8ZKQfyfyFxF8wor-PsRjA,2556
42
+ examples/litellm_example/basic.py,sha256=h71u1vMKdPlGJbC1DmK8PKIbaDj4I96-cx2hztboDic,2544
42
43
  examples/llamaindex_example/__init__.py,sha256=4w8Hz5pfmMzhkHAbBim6jwxHxMicaN4xi1Of9pODO8g,252
43
44
  examples/llamaindex_example/agent.py,sha256=JNK6xDX17HOFRShBK7a71HPWD05LwzPES9YVyl_azIQ,2767
44
45
  examples/llamaindex_example/basic.py,sha256=aFZngkye95sjUr4wc2Uo_Je0iEexXpNcdlV0BTv_F4g,726
45
46
  examples/llamaindex_example/data/abramov.txt,sha256=Ou-GyWZm5AjHLgxviBoRE9ikNv5MScsF0cd--0vVVhI,32667
47
+ examples/mistral_example/__init__.py,sha256=4kMzYY7whzUFkT9LvqPp9wSdwNtk8pq28pmZIhCJBvU,467
48
+ examples/mistral_example/complete.py,sha256=Ydf5iOCGM2tySSd5vzGvNh3Qz39aTpxcCItBii9b0ig,589
49
+ examples/mistral_example/complete_async.py,sha256=-SVOLNLNi5JL3o4obBsCXKOt8A6b61j3otbrrYPOOtM,586
50
+ examples/mistral_example/embeddings.py,sha256=LKq_k3Y-TS2SCkyFKw2tLiYreVRHqlY6z0Gfh1y_7u0,468
46
51
  examples/ollama_example/__init__.py,sha256=qOx0jGCPuSpRCPiqtDVm7F0z8hIZ8C75hDZ_C8Apz-s,399
47
52
  examples/ollama_example/basic.py,sha256=EPbsigOF4xBDBgLgAD0EzPo737ycVm7aXZr7F5Xt-A4,1062
48
53
  examples/openai_example/__init__.py,sha256=MU4CELvhe2EU6d4Okg-bTfjvfGxQO7PNzqMw1yrVeCA,828
@@ -73,17 +78,18 @@ examples/vertexai_example/main.py,sha256=gndId5X5ksD-ycxnAWMdEqIDbLc3kz5Vt8vm4YP
73
78
  examples/weaviate_example/__init__.py,sha256=8JMDBsRSEV10HfTd-YC7xb4txBjD3la56snk-Bbg2Kw,618
74
79
  examples/weaviate_example/query_text.py,sha256=wPHQTc_58kPoKTZMygVjTj-2ZcdrIuaausJfMxNQnQc,127162
75
80
  langtrace_python_sdk/__init__.py,sha256=VZM6i71NR7pBQK6XvJWRelknuTYUhqwqE7PlicKa5Wg,1166
76
- langtrace_python_sdk/langtrace.py,sha256=5BL5lNZejLRq9AVuOCjFaPpIkFNUh2vLvlGSGVxUlE4,7974
77
- langtrace_python_sdk/version.py,sha256=8xbzK-r35DSBokXIRfAv8IZHOXPKauxqDz3rOSngMig,23
81
+ langtrace_python_sdk/langtrace.py,sha256=kcSZal0BVw2FWhndpQZ3o8xJSnRHdW7aqG5f1X78zHo,8068
82
+ langtrace_python_sdk/version.py,sha256=psAh-vHFMOGsdz-WRHXk-3pccmmzAAxpvO1HOSQyjE0,23
78
83
  langtrace_python_sdk/constants/__init__.py,sha256=P8QvYwt5czUNDZsKS64vxm9Dc41ptGbuF1TFtAF6nv4,44
79
84
  langtrace_python_sdk/constants/exporter/langtrace_exporter.py,sha256=5MNjnAOg-4am78J3gVMH6FSwq5N8TOj72ugkhsw4vi0,46
80
85
  langtrace_python_sdk/constants/instrumentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
81
86
  langtrace_python_sdk/constants/instrumentation/anthropic.py,sha256=YX3llt3zwDY6XrYk3CB8WEVqgrzRXEw_ffyk56JoF3k,126
82
87
  langtrace_python_sdk/constants/instrumentation/chroma.py,sha256=hiPGYdHS0Yj4Kh3eaYBbuCAl_swqIygu80yFqkOgdak,955
83
88
  langtrace_python_sdk/constants/instrumentation/cohere.py,sha256=tf9sDfb5K3qOAHChEE5o8eYWPZ1io58VsOjZDCZPxfw,577
84
- langtrace_python_sdk/constants/instrumentation/common.py,sha256=YmB2LNT6bEpp91JszD8qRB0grdQplw13O1t9LKeDyAQ,935
89
+ langtrace_python_sdk/constants/instrumentation/common.py,sha256=MVNN-ySaIUqGXH5ne9Gq-_hwg29hmxYz5dhADP2lp7Y,961
85
90
  langtrace_python_sdk/constants/instrumentation/gemini.py,sha256=UAmfgg9FM7uNeOCdPfWlir6OIH-8BoxFGPRpdBd9ZZs,358
86
91
  langtrace_python_sdk/constants/instrumentation/groq.py,sha256=VFXmIl4aqGY_fS0PAmjPj_Qm7Tibxbx7Ur_e7rQpqXc,134
92
+ langtrace_python_sdk/constants/instrumentation/mistral.py,sha256=9PlmcC5P5_BHJ-zsX1xekht6rSm7arTin58HAfdYvLk,730
87
93
  langtrace_python_sdk/constants/instrumentation/ollama.py,sha256=H_-S0xjqRsi5qSp7mAlK7Y9NlQ3BqOkG6ASogqqgdJY,212
88
94
  langtrace_python_sdk/constants/instrumentation/openai.py,sha256=uEOH5UXapU2DSf2AdgXTRhhJEHGWXUNFkUGD5QafflM,1164
89
95
  langtrace_python_sdk/constants/instrumentation/pinecone.py,sha256=0TityERbGWaHGSN8-vyYZtYCjVj8fQOKae8lng0O0Bk,478
@@ -93,7 +99,7 @@ langtrace_python_sdk/constants/instrumentation/weaviate.py,sha256=gtv-JBxvNGClEM
93
99
  langtrace_python_sdk/extensions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
94
100
  langtrace_python_sdk/extensions/langtrace_exporter.py,sha256=_GIH4zP9lpk8UO81zBJ_9HklNszg1bsndqqXwcVe2rY,4569
95
101
  langtrace_python_sdk/extensions/langtrace_filesystem.py,sha256=34fZutG28EJ66l67OvTGsydAH3ZpXgikdE7hVLqBpG4,7863
96
- langtrace_python_sdk/instrumentation/__init__.py,sha256=yJd3aGu4kPfm2h6oe6kiCWvzTF9awpC1UztjXF9WSO4,1391
102
+ langtrace_python_sdk/instrumentation/__init__.py,sha256=BgY4bXGiVEHgpiRq5_OF4w-wqZCC46SBrEBbNO2EzWs,1465
97
103
  langtrace_python_sdk/instrumentation/anthropic/__init__.py,sha256=donrurJAGYlxrSRA3BIf76jGeUcAx9Tq8CVpah68S0Y,101
98
104
  langtrace_python_sdk/instrumentation/anthropic/instrumentation.py,sha256=-srgE8qumAn0ulQYZxMa8ch-9IBH0XgBW_rfEnGk6LI,1684
99
105
  langtrace_python_sdk/instrumentation/anthropic/patch.py,sha256=i_94sJXURVgKIUVKJ3mMqZydWtlv5BlIRqQEk8utrL4,4546
@@ -130,6 +136,9 @@ langtrace_python_sdk/instrumentation/langgraph/patch.py,sha256=yRMUj9bjI7oIUD_tC
130
136
  langtrace_python_sdk/instrumentation/llamaindex/__init__.py,sha256=rHvuqpuQKLj57Ow7vuKRqxAN5jT0b5NBeHwhXbbnRa4,103
131
137
  langtrace_python_sdk/instrumentation/llamaindex/instrumentation.py,sha256=8iAg-Oxwf2W4S60qRfO5mvzORYxublgq7FdGWqUB4q8,2965
132
138
  langtrace_python_sdk/instrumentation/llamaindex/patch.py,sha256=548hzPyT_k-2wmt9AArv4JzTT4j4AGKJq5Ar2bWv7o8,4615
139
+ langtrace_python_sdk/instrumentation/mistral/__init__.py,sha256=mkGALBQvq0jSfwDl6TU09SFwnVs6O4zkUi-yVmd3SNg,90
140
+ langtrace_python_sdk/instrumentation/mistral/instrumentation.py,sha256=qtCkHCSOaiicUChbmTID4lcK1rbeW8oRSbpda2ogbgM,2328
141
+ langtrace_python_sdk/instrumentation/mistral/patch.py,sha256=1peU0vqt9BGYn2PFNyKAMKNRVMEujXNyZGzgttPJrTQ,6580
133
142
  langtrace_python_sdk/instrumentation/ollama/__init__.py,sha256=g2zJsXnDHinXPzTc-WxDeTtHmr9gmAj3K6l_00kP8c8,82
134
143
  langtrace_python_sdk/instrumentation/ollama/instrumentation.py,sha256=jdsvkqUJAAUNLVPtAkn_rG26HXetVQXWtjn4a6eWZro,2029
135
144
  langtrace_python_sdk/instrumentation/ollama/patch.py,sha256=7ETx0tQic5h_kH1f-IeptFwgNTBb4hSkTkWsB18Avm0,5375
@@ -148,10 +157,10 @@ langtrace_python_sdk/instrumentation/vertexai/patch.py,sha256=mfd3LiKYGMW3jLf9OE
148
157
  langtrace_python_sdk/instrumentation/weaviate/__init__.py,sha256=Mc-Je6evPo-kKQzerTG7bd1XO5JOh4YGTE3wBxaUBwg,99
149
158
  langtrace_python_sdk/instrumentation/weaviate/instrumentation.py,sha256=bzPwtoQD0X6beLYXe6ZL7XRkyRkqdiqKiGc4gOlCQdU,2295
150
159
  langtrace_python_sdk/instrumentation/weaviate/patch.py,sha256=nr7USyY6overK3GQCo4Si0x3eoEl9ptoMRXuQUP4Ox8,6671
151
- langtrace_python_sdk/types/__init__.py,sha256=KDW6S74FDxpeBa9xoH5zVEYfmRjccCCHzlW7lTJg1TA,3194
160
+ langtrace_python_sdk/types/__init__.py,sha256=M-_6eLNR8GhjFZH3iMay4s3j7EcsT-hRAM5IWluS58A,3403
152
161
  langtrace_python_sdk/utils/__init__.py,sha256=SwYYPIh2AzEpI3zbwowQU2zJlwRwoVdWOCcrAKnkI9g,873
153
162
  langtrace_python_sdk/utils/langtrace_sampler.py,sha256=BupNndHbU9IL_wGleKetz8FdcveqHMBVz1bfKTTW80w,1753
154
- langtrace_python_sdk/utils/llm.py,sha256=hDOPyUp3kSL1g92uiHySARzBmVRMy3umGizz91vTDSI,13940
163
+ langtrace_python_sdk/utils/llm.py,sha256=4vcyqPSFnUURFZK-9cP648Pe2cRUHMX9eFQZi1B-yCI,14203
155
164
  langtrace_python_sdk/utils/misc.py,sha256=CD9NWRLxLpFd0YwlHJqzlpFNedXVWtAKGOjQWnDCo8k,838
156
165
  langtrace_python_sdk/utils/prompt_registry.py,sha256=n5dQMVLBw8aJZY8Utvf67bncc25ELf6AH9BYw8_hSzo,2619
157
166
  langtrace_python_sdk/utils/sdk_version_checker.py,sha256=FzjIWZjn53cX0LEVPdipQd1fO9lG8iGVUEVUs9Hyk6M,1713
@@ -200,8 +209,8 @@ tests/pinecone/cassettes/test_query.yaml,sha256=b5v9G3ssUy00oG63PlFUR3JErF2Js-5A
200
209
  tests/pinecone/cassettes/test_upsert.yaml,sha256=neWmQ1v3d03V8WoLl8FoFeeCYImb8pxlJBWnFd_lITU,38607
201
210
  tests/qdrant/conftest.py,sha256=9n0uHxxIjWk9fbYc4bx-uP8lSAgLBVx-cV9UjnsyCHM,381
202
211
  tests/qdrant/test_qdrant.py,sha256=pzjAjVY2kmsmGfrI2Gs2xrolfuaNHz7l1fqGQCjp5_o,3353
203
- langtrace_python_sdk-2.2.25.dist-info/METADATA,sha256=N1w_sCc_3OMdsdme1UeDvS-h0jaG5VgN5YpXT6F9f00,14705
204
- langtrace_python_sdk-2.2.25.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
205
- langtrace_python_sdk-2.2.25.dist-info/entry_points.txt,sha256=1_b9-qvf2fE7uQNZcbUei9vLpFZBbbh9LrtGw95ssAo,70
206
- langtrace_python_sdk-2.2.25.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
207
- langtrace_python_sdk-2.2.25.dist-info/RECORD,,
212
+ langtrace_python_sdk-2.2.26.dist-info/METADATA,sha256=BTaMPUEw29T4Xjf2vicxbZHomQtMs1GSfc3QquDph78,14836
213
+ langtrace_python_sdk-2.2.26.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
214
+ langtrace_python_sdk-2.2.26.dist-info/entry_points.txt,sha256=1_b9-qvf2fE7uQNZcbUei9vLpFZBbbh9LrtGw95ssAo,70
215
+ langtrace_python_sdk-2.2.26.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
216
+ langtrace_python_sdk-2.2.26.dist-info/RECORD,,