langtrace-python-sdk 2.2.30__py3-none-any.whl → 2.3.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.
@@ -1,15 +1,13 @@
1
1
  from crewai import Agent
2
- from langchain_openai import ChatOpenAI
3
2
  from langchain_anthropic import ChatAnthropic
4
3
  from langchain_cohere import ChatCohere
5
4
  from langchain_ollama import ChatOllama
5
+ from langchain_openai import ChatOpenAI
6
6
 
7
7
 
8
8
  class PoetryAgents:
9
9
  def __init__(self):
10
- self.open_ai = ChatOpenAI(
11
- model_name="gpt-4", temperature=0.7, stream_usage=True
12
- )
10
+ self.open_ai = ChatOpenAI(model_name="gpt-4", temperature=0.7)
13
11
  self.anthropic = ChatAnthropic(
14
12
  model_name="claude-3-5-sonnet-20240620", temperature=0.7
15
13
  )
@@ -28,5 +26,30 @@ class PoetryAgents:
28
26
  goal="""Create a poem that captures the essence of a given theme or emotion""",
29
27
  allow_delegation=False,
30
28
  verbose=True,
31
- llm=self.ollama,
29
+ llm=self.open_ai,
30
+ )
31
+
32
+ def poet_agent_2(self):
33
+ return Agent(
34
+ role="Renaissance Poet",
35
+ backstory="""
36
+ I am a Renaissance Poet. I am well-versed in the art of poetry and have a deep appreciation for the beauty of language and expression.
37
+ """,
38
+ goal="""Create a poem that is inspired by the works of the Renaissance poets""",
39
+ allow_delegation=False,
40
+ verbose=True,
41
+ llm=self.open_ai,
42
+ )
43
+
44
+ def poet_agent_3(self):
45
+ return Agent(
46
+ role="William Shakespeare",
47
+ backstory="""
48
+ I am william shakespeare. I am an Expert in poetry writing and creative expression.
49
+ I have been writing poetry for over 10 years and have published several collections.
50
+ """,
51
+ goal="""Create a poem that is inspired by the works of William Shakespeare""",
52
+ allow_delegation=False,
53
+ verbose=True,
54
+ llm=self.open_ai,
32
55
  )
@@ -1,14 +1,12 @@
1
+ from agents import PoetryAgents
1
2
  from crewai import Crew
2
- from textwrap import dedent
3
- from .agents import PoetryAgents
4
- from .tasks import PoetryTasks
5
- from langtrace_python_sdk import langtrace
6
3
  from dotenv import load_dotenv
7
- import agentops
4
+ from tasks import PoetryTasks
5
+
6
+ from langtrace_python_sdk import langtrace
8
7
 
9
8
  load_dotenv()
10
- agentops.init()
11
- langtrace.init(write_spans_to_console=False, batch=False)
9
+ langtrace.init()
12
10
 
13
11
 
14
12
  class PoetryCrew:
@@ -20,27 +18,24 @@ class PoetryCrew:
20
18
  tasks = PoetryTasks()
21
19
 
22
20
  poetry_agent = agents.create_poet_agent()
21
+ poetry_agent_2 = agents.poet_agent_2()
22
+ poetry_agent_3 = agents.poet_agent_3()
23
23
 
24
24
  create_poem = tasks.create_poem(poetry_agent, self.topic)
25
+ create_poem_2 = tasks.create_poem(poetry_agent_2, self.topic)
26
+ create_poem_3 = tasks.create_poem(poetry_agent_3, self.topic)
25
27
 
26
- crew = Crew(agents=[poetry_agent], tasks=[create_poem], verbose=True)
28
+ crew = Crew(agents=[poetry_agent], tasks=[create_poem], verbose=True, memory=True)
27
29
  res = crew.kickoff()
28
30
  return res
29
31
 
30
32
 
31
33
  # This is the main function that you will use to run your custom crew.
34
+ # You can run this file using `python -m src.examples.crewai_example.simple_agent.main`
32
35
  if __name__ == "__main__":
33
36
  print("## Welcome to Poetry Crew")
34
37
  print("-------------------------------")
35
- topic = input(
36
- dedent(
37
- """
38
- What topic do you want to write a poem on?
39
- """
40
- )
41
- )
42
-
43
- poetry_crew = PoetryCrew(topic=topic)
38
+ poetry_crew = PoetryCrew(topic="cold")
44
39
  result = poetry_crew.run()
45
40
  print("\n\n########################")
46
41
  print("## Here is you poem")
@@ -18,4 +18,5 @@ class PoetryTasks:
18
18
  ),
19
19
  expected_output="A creative and expressive poem that captures the essence of the given topic.",
20
20
  agent=agent,
21
+ output_file="poem.txt",
21
22
  )
@@ -1,5 +1,4 @@
1
1
  from crewai import Crew
2
- from textwrap import dedent
3
2
  from .agents import TravelAgents
4
3
  from .tasks import TravelTasks
5
4
  from langtrace_python_sdk import langtrace
@@ -59,36 +58,8 @@ class TripCrew:
59
58
  if __name__ == "__main__":
