langtrace-python-sdk 2.1.13__py3-none-any.whl → 2.1.15__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 (36) hide show
  1. examples/__init__.py +1 -0
  2. examples/anthropic_example/__init__.py +8 -0
  3. examples/anthropic_example/completion.py +1 -2
  4. examples/chroma_example/__init__.py +8 -1
  5. examples/chroma_example/basic.py +1 -1
  6. examples/cohere_example/__init__.py +17 -0
  7. examples/cohere_example/chat.py +1 -1
  8. examples/cohere_example/chat_stream.py +1 -1
  9. examples/cohere_example/embed.py +1 -1
  10. examples/cohere_example/rerank.py +1 -1
  11. examples/cohere_example/tools.py +1 -1
  12. examples/fastapi_example/__init__.py +6 -0
  13. examples/fastapi_example/basic_route.py +2 -0
  14. examples/langchain_example/__init__.py +10 -0
  15. examples/langchain_example/basic.py +3 -3
  16. examples/llamaindex_example/__init__.py +11 -0
  17. examples/llamaindex_example/agent.py +4 -3
  18. examples/llamaindex_example/basic.py +2 -2
  19. examples/openai_example/__init__.py +21 -0
  20. examples/openai_example/async_tool_calling_nonstreaming.py +3 -3
  21. examples/openai_example/async_tool_calling_streaming.py +2 -1
  22. examples/openai_example/chat_completion.py +3 -3
  23. examples/openai_example/embeddings_create.py +2 -2
  24. examples/openai_example/function_calling.py +3 -2
  25. examples/openai_example/images_edit.py +2 -2
  26. examples/pinecone_example/__init__.py +9 -0
  27. examples/pinecone_example/basic.py +7 -2
  28. examples/qdrant_example/__init__.py +8 -0
  29. examples/weaviate_example/__init__.py +26 -0
  30. examples/weaviate_example/query_text.py +12 -8
  31. langtrace_python_sdk/__init__.py +6 -1
  32. langtrace_python_sdk/version.py +1 -1
  33. {langtrace_python_sdk-2.1.13.dist-info → langtrace_python_sdk-2.1.15.dist-info}/METADATA +10 -9
  34. {langtrace_python_sdk-2.1.13.dist-info → langtrace_python_sdk-2.1.15.dist-info}/RECORD +36 -34
  35. {langtrace_python_sdk-2.1.13.dist-info → langtrace_python_sdk-2.1.15.dist-info}/WHEEL +0 -0
  36. {langtrace_python_sdk-2.1.13.dist-info → langtrace_python_sdk-2.1.15.dist-info}/licenses/LICENSE +0 -0
examples/__init__.py CHANGED
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,8 @@
1
+ from examples.anthropic_example.completion import messages_create
2
+ from langtrace_python_sdk import with_langtrace_root_span
3
+
4
+
5
+ class AnthropicRunner:
6
+ @with_langtrace_root_span("Anthropic")
7
+ def run(self):
8
+ messages_create()
@@ -7,12 +7,11 @@ from langtrace_python_sdk import langtrace, with_langtrace_root_span
7
7
 
8
8
  _ = load_dotenv(find_dotenv())
9
9
 
10
- langtrace.init(write_spans_to_console=True)
10
+ langtrace.init()
11
11
 
12
12
 
13
13
  @with_langtrace_root_span("messages_create")
14
14
  def messages_create():
15
-
16
15
  client = anthropic.Anthropic()
17
16
 
