langtrace-python-sdk 2.0.12__py3-none-any.whl → 2.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. examples/pinecone_example/basic.py +7 -2
  2. examples/weaviate_example/query_text.py +1737 -0
  3. langtrace_python_sdk/__init__.py +7 -1
  4. langtrace_python_sdk/constants/instrumentation/common.py +1 -0
  5. langtrace_python_sdk/constants/instrumentation/weaviate.py +44 -0
  6. langtrace_python_sdk/instrumentation/chroma/patch.py +191 -0
  7. langtrace_python_sdk/instrumentation/openai/patch.py +1 -0
  8. langtrace_python_sdk/instrumentation/pinecone/patch.py +1 -0
  9. langtrace_python_sdk/instrumentation/qdrant/patch.py +28 -4
  10. langtrace_python_sdk/instrumentation/weaviate/__init__.py +0 -0
  11. langtrace_python_sdk/instrumentation/weaviate/instrumentation.py +66 -0
  12. langtrace_python_sdk/instrumentation/weaviate/patch.py +166 -0
  13. langtrace_python_sdk/langtrace.py +4 -0
  14. langtrace_python_sdk/types/__init__.py +1 -0
  15. langtrace_python_sdk/utils/__init__.py +0 -2
  16. langtrace_python_sdk/utils/llm.py +0 -1
  17. langtrace_python_sdk/utils/misc.py +30 -0
  18. langtrace_python_sdk/utils/types.py +19 -0
  19. langtrace_python_sdk/utils/with_root_span.py +99 -4
  20. langtrace_python_sdk/version.py +1 -1
  21. {langtrace_python_sdk-2.0.12.dist-info → langtrace_python_sdk-2.1.0.dist-info}/METADATA +30 -15
  22. {langtrace_python_sdk-2.0.12.dist-info → langtrace_python_sdk-2.1.0.dist-info}/RECORD +28 -22
  23. tests/cohere/cassettes/test_cohere_chat.yaml +19 -21
  24. tests/cohere/cassettes/test_cohere_chat_streaming.yaml +73 -135
  25. tests/cohere/cassettes/test_cohere_embed.yaml +9 -9
  26. tests/cohere/cassettes/test_cohere_rerank.yaml +8 -8
  27. {langtrace_python_sdk-2.0.12.dist-info → langtrace_python_sdk-2.1.0.dist-info}/WHEEL +0 -0
  28. {langtrace_python_sdk-2.0.12.dist-info → langtrace_python_sdk-2.1.0.dist-info}/licenses/LICENSE +0 -0
@@ -7,7 +7,8 @@ from dotenv import find_dotenv, load_dotenv
7
7
  from openai import OpenAI
8
8
  from pinecone import Pinecone
9
9
 
10
- from langtrace_python_sdk.utils.with_root_span import with_langtrace_root_span
10
+
11
+ from langtrace_python_sdk import with_langtrace_root_span, send_user_feedback
11
12
 
12
13
  _ = load_dotenv(find_dotenv())
13
14
 
@@ -18,7 +19,8 @@ pinecone = Pinecone()
18
19
 
19
20
 
20
21
  @with_langtrace_root_span()
21
- def basic():
22
+ def basic(span_id, trace_id):
23
+
22
24
  result = client.embeddings.create(
23
25
  model="text-embedding-ada-002",
24
26
  input="Some random text string goes here",
@@ -37,4 +39,7 @@ def basic():
37
39
  resp = index.query(
38
40
  vector=embedding, top_k=1, include_values=False, namespace="test-namespace"
39
41
  )
42
+ send_user_feedback(
43
+ {"spanId": span_id, "traceId": trace_id, "userScore": 1, "userId": "123"}
44
+ )
40
45
  print(resp)