60
59
  print("## Welcome to Trip Planner Crew")
61
60
  print("-------------------------------")
62
- origin = input(
63
- dedent(
64
- """
65
- From where will you be traveling from?
66
- """
67
- )
68
- )
69
- cities = input(
70
- dedent(
71
- """
72
- What are the cities options you are interested in visiting?
73
- """
74
- )
75
- )
76
- date_range = input(
77
- dedent(
78
- """
79
- What is the date range you are interested in traveling?
80
- """
81
- )
82
- )
83
- interests = input(
84
- dedent(
85
- """
86
- What are some of your high level interests and hobbies?
87
- """
88
- )
89
- )
90
61
 
91
- trip_crew = TripCrew(origin, cities, date_range, interests)
62
+ trip_crew = TripCrew("cairo", "marsa alam", "sep", "scuba diving")
92
63
  result = trip_crew.run()
93
64
  print("\n\n########################")
94
65
  print("## Here is you Trip Plan")
@@ -0,0 +1,15 @@
1
+ from dotenv import load_dotenv
2
+ from embedchain import App
3
+ from langtrace_python_sdk import langtrace
4
+
5
+ load_dotenv()
6
+ langtrace.init()
7
+
8
+ app = App()
9
+ app.reset()
10
+ app.add("https://www.forbes.com/profile/elon-musk")
11
+ app.add("https://en.wikipedia.org/wiki/Elon_Musk")
12
+ res = app.query("What is the net worth of Elon Musk today?")
13
+ print(res)
14
+ re2 = app.search("Elon Musk")
15
+ print(re2)
@@ -30,6 +30,7 @@ SERVICE_PROVIDERS = {
30
30
  "VERTEXAI": "VertexAI",
31
31
  "GEMINI": "Gemini",
32
32
  "MISTRAL": "Mistral",
33
+ "EMBEDCHAIN": "Embedchain",
33
34
  }
34
35
 
35
36
  LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY = "langtrace_additional_attributes"
@@ -0,0 +1,14 @@
1
+ APIS = {
2
+ "ADD": {
3
+ "METHOD": "embedchain.add",
4
+ "OPERATION": "add",
5
+ },
6
+ "QUERY": {
7
+ "METHOD": "embedchain.query",
8
+ "OPERATION": "query",
9
+ },
10
+ "SEARCH": {
11
+ "METHOD": "embedchain.search",
12
+ "OPERATION": "search",
13
+ },
14
+ }
@@ -17,12 +17,14 @@ from .dspy import DspyInstrumentation
17
17
  from .vertexai import VertexAIInstrumentation
18
18
  from .gemini import GeminiInstrumentation
19
19
  from .mistral import MistralInstrumentation
20
+ from .embedchain import EmbedchainInstrumentation
20
21
 
21
22
  __all__ = [
22
23
  "AnthropicInstrumentation",
23
24
  "ChromaInstrumentation",
24
25
  "CohereInstrumentation",
25
26
  "CrewAIInstrumentation",
27
+ "EmbedchainInstrumentation",
26
28
  "GroqInstrumentation",
27
29
  "LangchainInstrumentation",
28
30
  "LangchainCommunityInstrumentation",
@@ -51,7 +51,7 @@ def collection_patch(method, version, tracer):
51
51
  "langtrace.version": v(LANGTRACE_SDK_NAME),
52
52
  "db.system": "chromadb",
53
53
  "db.operation": api["OPERATION"],
54
- "db.query": json.dumps(kwargs.get("query")),
54
+ "db.query": json.dumps(kwargs),
55
55
  **(extra_attributes if extra_attributes is not None else {}),
56
56
  }
57
57
 
@@ -46,7 +46,7 @@ class CrewAIInstrumentation(BaseInstrumentor):
46
46
  )
47
47
  _W(
48
48
  "crewai.task",
49
- "Task.execute",
49
+ "Task.execute_sync",
50
50
  patch_crew("Task.execute", version, tracer),
51
51
  )
52
52
  except Exception as e:
@@ -2,15 +2,14 @@ import json
2
2
  from importlib_metadata import version as v
3
3
  from langtrace_python_sdk.constants import LANGTRACE_SDK_NAME
4
4
  from langtrace_python_sdk.utils import set_span_attribute
5
- from langtrace_python_sdk.utils.llm import get_span_name
6
- from langtrace_python_sdk.utils.silently_fail import silently_fail
5
+ from langtrace_python_sdk.utils.llm import get_span_name, set_span_attributes
7
6
  from langtrace_python_sdk.constants.instrumentation.common import (
8
7
  LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY,
9
8
  SERVICE_PROVIDERS,
10
9
  )
11
10
  from opentelemetry import baggage
12
11
  from langtrace.trace_attributes import FrameworkSpanAttributes
13
- from opentelemetry.trace import SpanKind
12
+ from opentelemetry.trace import SpanKind, Span, Tracer
14
13
  from opentelemetry.trace.status import Status, StatusCode
15
14
 
16
15
 