18
17
  message = client.messages.create(
@@ -1 +1,8 @@
1
- from .basic import basic
1
+ from examples.chroma_example.basic import basic
2
+ from langtrace_python_sdk import with_langtrace_root_span
3
+
4
+
5
+ class ChromaRunner:
6
+ @with_langtrace_root_span("Chroma")
7
+ def run(self):
8
+ basic()
@@ -7,7 +7,7 @@ from langtrace_python_sdk.utils.with_root_span import with_langtrace_root_span
7
7
 
8
8
  _ = load_dotenv(find_dotenv())
9
9
 
10
- langtrace.init(write_spans_to_console=True)
10
+ langtrace.init(write_spans_to_console=False)
11
11
 
12
12
 
13
13
  @with_langtrace_root_span()
@@ -0,0 +1,17 @@
1
+ from examples.cohere_example.chat import chat_comp
2
+ from examples.cohere_example.chat_stream import chat_stream
3
+ from examples.cohere_example.tools import tool_calling
4
+ from examples.cohere_example.embed import embed
5
+ from examples.cohere_example.rerank import rerank
6
+ from langtrace_python_sdk import with_langtrace_root_span
7
+
8
+
9
+ class CohereRunner:
10
+
11
+ @with_langtrace_root_span("Cohere")
12
+ def run(self):
13
+ chat_comp()
14
+ chat_stream()
15
+ tool_calling()
16
+ embed()
17
+ rerank()
@@ -7,7 +7,7 @@ from langtrace_python_sdk import langtrace
7
7
 
8
8
  _ = load_dotenv(find_dotenv())
9
9
 
10
- langtrace.init(write_spans_to_console=True)
10
+ langtrace.init()
11
11
 
12
12
 
13
13
  co = cohere.Client()
@@ -5,7 +5,7 @@ from langtrace_python_sdk import langtrace
5
5
 
6
6
  _ = load_dotenv(find_dotenv())
7
7
 
8
- langtrace.init(write_spans_to_console=True)
8
+ langtrace.init()
9
9
 
10
10
 
11
11
  co = cohere.Client()
@@ -7,7 +7,7 @@ from langtrace_python_sdk import langtrace
7
7
 
8
8
  _ = load_dotenv(find_dotenv())
9
9
 
10
- langtrace.init(write_spans_to_console=True)
10
+ langtrace.init()
11
11
 
12
12
 
13
13
  co = cohere.Client()
@@ -7,7 +7,7 @@ from langtrace_python_sdk import langtrace
7
7
 
8
8
  _ = load_dotenv(find_dotenv())
9
9
 
10
- langtrace.init(write_spans_to_console=True)
10
+ langtrace.init()
11
11
 
12
12
 
13
13
  co = cohere.Client()
@@ -7,7 +7,7 @@ from langtrace_python_sdk import langtrace
7
7
 
8
8
  _ = load_dotenv(find_dotenv())
9
9
 
10
- langtrace.init(write_spans_to_console=True)
10
+ langtrace.init()
11
11
 
12
12
  co = cohere.Client()
13
13
 
@@ -0,0 +1,6 @@
1
+ from .basic_route import root
2
+
3
+
4
+ class FastAPIRunner:
5
+ def run(self):
6
+ root()
@@ -7,7 +7,9 @@ from langchain_openai import ChatOpenAI, OpenAIEmbeddings
7
7
  from openai import OpenAI
8
8
 
9
9
  from langtrace_python_sdk import langtrace
10
+ from dotenv import load_dotenv
10
11
 
12
+ load_dotenv()
11
13
  langtrace.init(write_spans_to_console=True)
12
14
  app = FastAPI()
13
15
  client = OpenAI()
@@ -0,0 +1,10 @@
1
+ from .basic import basic_app, rag, load_and_split
2
+ from langtrace_python_sdk import with_langtrace_root_span
3
+
4
+
5
+ class LangChainRunner:
6
+ @with_langtrace_root_span("LangChain")
7
+ def run(self):
8
+ basic_app()
9
+ rag()
10
+ load_and_split()
@@ -18,7 +18,7 @@ _ = load_dotenv(find_dotenv())
18
18
  langtrace.init()
19
19
 
20
20
 
21
- @with_additional_attributes({"user.id": "1234", "user.feedback.rating": 1})
21
+ # @with_additional_attributes({"user.id": "1234", "user.feedback.rating": 1})
22
22
  def api_call_1():
23
23
  llm = ChatOpenAI()
24
24
  prompt = ChatPromptTemplate.from_messages(
@@ -33,7 +33,7 @@ def api_call_1():
33
33
  print(res)
34
34
 
35
35
 
36
- @with_additional_attributes({"user.id": "37373", "user.feedback.rating": 1})
36
+ # @with_additional_attributes({"user.id": "37373", "user.feedback.rating": 1})
37
37
  def api_call_2():
38
38
  llm = ChatOpenAI()
39
39
  prompt = ChatPromptTemplate.from_messages(
@@ -49,7 +49,7 @@ def api_call_2():
49
49
 
50
50
 
51
51
  @with_langtrace_root_span()
52
- def basic():
52
+ def basic_app():
53
53
  api_call_1()
54
54
  api_call_2()
55
55
 
@@ -0,0 +1,11 @@
1
+ from langtrace_python_sdk import with_langtrace_root_span
2
+
3
+
4
+ class LlamaIndexRunner:
5
+ @with_langtrace_root_span("LlamaIndex")
6
+ def run(self):
7
+ from .basic import basic_app
8
+ from .agent import main
9
+
10
+ basic_app()
11
+ main()
@@ -12,7 +12,7 @@ import nest_asyncio
12
12
 
13
13
  nest_asyncio.apply()
14
14
 
15
- langtrace.init(write_spans_to_console=True)
15
+ langtrace.init(write_spans_to_console=False)
16
16
 
17
17
 
18
18
  def multiply(a: int, b: int) -> int:
@@ -82,5 +82,6 @@ class YourOpenAIAgent:
82
82
 
83
83
 
84
84
  # agent = YourOpenAIAgent(tools=[multiply_tool, add_tool])
85
- llm = OpenAI(model="gpt-3.5-turbo-0613")
86
- agent = OpenAIAgent.from_tools([multiply_tool, add_tool], llm=llm, verbose=True)
85
+ def main():
86
+ llm = OpenAI(model="gpt-3.5-turbo-0613")
87
+ agent = OpenAIAgent.from_tools([multiply_tool, add_tool], llm=llm, verbose=True)
@@ -7,11 +7,11 @@ from langtrace_python_sdk.utils.with_root_span import with_langtrace_root_span
7
7
  _ = load_dotenv(find_dotenv())
8
8
 
9
9
 
10
- langtrace.init(write_spans_to_console=True)
10
+ langtrace.init(write_spans_to_console=False)
11
11
 
12
12
 
13
13
  @with_langtrace_root_span()
14
- def basic():
14
+ def basic_app():
15
15
  documents = SimpleDirectoryReader(
16
16
  "src/examples/llamaindex_example/data"
17
17
  ).load_data()
@@ -0,0 +1,21 @@
1
+ from langtrace_python_sdk import with_langtrace_root_span
2
+
3
+
4
+ class OpenAIRunner:
5
+ @with_langtrace_root_span("OpenAI")
6
+ def run(self):
7
+ import asyncio
8
+ from .async_tool_calling_nonstreaming import run_conversation
9
+ from .async_tool_calling_streaming import (
10
+ run_conversation as run_conversation_streaming,
11
+ )
12
+ from .chat_completion import chat_completion as chat_completion_example
13
+ from .embeddings_create import embeddings_create as embeddings_create_example
14
+ from .function_calling import function_calling as function_example
15
+ from .images_edit import image_edit
16
+
17
+ asyncio.run(run_conversation())
18
+ asyncio.run(run_conversation_streaming())
19
+ chat_completion_example()
20
+ embeddings_create_example()
21
+ function_example()
@@ -3,13 +3,12 @@ import json
3
3
  from dotenv import find_dotenv, load_dotenv
4
4
  from openai import AsyncOpenAI
5
5
 
6
- from langtrace_python_sdk import langtrace
6
+ from langtrace_python_sdk import langtrace, with_langtrace_root_span
7
7
 
8
- # from langtrace_python_sdk.utils.with_root_span import with_langtrace_root_span
9
8
 
10
9
  _ = load_dotenv(find_dotenv())
11
10
 
12
- langtrace.init(write_spans_to_console=True)
11
+ langtrace.init()
13
12
 
14
13
  client = AsyncOpenAI()
15
14
 
@@ -30,6 +29,7 @@ def get_current_weather(location, unit="fahrenheit"):
30
29
  return json.dumps({"location": location, "temperature": "unknown"})
31
30
 
32
31
 
32
+ @with_langtrace_root_span("Run Conversation")
33
33
  async def run_conversation():
34
34
  # Step 1: send the conversation and available functions to the model
35
35
  messages = [
@@ -3,7 +3,7 @@ import json
3
3
  from dotenv import find_dotenv, load_dotenv
4
4
  from openai import AsyncOpenAI
5
5
 
6
- from langtrace_python_sdk import langtrace
6
+ from langtrace_python_sdk import langtrace, with_langtrace_root_span
7
7
 
8
8
  # from langtrace_python_sdk.utils.with_root_span import with_langtrace_root_span
9
9
 
@@ -42,6 +42,7 @@ def get_current_time(location):
42
42
  return json.dumps({"location": location, "time": "unknown"})
43
43
 
44
44
 
45
+ @with_langtrace_root_span("Run Conversation Streaming")
45
46
  async def run_conversation():
46
47
  # Step 1: send the conversation and available functions to the model
47
48
  messages = [
@@ -9,11 +9,11 @@ from langtrace_python_sdk.utils.with_root_span import (
9
9
 
10
10
  _ = load_dotenv(find_dotenv())
11
11
 
12
- langtrace.init(write_spans_to_console=True)
12
+ langtrace.init(write_spans_to_console=False)
13
13
  client = OpenAI()
14
14
 
15
15
 
16
- # @with_additional_attributes({"user.id": "1234", "user.feedback.rating": 1})
16
+ @with_additional_attributes({"user.id": "1234", "user.feedback.rating": 1})
17
17
  def api():
18
18
  response = client.chat.completions.create(
19
19
  model="gpt-4",
@@ -27,7 +27,7 @@ def api():
27
27
  return response
28
28
 
29
29
 
30
- # @with_langtrace_root_span()
30
+ @with_langtrace_root_span("Chat Completion")
31
31
  def chat_completion():
32
32
  response = api()
33
33
  # print(response)
@@ -6,12 +6,12 @@ from langtrace_python_sdk.utils.with_root_span import with_langtrace_root_span
6
6
 
7
7
  _ = load_dotenv(find_dotenv())
8
8
 
9
- langtrace.init(write_spans_to_console=True)
9
+ langtrace.init(write_spans_to_console=False)
10
10
 
11
11
  client = OpenAI()
12
12
 
13
13
 
14
- @with_langtrace_root_span()
14
+ @with_langtrace_root_span("Embeddings Create")
15
15
  def embeddings_create():
16
16
  result = client.embeddings.create(
17
17
  model="text-embedding-ada-002",
@@ -3,11 +3,11 @@
3
3
  from dotenv import find_dotenv, load_dotenv
4
4
  from openai import OpenAI
5
5
 
6
- from langtrace_python_sdk import langtrace
6
+ from langtrace_python_sdk import langtrace, with_langtrace_root_span
7
7
 
8
8
  _ = load_dotenv(find_dotenv())
9
9
 
10
- langtrace.init(write_spans_to_console=True)
10
+ langtrace.init(write_spans_to_console=False)
11
11
 
12
12
 
13
13
  client = OpenAI()
@@ -34,6 +34,7 @@ student_custom_functions = [
34
34
  ]
35
35
 
36
36
 
37
+ @with_langtrace_root_span("Function Calling")
37
38
  def function_calling():
38
39
  response = client.chat.completions.create(
39
40
  model="gpt-3.5-turbo",
@@ -8,7 +8,7 @@ from langtrace_python_sdk import langtrace
8
8
 
9
9
  _ = load_dotenv(find_dotenv())
10
10
 
11
- langtrace.init(write_spans_to_console=True)
11
+ langtrace.init(write_spans_to_console=False)
12
12
 
13
13
 
14
14
  client = OpenAI()
@@ -36,5 +36,5 @@ def image_edit():
36
36
  print(response)
37
37
 
38
38
 
39
- image_edit()
39
+ # image_edit()
40
40
  # convert_to_rgba()
@@ -0,0 +1,9 @@
1
+ from langtrace_python_sdk import with_langtrace_root_span
2
+
3
+
4
+ class PineconeRunner:
5
+ @with_langtrace_root_span("Pinecone")
6
+ def run(self):
7
+ from .basic import basic as basic_app
8
+
9
+ basic_app()
@@ -6,7 +6,11 @@ from dotenv import find_dotenv, load_dotenv
6
6
  from openai import OpenAI
7
7
  from pinecone import Pinecone, ServerlessSpec
8
8
 
9
- from langtrace_python_sdk import langtrace, with_langtrace_root_span
9
+ from langtrace_python_sdk import (
10
+ langtrace,
11
+ with_langtrace_root_span,
12
+ with_additional_attributes,
13
+ )
10
14
  from langtrace_python_sdk.utils.with_root_span import SendUserFeedback
11
15
 
12
16
  _ = load_dotenv(find_dotenv())
@@ -28,7 +32,8 @@ def create_index():
28
32
  )
29
33
 
30
34
 
31
- @with_langtrace_root_span()
35
+ @with_additional_attributes({"db.embedding_model": "text-embedding-ada-002"})
36
+ @with_langtrace_root_span("Pinecone Basic")
32
37
  def basic(span_id=None, trace_id=None):
33
38
 
34
39
  result = client.embeddings.create(
@@ -0,0 +1,8 @@
1
+ from langtrace_python_sdk import with_langtrace_root_span
2
+ from .basic import basic as basic_app
3
+
4
+
5
+ class QdrantRunner:
6
+ @with_langtrace_root_span("Qdrant")
7
+ def run(self):
8
+ basic_app()
@@ -0,0 +1,26 @@
1
+ from .query_text import (
2
+ create,
3
+ insert,
4
+ query_data_bm25,
5
+ query_fetch_object_by_id,
6
+ query_fetch_objects,
7
+ query_hybrid,
8
+ query_near_object,
9
+ query_data_near_text,
10
+ query_data_near_vector,
11
+ )
12
+ from langtrace_python_sdk import with_langtrace_root_span
13
+
14
+
15
+ class WeaviateRunner:
16
+ @with_langtrace_root_span("Weaviate")
17
+ def run(self):
18
+ create()
19
+ insert()
20
+ query_data_bm25()
21
+ # query_fetch_object_by_id()
22
+ # query_fetch_objects()
23
+ # query_hybrid()
24
+ # query_near_object()
25
+ # query_data_near_text()
26
+ # query_data_near_vector()
@@ -21,7 +21,9 @@ from weaviate.collections.classes.grpc import Move
21
21
 
22
22
  import langtrace_python_sdk.langtrace as langtrace
23
23
  from langtrace_python_sdk import with_langtrace_root_span
24
+ from dotenv import load_dotenv
24
25
 
26
+ load_dotenv()
25
27
  # Set these environment variables
26
28
  WCS_DEMO_URL = os.environ["WCS_DEMO_URL"]
27
29
  WCS_DEMO_RO_KEY = os.environ["WCS_DEMO_RO_KEY"]
@@ -37,17 +39,19 @@ client = weaviate.connect_to_wcs(
37
39
  langtrace.init()
38
40
 
39
41
 
40
- @with_langtrace_root_span()
42
+ @with_langtrace_root_span("create")
41
43
  def create():
42
- questions = client.collections.create(
43
- name="Question",
44
- # Set the vectorizer to "text2vec-openai" to use the OpenAI API for vector-related operations
45
- vectorizer_config=wvc.config.Configure.Vectorizer.text2vec_openai(),
46
- # Ensure the `generative-openai` module is used for generative queries
47
- generative_config=wvc.config.Configure.Generative.openai(),
48
- )
44
+ if not client.collections.get("Question"):
45
+ questions = client.collections.create(
46
+ name="Question",
47
+ # Set the vectorizer to "text2vec-openai" to use the OpenAI API for vector-related operations
48
+ vectorizer_config=wvc.config.Configure.Vectorizer.text2vec_openai(),
49
+ # Ensure the `generative-openai` module is used for generative queries
50
+ generative_config=wvc.config.Configure.Generative.openai(),
51
+ )
49
52
 
50
53
 
54
+ @with_langtrace_root_span("insert")
51
55
  def insert():
52
56
  resp = requests.get(
53
57
  "https://raw.githubusercontent.com/weaviate-tutorials/quickstart/main/data/jeopardy_tiny.json"
@@ -15,13 +15,18 @@ limitations under the License.
15
15
  """
16
16
 
17
17
  from langtrace_python_sdk import langtrace
18
- from langtrace_python_sdk.utils.with_root_span import with_langtrace_root_span
18
+ from langtrace_python_sdk.utils.with_root_span import (
19
+ with_langtrace_root_span,
20
+ with_additional_attributes,
21
+ )
22
+
19
23
  from langtrace_python_sdk.utils.prompt_registry import get_prompt_from_registry
20
24
  from langtrace_python_sdk.utils.with_root_span import SendUserFeedback
21
25
 
22
26
  __all__ = [
23
27
  "langtrace",
24
28
  "with_langtrace_root_span",
29
+ "with_additional_attributes",
25
30
  "get_prompt_from_registry",
26
31
  "SendUserFeedback",
27
32
  ]
@@ -1 +1 @@
1
- __version__ = "2.1.13"
1
+ __version__ = "2.1.15"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: langtrace-python-sdk
3
- Version: 2.1.13
3
+ Version: 2.1.15
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>
@@ -19,7 +19,7 @@ Requires-Dist: opentelemetry-instrumentation>=0.46b0
19
19
  Requires-Dist: opentelemetry-sdk>=1.25.0
20
20
  Requires-Dist: sqlalchemy
21
21
  Requires-Dist: tiktoken>=0.1.1
22
- Requires-Dist: trace-attributes==4.0.5
22
+ Requires-Dist: trace-attributes<6.0.0,>=5.0.0
23
23
  Provides-Extra: dev
24
24
  Requires-Dist: anthropic; extra == 'dev'
25
25
  Requires-Dist: chromadb; extra == 'dev'
@@ -42,7 +42,7 @@ Description-Content-Type: text/markdown
42
42
 
43
43
  ## Open Source & Open Telemetry(OTEL) Observability for LLM applications
44
44
 
45
- ![Static Badge](https://img.shields.io/badge/License-AGPL--3.0-blue) ![Static Badge](https://img.shields.io/badge/npm_@langtrase/typescript--sdk-1.2.9-green) ![Static Badge](https://img.shields.io/badge/pip_langtrace--python--sdk-1.2.8-green) ![Static Badge](https://img.shields.io/badge/Development_status-Active-green)
45
+ ![Static Badge](https://img.shields.io/badge/License-Apache--2.0-blue) ![Static Badge](https://img.shields.io/badge/npm_@langtrase/typescript--sdk-1.2.9-green) ![Static Badge](https://img.shields.io/badge/pip_langtrace--python--sdk-1.2.8-green) ![Static Badge](https://img.shields.io/badge/Development_status-Active-green)
46
46
 
47
47
  ---
48
48
 
@@ -193,7 +193,7 @@ langtrace.init(custom_remote_exporter=<your_exporter>, batch=<True or False>)
193
193
  - `@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.
194
194
 
195
195
  ```python
196
- from langtrace_python_sdk.utils.with_root_span import with_langtrace_root_span
196
+ from langtrace_python_sdk import with_langtrace_root_span
197
197
 
198
198
  @with_langtrace_root_span()
199
199
  def example():
@@ -208,10 +208,8 @@ def example():
208
208
  - `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.
209
209
 
210
210
  ```python
211
- from langtrace_python_sdk.utils.with_root_span import (
212
- with_langtrace_root_span,
213
- with_additional_attributes,
214
- )
211
+ from langtrace_python_sdk import with_langtrace_root_span, with_additional_attributes
212
+
215
213
 
216
214
  @with_additional_attributes({"user.id": "1234", "user.feedback.rating": 1})
217
215
  def api_call1():
@@ -277,6 +275,9 @@ Langtrace automatically captures traces from the following vendors:
277
275
 
278
276
  We welcome contributions to this project. To get started, fork this repository and start developing. To get involved, join our [Discord](https://discord.langtrace.ai) workspace.
279
277
 
278
+ If you want to run any of the examples go to `run_example.py` file, you will find `ENABLED_EXAMPLES`. choose the example you want to run and just toggle the flag to `True` and run the file using `python src/run_example.py`
279
+
280
+
280
281
  ---
281
282
 
282
283
  ## Security
@@ -287,5 +288,5 @@ To report security vulnerabilites, email us at <security@scale3labs.com>. You ca
287
288
 
288
289
  ## License
289
290
 
290
- - Langtrace application(this repository) is [licensed](https://github.com/Scale3-Labs/langtrace/blob/development/LICENSE) under the AGPL 3.0 License. You can read about this license [here](https://www.gnu.org/licenses/agpl-3.0.en.html).
291
+ - Langtrace application is [licensed](https://github.com/Scale3-Labs/langtrace/blob/development/LICENSE) under the AGPL 3.0 License. You can read about this license [here](https://www.gnu.org/licenses/agpl-3.0.en.html).
291
292
  - Langtrace SDKs are licensed under the Apache 2.0 License. You can read about this license [here](https://www.apache.org/licenses/LICENSE-2.0).
@@ -1,32 +1,33 @@
1
- examples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- examples/anthropic_example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- examples/anthropic_example/completion.py,sha256=PVxAth2vqbX_QN2DGVOt2mTGuUiGk4O5w7RFhHzsxA8,714
4
- examples/chroma_example/__init__.py,sha256=Tq6pae7fHA7dwuDslabB5MTNedL21gu2RaZicpxSyLU,25
5
- examples/chroma_example/basic.py,sha256=qngW9EQtIeuBFjyWdPPiJAE1xnVimKqkglJQz9cqueM,867
6
- examples/cohere_example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- examples/cohere_example/chat.py,sha256=0iNVE3sxX6fZBSRozzx9a8M7HI4QtP1BIjNguBO32rw,915
8
- examples/cohere_example/chat_stream.py,sha256=9hT5whG_W002jxHSXgpQR6imaoQJ10ydte3cFuXc8fE,638
9
- examples/cohere_example/embed.py,sha256=9yNyl2_aJun-0n1v4B_H6PlCeO7LQDIuMagRzwC3OWs,523
10
- examples/cohere_example/rerank.py,sha256=Zy1H7TwXHOGulYAMkfOe-hB0YmJIfwfPurYxj__l_98,1145
11
- examples/cohere_example/tools.py,sha256=I_uCDHQiLRD4uCmeXRUTYNtTgO_efy809Pik1j-Usfw,1683
12
- examples/fastapi_example/basic_route.py,sha256=VXb9r8usZRqQOwS4bzonsP0jFYhvfZecbK8zYcOxAl4,1125
1
+ examples/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
2
+ examples/anthropic_example/__init__.py,sha256=03us1YuvAJR6fqXX8NH2kROBfTmyz7KzFVY01UlL-tM,237
3
+ examples/anthropic_example/completion.py,sha256=LXcuXxRx9hy4b9Woq0aCBx_PS0QYmYi2bT2N96CgS_Q,686
4
+ examples/chroma_example/__init__.py,sha256=Mrf8KptW1hhzu6WDdRRTxbaB-0kM7x5u-Goc_zR7G5c,203
5
+ examples/chroma_example/basic.py,sha256=oO7-__8HptnFXLVKbnPgoz02yM-CAPi721xsbUb_gYg,868
6
+ examples/cohere_example/__init__.py,sha256=oYpsnS-dKOlWLkPEUWhXxi1vfxa77bt_DOdkJHg__7g,502
7
+ examples/cohere_example/chat.py,sha256=1CPrqr45UmhByxAn9on0L06ixVqS3jc9tLT88pduTzw,888
8
+ examples/cohere_example/chat_stream.py,sha256=daWGrj2yucN9sWKGiPzTw18clh23Grv-MIJT_OpUkpA,611
9
+ examples/cohere_example/embed.py,sha256=p9BJvOg09JVb8BfTCb63v3uh_wOsi_OyrCAJdXXrE6E,496
10
+ examples/cohere_example/rerank.py,sha256=e7OU0A2FzfiQDuOmCy3Kg5LLNYGRmRIK5LqeLnTWlP4,1118
11
+ examples/cohere_example/tools.py,sha256=a5uvS058tcwU6PJbF9EDO6LPVmPj2LoW4Vn8Web3Iq8,1656
12
+ examples/fastapi_example/__init__.py,sha256=INIfvJP7zC_KkJCtulS1qbh61-MJTPAHnzAgzeKi0yU,87
13
+ examples/fastapi_example/basic_route.py,sha256=_IRXjkOtJQ-bTIGa1WbvUF_2LF4bjghjyXt4YrHaRvw,1170
13
14
  examples/hiveagent_example/basic.py,sha256=Sd7I5w8w5Xx7ODaydTY30yiq9HwJDMKHQywrZjgehP0,441
14
- examples/langchain_example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- examples/langchain_example/basic.py,sha256=mSVcE-Kx7jNS4U_zrm5WZI98xyw6WTrhd2GMVGgn9Cg,2653
15
+ examples/langchain_example/__init__.py,sha256=t28923ZDDejZabsvINnYwpLyb63WFwPde-Nmzdg-kH4,254
16
+ examples/langchain_example/basic.py,sha256=988C40-bcMq-AM7xL_4v6FHgYliQL1SJM_YcLY-3WMM,2661
16
17
  examples/langchain_example/groq_example.py,sha256=9dBbOWZCVJ29PpB1NbJhc9MThmtwrlOpdNIxPl7d8f8,787
17
18
  examples/langchain_example/langgraph_example.py,sha256=7C2a4Sg0PKbbab03CVkStO3MzT7C-O1UtdmObvBXurM,2005
18
19
  examples/langchain_example/tool.py,sha256=8T8_IDbgA58XbsfyH5_xhA8ZKQfyfyFxF8wor-PsRjA,2556
19
- examples/llamaindex_example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
- examples/llamaindex_example/agent.py,sha256=41uxHpMKqIB4irD8YHu6Y0QI3pDfz79huUHroQwhfDA,2774
21
- examples/llamaindex_example/basic.py,sha256=kcl2RykIzq1Lv9KePzp_TCcdp_PFXxt3vsspb5p-5HI,651
20
+ examples/llamaindex_example/__init__.py,sha256=4w8Hz5pfmMzhkHAbBim6jwxHxMicaN4xi1Of9pODO8g,252
21
+ examples/llamaindex_example/agent.py,sha256=AukhBJwPC5_KFYQrDbEE00c-_6Yt2SCPZHii5B3mh-o,2795
22
+ examples/llamaindex_example/basic.py,sha256=bDp2TlnfzviS9wi6ox-vfPo3e79QuStHD0sJJQXr_w0,656
22
23
  examples/llamaindex_example/data/abramov.txt,sha256=Ou-GyWZm5AjHLgxviBoRE9ikNv5MScsF0cd--0vVVhI,32667
23
- examples/openai_example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
- examples/openai_example/async_tool_calling_nonstreaming.py,sha256=7mP6Anonj7B8owPBfbhxyux4mdgp3XCuym1xAx6SLls,3874
25
- examples/openai_example/async_tool_calling_streaming.py,sha256=PQMHSWAN1DfgjK88b8LVSredmov0uH9Fgn1FHoCVv1M,7054
26
- examples/openai_example/chat_completion.py,sha256=f2rMHJU1Dph_fAOv9qCksvtldl1s9UitEeLsvyoSpGA,1253
27
- examples/openai_example/embeddings_create.py,sha256=d05rArTWxsmCxOdTRaGw3n9Yt1HXxOHHCtciCHIwBGc,502
28
- examples/openai_example/function_calling.py,sha256=rrnrFw2HyV_gv4TdwUr299baP4tIupz6EQWWmLDtJkU,2265
29
- examples/openai_example/images_edit.py,sha256=8GJac6PRn0TLfUSV5dVAZ0twoti4Ogq0sEGxTdxlU44,884
24
+ examples/openai_example/__init__.py,sha256=6l2FePb3vYBJVwIT4qfdtOLobKLZ6iO16Fe31TUwNz8,827
25
+ examples/openai_example/async_tool_calling_nonstreaming.py,sha256=FhbDX91RLhTrNd5IGPI0CxRdCjTRcNLlWkYdLqHGbVs,3838
26
+ examples/openai_example/async_tool_calling_streaming.py,sha256=LaSKmn_Unv55eTHXYdEmKjo39eNuB3ASOBV-m8U1HfU,7136
27
+ examples/openai_example/chat_completion.py,sha256=4JUv8VPcXTfYydCFxPOE3Nb5jYlbzJlvcErB8qmMano,1267
28
+ examples/openai_example/embeddings_create.py,sha256=sqz-zh3pEaB17gVYeY0QE76QxRwsmo6wV8yjAfg1ljg,522
29
+ examples/openai_example/function_calling.py,sha256=zz-JdCcpP7uCXG21EYXF1Y39IKj6gYt2fOP5N_ywpnc,2338
30
+ examples/openai_example/images_edit.py,sha256=0hG5OYTSUBrcwSxbqN67brPYjf1pRJs8vqGzu-UjK6c,887
30
31
  examples/openai_example/images_generate.py,sha256=SZNY8Visk7JUpx5QhNxTNINHmPAGdCUayF-Q7_iCr50,470
31
32
  examples/openai_example/tool_calling.py,sha256=_IV7KoSI_37u1TTZWdVa58BYjkDfhSurvM86xwaNNhY,2316
32
33
  examples/openai_example/tool_calling_nonstreaming.py,sha256=Yc848IooZRXNynHL6z0kOgJ4qbmL_NOufcb2VmWRukI,3847
@@ -34,14 +35,15 @@ examples/openai_example/tool_calling_streaming.py,sha256=mV1RbyAoVhumGRPpqPWQ6PM
34
35
  examples/openai_example/resources/lounge_flamingo.png,sha256=aspniTtmWqwLp3YUhYqAe2ze8nJaq-bTSW7uUJudtd0,2416234
35
36
  examples/openai_example/resources/mask.png,sha256=mUE9Dfp-x8jI0Nh4WGr0P9pueUqEZfpjwxR-6Rxzxz4,2483660
36
37
  examples/perplexity_example/basic.py,sha256=bp7n27gaugJkaFVyt8pjaEfi66lYcqP6eFFjPewUShY,668
37
- examples/pinecone_example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
- examples/pinecone_example/basic.py,sha256=gkb1uQwKFLnWmRuM2KGvAeTpT1AYlHmz2kRey5_-Dqs,1437
39
- examples/qdrant_example/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
+ examples/pinecone_example/__init__.py,sha256=98UBOq9wQdSw6JK7Hfh_AUDVZzL76IAs-kV4sktoDYg,210
39
+ examples/pinecone_example/basic.py,sha256=RpcdCrpNEExad3nmagkF5M211PgNoqu5j_edX8jw2No,1576
40
+ examples/qdrant_example/__init__.py,sha256=Ze9xEzW8FiHUO58YBa8JeHNOwcmo3dpYH77AkdyglKU,197
40
41
  examples/qdrant_example/basic.py,sha256=DCMjHSuBZKkhEjCkwy5d5La9WMyW0lCWqtcZWiFCEm4,1425
41
- examples/weaviate_example/query_text.py,sha256=iE9OiHsibjsprbCGzabE03eZsGN06e6ym2iS1A9P3ig,64650
42
- langtrace_python_sdk/__init__.py,sha256=FuvyRuStRe_N2wo2SB2_ZQ0w7LGNIjV0lLi6S1IgGwY,958
42
+ examples/weaviate_example/__init__.py,sha256=8JMDBsRSEV10HfTd-YC7xb4txBjD3la56snk-Bbg2Kw,618
43
+ examples/weaviate_example/query_text.py,sha256=qz9o-fTDzX5AW5m8BJF-TfmBdokxh492NfnmnPUMU3s,64814
44
+ langtrace_python_sdk/__init__.py,sha256=rted5SGmbbJyqFzT4_Sjfn-Eie2rQwAULa_jMJldAmE,1034
43
45
  langtrace_python_sdk/langtrace.py,sha256=pN-xJRXrtvJIenMOH0-xlNXcnqL9qMjg28SrW-PMRU0,6978
44
- langtrace_python_sdk/version.py,sha256=59WYUQbpJnalweC5r75GQeXXOChhHcCgbKm0CW6XD1M,23
46
+ langtrace_python_sdk/version.py,sha256=844sXOr-u1RlesL29JDG0AmKKXDd3M8Kvx9gXhfWq7Y,23
45
47
  langtrace_python_sdk/constants/__init__.py,sha256=P8QvYwt5czUNDZsKS64vxm9Dc41ptGbuF1TFtAF6nv4,44
46
48
  langtrace_python_sdk/constants/exporter/langtrace_exporter.py,sha256=5MNjnAOg-4am78J3gVMH6FSwq5N8TOj72ugkhsw4vi0,46
47
49
  langtrace_python_sdk/constants/instrumentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -141,7 +143,7 @@ tests/pinecone/cassettes/test_query.yaml,sha256=b5v9G3ssUy00oG63PlFUR3JErF2Js-5A
141
143
  tests/pinecone/cassettes/test_upsert.yaml,sha256=neWmQ1v3d03V8WoLl8FoFeeCYImb8pxlJBWnFd_lITU,38607
142
144
  tests/qdrant/conftest.py,sha256=9n0uHxxIjWk9fbYc4bx-uP8lSAgLBVx-cV9UjnsyCHM,381
143
145
  tests/qdrant/test_qdrant.py,sha256=pzjAjVY2kmsmGfrI2Gs2xrolfuaNHz7l1fqGQCjp5_o,3353
144
- langtrace_python_sdk-2.1.13.dist-info/METADATA,sha256=sYv1f4zRAoiFCz20_lA_anHmpeCEk2y4Tf5OoQck0Wc,11860
145
- langtrace_python_sdk-2.1.13.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
146
- langtrace_python_sdk-2.1.13.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
147
- langtrace_python_sdk-2.1.13.dist-info/RECORD,,
146
+ langtrace_python_sdk-2.1.15.dist-info/METADATA,sha256=XnydQD6bM9d1kjgdpm3CgofpjN9O_Q44GEmaknXBAzA,12023
147
+ langtrace_python_sdk-2.1.15.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
148
+ langtrace_python_sdk-2.1.15.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
149
+ langtrace_python_sdk-2.1.15.dist-info/RECORD,,