@@ -33,8 +32,8 @@ crew_properties = {
33
32
  "share_crew": "bool",
34
33
  "step_callback": "object",
35
34
  "task_callback": "object",
36
- "prompt_file": "object",
37
- "output_log_file": "object",
35
+ "prompt_file": "str",
36
+ "output_log_file": "bool",
38
37
  }
39
38
 
40
39
  task_properties = {
@@ -90,9 +89,8 @@ agent_properties = {
90
89
  }
91
90
 
92
91
 
93
- def patch_crew(operation_name, version, tracer):
92
+ def patch_crew(operation_name, version, tracer: Tracer):
94
93
  def traced_method(wrapped, instance, args, kwargs):
95
-
96
94
  service_provider = SERVICE_PROVIDERS["CREWAI"]
97
95
  extra_attributes = baggage.get_baggage(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY)
98
96
  span_attributes = {
@@ -104,55 +102,30 @@ def patch_crew(operation_name, version, tracer):
104
102
  **(extra_attributes if extra_attributes is not None else {}),
105
103
  }
106
104
 
107
- crew_config = {}
108
- for key, value in instance.__dict__.items():
109
- if instance.__class__.__name__ == "Crew":
110
- if key in crew_properties and value is not None:
111
- if crew_properties[key] == "json":
112
- crew_config[key] = json.dumps(value)
113
- elif crew_properties[key] == "object":
114
- crew_config[key] = str(value)
115
- else:
116
- crew_config[key] = value
117
- elif instance.__class__.__name__ == "Agent":
118
- if key in agent_properties and value is not None:
119
- if agent_properties[key] == "json":
120
- crew_config[key] = json.dumps(value)
121
- elif agent_properties[key] == "object":
122
- crew_config[key] = str(value)
123
- else:
124
- crew_config[key] = value
125
- elif instance.__class__.__name__ == "Task":
126
- if key in task_properties and value is not None:
127
- if task_properties[key] == "json":
128
- crew_config[key] = json.dumps(value)
129
- elif task_properties[key] == "object":
130
- crew_config[key] = str(value)
131
- else:
132
- crew_config[key] = value
133
- if crew_config:
134
- if instance.__class__.__name__ == "Crew":
135
- if "inputs" in kwargs and kwargs["inputs"]:
136
- crew_config["inputs"] = json.dumps(kwargs["inputs"])
137
- span_attributes["crewai.crew.config"] = json.dumps(crew_config)
138
- elif instance.__class__.__name__ == "Agent":
139
- if "context" in kwargs and kwargs["context"]:
140
- crew_config["context"] = json.dumps(kwargs["context"])
141
- span_attributes["crewai.agent.config"] = json.dumps(crew_config)
142
- elif instance.__class__.__name__ == "Task":
143
- span_attributes["crewai.task.config"] = json.dumps(crew_config)
144
-
145
105
  attributes = FrameworkSpanAttributes(**span_attributes)
146
106
 
147
107
  with tracer.start_as_current_span(
148
108
  get_span_name(operation_name), kind=SpanKind.CLIENT
149
109
  ) as span:
150
- _set_input_attributes(span, kwargs, attributes)
151
110
 
152
111
  try:
112
+ set_span_attributes(span, attributes)
113
+ CrewAISpanAttributes(span=span, instance=instance)
153
114
  result = wrapped(*args, **kwargs)
154
115
  if result:
155
116
  span.set_status(Status(StatusCode.OK))
117
+ if instance.__class__.__name__ == "Crew":
118
+ span.set_attribute("crewai.crew.result", str(result))
119
+ if hasattr(result, "tasks_output"):
120
+ span.set_attribute("crewai.crew.tasks_output", str((result.tasks_output)))
121
+ if hasattr(result, "token_usage"):
122
+ span.set_attribute("crewai.crew.token_usage", str((result.token_usage)))
123
+ if hasattr(result, "usage_metrics"):
124
+ span.set_attribute("crewai.crew.usage_metrics", str((result.usage_metrics)))
125
+ elif instance.__class__.__name__ == "Agent":
126
+ span.set_attribute("crewai.agent.result", str(result))
127
+ elif instance.__class__.__name__ == "Task":
128
+ span.set_attribute("crewai.task.result", str(result))
156
129
 
157
130
  span.end()
158
131
  return result
@@ -170,7 +143,103 @@ def patch_crew(operation_name, version, tracer):
170
143
  return traced_method
171
144
 
172
145
 
173
- @silently_fail
174
- def _set_input_attributes(span, kwargs, attributes):
175
- for field, value in attributes.model_dump(by_alias=True).items():
176
- set_span_attribute(span, field, value)
146
+ class CrewAISpanAttributes:
147
+ span: Span
148
+ crew: dict
149
+
150
+ def __init__(self, span: Span, instance) -> None:
151
+ self.span = span
152
+ self.instance = instance
153
+ self.crew = {
154
+ "tasks": [],
155
+ "agents": [],
156
+ }
157
+
158
+ self.run()
159
+
160
+ def run(self):
161
+ instance_name = self.instance.__class__.__name__
162
+ if instance_name == "Crew":
163
+ self.set_crew_attributes()
164
+ set_span_attribute(self.span, "crewai.crew.config", json.dumps(self.crew))
165
+
166
+ elif instance_name == "Agent":
167
+ agent = self.set_agent_attributes()
168
+ # for key, value in agent.items():
169
+ # set_span_attribute(self.span, key, value)
170
+ set_span_attribute(self.span, "crewai.agent.config", json.dumps(agent))
171
+ elif instance_name == "Task":
172
+ task = self.set_task_attributes()
173
+ # uncomment if you want to spread attributes for the UI instead of dumping the whole object
174
+ # for key, value in task.items():
175
+ # set_span_attribute(self.span, key, value)
176
+ set_span_attribute(self.span, "crewai.task.config", json.dumps(task))
177
+
178
+ def set_crew_attributes(self):
179
+ for key, value in self.instance.__dict__.items():
180
+ if key == "tasks":
181
+ self._parse_tasks(value)
182
+
183
+ elif key == "agents":
184
+ self._parse_agents(value)
185
+ else:
186
+ self.crew[key] = str(value)
187
+
188
+ def set_agent_attributes(self):
189
+ agent = {}
190
+ for key, value in self.instance.__dict__.items():
191
+ if value is None:
192
+ continue
193
+ agent[key] = str(value)
194
+
195
+ return agent
196
+
197
+ def set_task_attributes(self):
198
+ task = {}
199
+ for key, value in self.instance.__dict__.items():
200
+ if value is None:
201
+ continue
202
+
203
+ if key == "agent":
204
+ task[key] = value.role
205
+ else:
206
+ task[key] = str(value)
207
+ return task
208
+
209
+ def _parse_agents(self, agents):
210
+ for agent in agents:
211
+ model = None
212
+ if agent.llm is not None:
213
+ if hasattr(agent.llm, "model"):
214
+ model = agent.llm.model
215
+ elif hasattr(agent.llm, "model_name"):
216
+ model = agent.llm.model_name
217
+ self.crew["agents"].append(
218
+ {
219
+ "id": str(agent.id),
220
+ "role": agent.role,
221
+ "goal": agent.goal,
222
+ "backstory": agent.backstory,
223
+ "cache": agent.cache,
224
+ "config": agent.config,
225
+ "verbose": agent.verbose,
226
+ "allow_delegation": agent.allow_delegation,
227
+ "tools": agent.tools,
228
+ "max_iter": agent.max_iter,
229
+ "llm": str(model if model is not None else ""),
230
+ }
231
+ )
232
+
233
+ def _parse_tasks(self, tasks):
234
+ for task in tasks:
235
+ self.crew["tasks"].append(
236
+ {
237
+ "agent": task.agent.role,
238
+ "description": task.description,
239
+ "async_execution": task.async_execution,
240
+ "expected_output": task.expected_output,
241
+ "human_input": task.human_input,
242
+ "tools": task.tools,
243
+ "output_file": task.output_file,
244
+ }
245
+ )
@@ -0,0 +1,5 @@
1
+ from .instrumentation import EmbedchainInstrumentation
2
+
3
+ __all__ = [
4
+ "EmbedchainInstrumentation",
5
+ ]
@@ -0,0 +1,65 @@
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
24
+
25
+ from langtrace_python_sdk.instrumentation.embedchain.patch import generic_patch
26
+
27
+ logging.basicConfig(level=logging.FATAL)
28
+
29
+
30
+ class EmbedchainInstrumentation(BaseInstrumentor):
31
+ """
32
+ The EmbedchainInstrumentation class represents the Embedchain instrumentation
33
+ """
34
+
35
+ def instrumentation_dependencies(self) -> Collection[str]:
36
+ return ["embedchain >= 0.1.113"]
37
+
38
+ def _instrument(self, **kwargs):
39
+ tracer_provider = kwargs.get("tracer_provider")
40
+ tracer = get_tracer(__name__, "", tracer_provider)
41
+ version = importlib.metadata.version("embedchain")
42
+
43
+ wrap_function_wrapper(
44
+ "embedchain.embedchain",
45
+ "EmbedChain.add",
46
+ generic_patch("ADD", version, tracer),
47
+ )
48
+
49
+ wrap_function_wrapper(
50
+ "embedchain.embedchain",
51
+ "EmbedChain.query",
52
+ generic_patch("QUERY", version, tracer),
53
+ )
54
+
55
+ wrap_function_wrapper(
56
+ "embedchain.embedchain",
57
+ "EmbedChain.search",
58
+ generic_patch("SEARCH", version, tracer),
59
+ )
60
+
61
+ def _instrument_module(self, module_name):
62
+ pass
63
+
64
+ def _uninstrument(self, **kwargs):
65
+ pass
@@ -0,0 +1,91 @@
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
+ from langtrace.trace_attributes import FrameworkSpanAttributes
18
+ from langtrace_python_sdk.utils import set_span_attribute
19
+ from langtrace_python_sdk.utils.llm import get_span_name
20
+ from opentelemetry import baggage, trace
21
+ from opentelemetry.trace import SpanKind
22
+ from opentelemetry.trace.status import Status, StatusCode
23
+ from opentelemetry.trace.propagation import set_span_in_context
24
+ from langtrace_python_sdk.constants.instrumentation.embedchain import APIS
25
+ from langtrace_python_sdk.constants.instrumentation.common import (
26
+ LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY,
27
+ SERVICE_PROVIDERS,
28
+ )
29
+ import json
30
+ from importlib_metadata import version as v
31
+
32
+ from langtrace_python_sdk.constants import LANGTRACE_SDK_NAME
33
+
34
+
35
+ def generic_patch(method, version, tracer):
36
+ """
37
+ A generic patch method that wraps a function with a span
38
+ """
39
+
40
+ def traced_method(wrapped, instance, args, kwargs):
41
+ api = APIS[method]
42
+ service_provider = SERVICE_PROVIDERS["EMBEDCHAIN"]
43
+ extra_attributes = baggage.get_baggage(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY)
44
+
45
+ span_attributes = {
46
+ "langtrace.sdk.name": "langtrace-python-sdk",
47
+ "langtrace.service.name": service_provider,
48
+ "langtrace.service.type": "framework",
49
+ "langtrace.service.version": version,
50
+ "langtrace.version": v(LANGTRACE_SDK_NAME),
51
+ "embedchain.api": api["OPERATION"],
52
+ **(extra_attributes if extra_attributes is not None else {}),
53
+ }
54
+
55
+ if len(args) > 0:
56
+ span_attributes["embedchain.inputs"] = json.dumps(args)
57
+
58
+ attributes = FrameworkSpanAttributes(**span_attributes)
59
+
60
+ with tracer.start_as_current_span(
61
+ name=get_span_name(api["METHOD"]),
62
+ kind=SpanKind.CLIENT,
63
+ context=set_span_in_context(trace.get_current_span()),
64
+ ) as span:
65
+ for field, value in attributes.model_dump(by_alias=True).items():
66
+ if value is not None:
67
+ span.set_attribute(field, value)
68
+ try:
69
+ result = wrapped(*args, **kwargs)
70
+ set_span_attribute(span, "embedchain.outputs", json.dumps(result))
71
+ span.set_status(StatusCode.OK)
72
+ return result
73
+ except Exception as err:
74
+ # Record the exception in the span
75
+ span.record_exception(err)
76
+
77
+ # Set the span status to indicate an error
78
+ span.set_status(Status(StatusCode.ERROR, str(err)))
79
+
80
+ # Reraise the exception to ensure it's not swallowed
81
+ raise
82
+
83
+ return traced_method
84
+
85
+
86
+ def get_count_or_none(value):
87
+ return len(value) if value is not None else None
88
+
89
+
90
+ def handle_null_params(param):
91
+ return str(param) if param else None
@@ -42,6 +42,7 @@ from langtrace_python_sdk.instrumentation import (
42
42
  ChromaInstrumentation,
43
43
  CohereInstrumentation,
44
44
  CrewAIInstrumentation,
45
+ EmbedchainInstrumentation,
45
46
  GroqInstrumentation,
46
47
  LangchainInstrumentation,
47
48
  LangchainCommunityInstrumentation,
@@ -115,6 +116,7 @@ def init(
115
116
  "pinecone": PineconeInstrumentation(),
116
117
  "llamaindex": LlamaindexInstrumentation(),
117
118
  "chroma": ChromaInstrumentation(),
119
+ "embedchain": EmbedchainInstrumentation(),
118
120
  "qdrant": QdrantInstrumentation(),
119
121
  "langchain": LangchainInstrumentation(),
120
122
  "langchain_core": LangchainCoreInstrumentation(),
@@ -1 +1 @@
1
- __version__ = "2.2.30"
1
+ __version__ = "2.3.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: langtrace-python-sdk
3
- Version: 2.2.30
3
+ Version: 2.3.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>
@@ -26,6 +26,7 @@ Provides-Extra: dev
26
26
  Requires-Dist: anthropic; extra == 'dev'
27
27
  Requires-Dist: chromadb; extra == 'dev'
28
28
  Requires-Dist: cohere; extra == 'dev'
29
+ Requires-Dist: embedchain; extra == 'dev'
29
30
  Requires-Dist: google-cloud-aiplatform; extra == 'dev'
30
31
  Requires-Dist: google-generativeai; extra == 'dev'
31
32
  Requires-Dist: groq; extra == 'dev'
@@ -302,6 +303,7 @@ Langtrace automatically captures traces from the following vendors:
302
303
  | Ollama | Framework | :x: | :white_check_mark: |
303
304
  | VertexAI | Framework | :x: | :white_check_mark: |
304
305
  | Vercel AI SDK| Framework | :white_check_mark: | :x: |
306
+ | EmbedChain | Framework | :x: | :white_check_mark: |
305
307
  | Pinecone | Vector Database | :white_check_mark: | :white_check_mark: |
306
308
  | ChromaDB | Vector Database | :white_check_mark: | :white_check_mark: |
307
309
  | QDrant | Vector Database | :white_check_mark: | :white_check_mark: |
@@ -12,12 +12,12 @@ examples/cohere_example/tools.py,sha256=a5uvS058tcwU6PJbF9EDO6LPVmPj2LoW4Vn8Web3
12
12
  examples/crewai_example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  examples/crewai_example/basic.py,sha256=PBu4f8yQfZO1L_22UDm_ReU9lnEcycjZcGuy5UpgDJM,1948
14
14
  examples/crewai_example/simple_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- examples/crewai_example/simple_agent/agents.py,sha256=Lq_5zeftH7TV-dsDRxfxi6sfE3t2mpQ4WulFh1FAFfs,1329
16
- examples/crewai_example/simple_agent/main.py,sha256=MJq3Xd24RIUHaSDAUpQtZb5ht5YUu5xPwgYxEY4moJk,1223
17
- examples/crewai_example/simple_agent/tasks.py,sha256=bfx_vP59akrrjNRUbVT7GDzdZlEqTQXAtGcCOCk_UFY,796
15
+ examples/crewai_example/simple_agent/agents.py,sha256=IkjRlRZJgrT7fBtth9sSO7OEEs3IAe-tmZey4omedeI,2318
16
+ examples/crewai_example/simple_agent/main.py,sha256=SS1YSOUVWPpAhLBRekkTiyTK3xGwsoxY2mJeHR8NGFw,1332
17
+ examples/crewai_example/simple_agent/tasks.py,sha256=JG5kPc9uBkZIDJCp0j3eporf6gnrKG3GZR5edHoeoxw,832
18
18
  examples/crewai_example/trip_planner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  examples/crewai_example/trip_planner/agents.py,sha256=bSmtD83qcB3PF21zjqdvAYe0vVvl0nhGVXX5oPeSGY8,2371
20
- examples/crewai_example/trip_planner/main.py,sha256=Ju001KRksiH1Svu6p83CfTybAPq9hruJVH9p3BmtG_c,2623
20
+ examples/crewai_example/trip_planner/main.py,sha256=dwEh60RABqaBodhkPr3lB7KS83f74WqaBjRB8YEO_jM,2056
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
23
23
  examples/crewai_example/trip_planner/tools/search_tools.py,sha256=p8qZe_bi45OjBwiwwrH0lhTaQI_ZiLThSTEEN5dWxF0,2700
@@ -26,6 +26,7 @@ examples/dspy_example/math_problems_cot_parallel.py,sha256=5clw-IIVA0mWm0N0xWNDM
26
26
  examples/dspy_example/program_of_thought_basic.py,sha256=oEbtJdeKENMUbex25-zyStWwurRWW6OdP0KDs-jUkko,984
27
27
  examples/dspy_example/quiz_gen.py,sha256=OyGhepeX8meKOtLdmlYUjMD2ECk-ZQuQXUZif1hFQY4,3371
28
28
  examples/dspy_example/react.py,sha256=APAnHqgy9w-qY5jnPD_WbBx6bwo9C-DhPnUuhL-t7sg,1376
29
+ examples/embedchain_example/simple.py,sha256=1lwnsh5wVjGjQ18OinID6aJ_itR-x0TOngtNU1E-Emc,373
29
30
  examples/fastapi_example/__init__.py,sha256=INIfvJP7zC_KkJCtulS1qbh61-MJTPAHnzAgzeKi0yU,87
30
31
  examples/fastapi_example/basic_route.py,sha256=_IRXjkOtJQ-bTIGa1WbvUF_2LF4bjghjyXt4YrHaRvw,1170
31
32
  examples/gemini_example/__init__.py,sha256=omVgLyIiLc3c0zwy3vTtYKdeenYEXzEbLZsYiPEvJT4,81
@@ -78,15 +79,16 @@ examples/vertexai_example/main.py,sha256=gndId5X5ksD-ycxnAWMdEqIDbLc3kz5Vt8vm4YP
78
79
  examples/weaviate_example/__init__.py,sha256=8JMDBsRSEV10HfTd-YC7xb4txBjD3la56snk-Bbg2Kw,618
79
80
  examples/weaviate_example/query_text.py,sha256=wPHQTc_58kPoKTZMygVjTj-2ZcdrIuaausJfMxNQnQc,127162
80
81
  langtrace_python_sdk/__init__.py,sha256=VZM6i71NR7pBQK6XvJWRelknuTYUhqwqE7PlicKa5Wg,1166
81
- langtrace_python_sdk/langtrace.py,sha256=NOS2ws7P1Voc-zYSdO_mVb-Kea9_nD5Jq1dXY2CS97k,8208
82
- langtrace_python_sdk/version.py,sha256=3SFezL1kOpXZvo2YIaWEZ3PTHx1NRXGjgE666GlUfQE,23
82
+ langtrace_python_sdk/langtrace.py,sha256=QNqnla5gQhWLDS6-kXPGV-MnqNDp0BQ4zdbkWI8sC50,8290
83
+ langtrace_python_sdk/version.py,sha256=CpK8IH_dCUAwg9tqv7zm9FxbBFkxCnED1JUiRe7cftU,22
83
84
  langtrace_python_sdk/constants/__init__.py,sha256=P8QvYwt5czUNDZsKS64vxm9Dc41ptGbuF1TFtAF6nv4,44
84
85
  langtrace_python_sdk/constants/exporter/langtrace_exporter.py,sha256=5MNjnAOg-4am78J3gVMH6FSwq5N8TOj72ugkhsw4vi0,46
85
86
  langtrace_python_sdk/constants/instrumentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
86
87
  langtrace_python_sdk/constants/instrumentation/anthropic.py,sha256=YX3llt3zwDY6XrYk3CB8WEVqgrzRXEw_ffyk56JoF3k,126
87
88
  langtrace_python_sdk/constants/instrumentation/chroma.py,sha256=hiPGYdHS0Yj4Kh3eaYBbuCAl_swqIygu80yFqkOgdak,955
88
89
  langtrace_python_sdk/constants/instrumentation/cohere.py,sha256=tf9sDfb5K3qOAHChEE5o8eYWPZ1io58VsOjZDCZPxfw,577
89
- langtrace_python_sdk/constants/instrumentation/common.py,sha256=MVNN-ySaIUqGXH5ne9Gq-_hwg29hmxYz5dhADP2lp7Y,961
90
+ langtrace_python_sdk/constants/instrumentation/common.py,sha256=dbqpfFpkchXn5aNQp07N5emNvsJHiyT6OZA7wIsg4T8,993
91
+ langtrace_python_sdk/constants/instrumentation/embedchain.py,sha256=HodCJvaFjILoOG50OwFObxfVxt_8VUaIAIqvgoN3tzo,278
90
92
  langtrace_python_sdk/constants/instrumentation/gemini.py,sha256=UAmfgg9FM7uNeOCdPfWlir6OIH-8BoxFGPRpdBd9ZZs,358
91
93
  langtrace_python_sdk/constants/instrumentation/groq.py,sha256=VFXmIl4aqGY_fS0PAmjPj_Qm7Tibxbx7Ur_e7rQpqXc,134
92
94
  langtrace_python_sdk/constants/instrumentation/mistral.py,sha256=9PlmcC5P5_BHJ-zsX1xekht6rSm7arTin58HAfdYvLk,730
@@ -99,22 +101,25 @@ langtrace_python_sdk/constants/instrumentation/weaviate.py,sha256=gtv-JBxvNGClEM
99
101
  langtrace_python_sdk/extensions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
100
102
  langtrace_python_sdk/extensions/langtrace_exporter.py,sha256=2ausFBC9JIitnpu1yECPCL0SXg_IvJTQL0MMsuidTo4,4700
101
103
  langtrace_python_sdk/extensions/langtrace_filesystem.py,sha256=34fZutG28EJ66l67OvTGsydAH3ZpXgikdE7hVLqBpG4,7863
102
- langtrace_python_sdk/instrumentation/__init__.py,sha256=BgY4bXGiVEHgpiRq5_OF4w-wqZCC46SBrEBbNO2EzWs,1465
104
+ langtrace_python_sdk/instrumentation/__init__.py,sha256=bkyxh6lq_6dgCdbBseFQEbejRTLZv4s9nLBfNSqL6lk,1548
103
105
  langtrace_python_sdk/instrumentation/anthropic/__init__.py,sha256=donrurJAGYlxrSRA3BIf76jGeUcAx9Tq8CVpah68S0Y,101
104
106
  langtrace_python_sdk/instrumentation/anthropic/instrumentation.py,sha256=-srgE8qumAn0ulQYZxMa8ch-9IBH0XgBW_rfEnGk6LI,1684
105
107
  langtrace_python_sdk/instrumentation/anthropic/patch.py,sha256=i_94sJXURVgKIUVKJ3mMqZydWtlv5BlIRqQEk8utrL4,4546
106
108
  langtrace_python_sdk/instrumentation/chroma/__init__.py,sha256=pNZ5UO8Q-d5VkXSobBf79reB6AmEl_usnnTp5Itv818,95
107
109
  langtrace_python_sdk/instrumentation/chroma/instrumentation.py,sha256=nT6PS6bsrIOO9kLV5GuUeRjMe6THHHAZGvqWBP1dYog,1807
108
- langtrace_python_sdk/instrumentation/chroma/patch.py,sha256=1jCbyum11ifbQFLO43eg0yW33Yc7NI_fwhRf1gspHcM,9087
110
+ langtrace_python_sdk/instrumentation/chroma/patch.py,sha256=jYcqBeu-0cYA29PO880oXYRwYh-R1oseXmzfK6UDBps,9074
109
111
  langtrace_python_sdk/instrumentation/cohere/__init__.py,sha256=sGUSLdTUyYf36Tm6L5jQflhzCqvmWrhnBOMYHjvp6Hs,95
110
112
  langtrace_python_sdk/instrumentation/cohere/instrumentation.py,sha256=YQFHZIBd7SSPD4b6Va-ZR0thf_AuBCqj5yzHLHJVWnM,2121
111
113
  langtrace_python_sdk/instrumentation/cohere/patch.py,sha256=Yb0OwxO4gG-WBfGhTFrwUUJEgpnRlyWI_FZveA4T1QU,20972
112
114
  langtrace_python_sdk/instrumentation/crewai/__init__.py,sha256=_UBKfvQv7l0g2_wnmA5F6CdSAFH0atNOVPd49zsN3aM,88
113
- langtrace_python_sdk/instrumentation/crewai/instrumentation.py,sha256=q07x6nnig9JPxDT6ZylyIShfXWjNafKBetnNcA1UdEU,1836
114
- langtrace_python_sdk/instrumentation/crewai/patch.py,sha256=4W7jEIJX4SJNViPlFTBJdSkvvPVJoI76Bb5DX673Ql8,6203
115
+ langtrace_python_sdk/instrumentation/crewai/instrumentation.py,sha256=tMzynrc1TGBM1Yq2psyOmRlJQdOKyJkl3WxFlUNF54E,1841
116
+ langtrace_python_sdk/instrumentation/crewai/patch.py,sha256=OLGD5UPE4YhuKGi22iytPOgq4S4ojW7hm0mmQFjmn5U,8382
115
117
  langtrace_python_sdk/instrumentation/dspy/__init__.py,sha256=tM1srfi_QgyCzrde4izojMrRq2Wm7Dj5QUvVQXIJzkk,84
116
118
  langtrace_python_sdk/instrumentation/dspy/instrumentation.py,sha256=o8URiDvCbZ8LL0I-4xKHkn_Ms2sETBRpn-gOliv3xzQ,2929
117
119
  langtrace_python_sdk/instrumentation/dspy/patch.py,sha256=E2P3MJBQ71or4M6BsvZOwYFtJK1UdTsYkdxVj9fSWPs,9869
120
+ langtrace_python_sdk/instrumentation/embedchain/__init__.py,sha256=5L6n8-brMnRWZ0CMmHEuN1mrhIxrYLNtxRy0Ujc-hOY,103
121
+ langtrace_python_sdk/instrumentation/embedchain/instrumentation.py,sha256=dShwm0duy25IvL7g9I_v-2oYuyh2fadeiJqXtXBay-8,1987
122
+ langtrace_python_sdk/instrumentation/embedchain/patch.py,sha256=9Lt_XcBaOrazXn9AMl5azfOuEQR6DK8v0zjwtUEFpi4,3370
118
123
  langtrace_python_sdk/instrumentation/gemini/__init__.py,sha256=ilWmKA4Li-g3DX6R10WQ4v-51VljxToEnJpOQoQB5uQ,88
119
124
  langtrace_python_sdk/instrumentation/gemini/instrumentation.py,sha256=eGWr2dy1f_9TVZiXSH_MlNQINyS4I28EsOTKREdMVio,1304
120
125
  langtrace_python_sdk/instrumentation/gemini/patch.py,sha256=Zedp4bZH3-45LOaieSGyoTffgWJjqLs1YCDwM53v2CI,6228
@@ -209,8 +214,8 @@ tests/pinecone/cassettes/test_query.yaml,sha256=b5v9G3ssUy00oG63PlFUR3JErF2Js-5A
209
214
  tests/pinecone/cassettes/test_upsert.yaml,sha256=neWmQ1v3d03V8WoLl8FoFeeCYImb8pxlJBWnFd_lITU,38607
210
215
  tests/qdrant/conftest.py,sha256=9n0uHxxIjWk9fbYc4bx-uP8lSAgLBVx-cV9UjnsyCHM,381
211
216
  tests/qdrant/test_qdrant.py,sha256=pzjAjVY2kmsmGfrI2Gs2xrolfuaNHz7l1fqGQCjp5_o,3353
212
- langtrace_python_sdk-2.2.30.dist-info/METADATA,sha256=wupH7hIM1_hYrQHGpFOvcBwUnty3iiLnGKGt2ziNaDQ,14880
213
- langtrace_python_sdk-2.2.30.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
214
- langtrace_python_sdk-2.2.30.dist-info/entry_points.txt,sha256=1_b9-qvf2fE7uQNZcbUei9vLpFZBbbh9LrtGw95ssAo,70
215
- langtrace_python_sdk-2.2.30.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
216
- langtrace_python_sdk-2.2.30.dist-info/RECORD,,
217
+ langtrace_python_sdk-2.3.0.dist-info/METADATA,sha256=WlnTZh0bSEazqjPLsuWM3KbpiifmbNKXOjRpkEdXOFI,15011
218
+ langtrace_python_sdk-2.3.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
219
+ langtrace_python_sdk-2.3.0.dist-info/entry_points.txt,sha256=1_b9-qvf2fE7uQNZcbUei9vLpFZBbbh9LrtGw95ssAo,70
220
+ langtrace_python_sdk-2.3.0.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
221
+ langtrace_python_sdk-2.3.0.dist-info/RECORD,,