langtrace-python-sdk 2.1.14__tar.gz → 2.1.16__tar.gz

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 (154) hide show
  1. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/PKG-INFO +35 -13
  2. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/README.md +34 -12
  3. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/langchain_example/basic.py +0 -2
  4. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/openai_example/chat_completion.py +0 -1
  5. langtrace_python_sdk-2.1.16/src/examples/pinecone_example/__init__.py +16 -0
  6. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/pinecone_example/basic.py +5 -10
  7. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/__init__.py +5 -1
  8. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/utils/with_root_span.py +18 -3
  9. langtrace_python_sdk-2.1.16/src/langtrace_python_sdk/version.py +1 -0
  10. langtrace_python_sdk-2.1.14/src/examples/pinecone_example/__init__.py +0 -9
  11. langtrace_python_sdk-2.1.14/src/langtrace_python_sdk/version.py +0 -1
  12. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/.gitignore +0 -0
  13. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/LICENSE +0 -0
  14. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/pyproject.toml +0 -0
  15. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/__init__.py +0 -0
  16. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/__init__.py +0 -0
  17. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/anthropic_example/__init__.py +0 -0
  18. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/anthropic_example/completion.py +0 -0
  19. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/chroma_example/__init__.py +0 -0
  20. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/chroma_example/basic.py +0 -0
  21. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/cohere_example/__init__.py +0 -0
  22. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/cohere_example/chat.py +0 -0
  23. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/cohere_example/chat_stream.py +0 -0
  24. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/cohere_example/embed.py +0 -0
  25. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/cohere_example/rerank.py +0 -0
  26. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/cohere_example/tools.py +0 -0
  27. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/fastapi_example/__init__.py +0 -0
  28. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/fastapi_example/basic_route.py +0 -0
  29. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/hiveagent_example/basic.py +0 -0
  30. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/langchain_example/__init__.py +0 -0
  31. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/langchain_example/groq_example.py +0 -0
  32. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/langchain_example/langgraph_example.py +0 -0
  33. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/langchain_example/tool.py +0 -0
  34. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/llamaindex_example/__init__.py +0 -0
  35. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/llamaindex_example/agent.py +0 -0
  36. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/llamaindex_example/basic.py +0 -0
  37. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/llamaindex_example/data/abramov.txt +0 -0
  38. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/openai_example/__init__.py +0 -0
  39. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/openai_example/async_tool_calling_nonstreaming.py +0 -0
  40. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/openai_example/async_tool_calling_streaming.py +0 -0
  41. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/openai_example/embeddings_create.py +0 -0
  42. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/openai_example/function_calling.py +0 -0
  43. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/openai_example/images_edit.py +0 -0
  44. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/openai_example/images_generate.py +0 -0
  45. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/openai_example/resources/lounge_flamingo.png +0 -0
  46. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/openai_example/resources/mask.png +0 -0
  47. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/openai_example/tool_calling.py +0 -0
  48. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/openai_example/tool_calling_nonstreaming.py +0 -0
  49. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/openai_example/tool_calling_streaming.py +0 -0
  50. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/perplexity_example/basic.py +0 -0
  51. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/qdrant_example/__init__.py +0 -0
  52. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/qdrant_example/basic.py +0 -0
  53. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/weaviate_example/__init__.py +0 -0
  54. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/examples/weaviate_example/query_text.py +0 -0
  55. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/constants/__init__.py +0 -0
  56. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/constants/exporter/langtrace_exporter.py +0 -0
  57. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/constants/instrumentation/__init__.py +0 -0
  58. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/constants/instrumentation/anthropic.py +0 -0
  59. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/constants/instrumentation/chroma.py +0 -0
  60. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/constants/instrumentation/cohere.py +0 -0
  61. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/constants/instrumentation/common.py +0 -0
  62. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/constants/instrumentation/groq.py +0 -0
  63. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/constants/instrumentation/openai.py +0 -0
  64. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/constants/instrumentation/pinecone.py +0 -0
  65. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/constants/instrumentation/qdrant.py +0 -0
  66. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/constants/instrumentation/weaviate.py +0 -0
  67. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/extensions/__init__.py +0 -0
  68. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/extensions/langtrace_exporter.py +0 -0
  69. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/__init__.py +0 -0
  70. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/anthropic/__init__.py +0 -0
  71. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/anthropic/instrumentation.py +0 -0
  72. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/anthropic/patch.py +0 -0
  73. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/chroma/__init__.py +0 -0
  74. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/chroma/instrumentation.py +0 -0
  75. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/chroma/patch.py +0 -0
  76. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/cohere/__init__.py +0 -0
  77. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/cohere/instrumentation.py +0 -0
  78. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/cohere/patch.py +0 -0
  79. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/groq/__init__.py +0 -0
  80. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/groq/instrumentation.py +0 -0
  81. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/groq/patch.py +0 -0
  82. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/langchain/__init__.py +0 -0
  83. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/langchain/instrumentation.py +0 -0
  84. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/langchain/patch.py +0 -0
  85. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/langchain_community/__init__.py +0 -0
  86. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/langchain_community/instrumentation.py +0 -0
  87. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/langchain_community/patch.py +0 -0
  88. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/langchain_core/__init__.py +0 -0
  89. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/langchain_core/instrumentation.py +0 -0
  90. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/langchain_core/patch.py +0 -0
  91. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/langgraph/__init__.py +0 -0
  92. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/langgraph/instrumentation.py +0 -0
  93. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/langgraph/patch.py +0 -0
  94. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/llamaindex/__init__.py +0 -0
  95. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/llamaindex/instrumentation.py +0 -0
  96. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/llamaindex/patch.py +0 -0
  97. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/openai/__init__.py +0 -0
  98. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/openai/instrumentation.py +0 -0
  99. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/openai/patch.py +0 -0
  100. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/pinecone/__init__.py +0 -0
  101. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/pinecone/instrumentation.py +0 -0
  102. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/pinecone/patch.py +0 -0
  103. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/qdrant/__init__.py +0 -0
  104. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/qdrant/instrumentation.py +0 -0
  105. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/qdrant/patch.py +0 -0
  106. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/weaviate/__init__.py +0 -0
  107. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/weaviate/instrumentation.py +0 -0
  108. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/instrumentation/weaviate/patch.py +0 -0
  109. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/langtrace.py +0 -0
  110. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/types/__init__.py +0 -0
  111. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/utils/__init__.py +0 -0
  112. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/utils/llm.py +0 -0
  113. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/utils/misc.py +0 -0
  114. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/utils/prompt_registry.py +0 -0
  115. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/utils/sdk_version_checker.py +0 -0
  116. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/utils/silently_fail.py +0 -0
  117. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/langtrace_python_sdk/utils/types.py +0 -0
  118. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/run_example.py +0 -0
  119. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/__init__.py +0 -0
  120. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/anthropic/cassettes/test_anthropic.yaml +0 -0
  121. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/anthropic/cassettes/test_anthropic_streaming.yaml +0 -0
  122. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/anthropic/cassettes/test_async_anthropic_streaming.yaml +0 -0
  123. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/anthropic/conftest.py +0 -0
  124. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/anthropic/test_anthropic.py +0 -0
  125. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/chroma/conftest.py +0 -0
  126. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/chroma/test_chroma.py +0 -0
  127. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/cohere/cassettes/test_cohere_chat.yaml +0 -0
  128. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/cohere/cassettes/test_cohere_chat_streaming.yaml +0 -0
  129. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/cohere/cassettes/test_cohere_embed.yaml +0 -0
  130. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/cohere/cassettes/test_cohere_rerank.yaml +0 -0
  131. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/cohere/conftest.py +0 -0
  132. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/cohere/test_cohere_chat.py +0 -0
  133. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/cohere/test_cohere_embed.py +0 -0
  134. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/cohere/test_cohere_rerank.py +0 -0
  135. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/conftest.py +0 -0
  136. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/langchain/cassettes/test_langchain.yaml +0 -0
  137. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/langchain/conftest.py +0 -0
  138. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/langchain/test_langchain.py +0 -0
  139. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/openai/cassettes/test_async_chat_completion_streaming.yaml +0 -0
  140. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/openai/cassettes/test_async_image_generation.yaml +0 -0
  141. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/openai/cassettes/test_chat_completion.yaml +0 -0
  142. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/openai/cassettes/test_chat_completion_streaming.yaml +0 -0
  143. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/openai/cassettes/test_image_generation.yaml +0 -0
  144. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/openai/conftest.py +0 -0
  145. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/openai/test_chat_completion.py +0 -0
  146. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/openai/test_embeddings.py +0 -0
  147. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/openai/test_image_generation.py +0 -0
  148. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/pinecone/cassettes/test_query.yaml +0 -0
  149. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/pinecone/cassettes/test_upsert.yaml +0 -0
  150. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/pinecone/conftest.py +0 -0
  151. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/pinecone/test_pinecone.py +0 -0
  152. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/qdrant/conftest.py +0 -0
  153. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/qdrant/test_qdrant.py +0 -0
  154. {langtrace_python_sdk-2.1.14 → langtrace_python_sdk-2.1.16}/src/tests/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: langtrace-python-sdk
3
- Version: 2.1.14
3
+ Version: 2.1.16
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>
@@ -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
 
@@ -179,14 +179,14 @@ langtrace.init(custom_remote_exporter=<your_exporter>, batch=<True or False>)
179
179
 
180
180
  ### Configure Langtrace
181
181
 
182
- | Parameter | Type | Default Value | Description |
183
- | -------------------------- | ----------------------------------- | ----------------------------- | ------------------------------------------------------------------------------ |
184
- | `api_key` | `str` | `LANGTRACE_API_KEY` or `None` | The API key for authentication. |
185
- | `batch` | `bool` | `True` | Whether to batch spans before sending them. |
186
- | `write_spans_to_console` | `bool` | `False` | Whether to write spans to the console. |
187
- | `custom_remote_exporter` | `Optional[Exporter]` | `None` | Custom remote exporter. If `None`, a default `LangTraceExporter` will be used. |
188
- | `api_host` | `Optional[str]` | `https://langtrace.ai/` | The API host for the remote exporter. |
189
- | `disable_instrumentations` | `Optional[DisableInstrumentations]` | `None` | You can pass an object to disable instrumentation for specific vendors ex: `{'only': ['openai']}` or `{'all_except': ['openai']}`
182
+ | Parameter | Type | Default Value | Description |
183
+ | -------------------------- | ----------------------------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
184
+ | `api_key` | `str` | `LANGTRACE_API_KEY` or `None` | The API key for authentication. |
185
+ | `batch` | `bool` | `True` | Whether to batch spans before sending them. |
186
+ | `write_spans_to_console` | `bool` | `False` | Whether to write spans to the console. |
187
+ | `custom_remote_exporter` | `Optional[Exporter]` | `None` | Custom remote exporter. If `None`, a default `LangTraceExporter` will be used. |
188
+ | `api_host` | `Optional[str]` | `https://langtrace.ai/` | The API host for the remote exporter. |
189
+ | `disable_instrumentations` | `Optional[DisableInstrumentations]` | `None` | You can pass an object to disable instrumentation for specific vendors ex: `{'only': ['openai']}` or `{'all_except': ['openai']}` |
190
190
 
191
191
  ### Additional Customization
192
192
 
@@ -205,7 +205,30 @@ def example():
205
205
  return response
206
206
  ```
207
207
 
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.
208
+ - `inject_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
+
210
+ ```python
211
+ from langtrace_python_sdk import inject_additional_attributes
212
+
213
+
214
+
215
+ def do_llm_stuff(name=""):
216
+ response = client.chat.completions.create(
217
+ model="gpt-4",
218
+ messages=[{"role": "user", "content": "Say this is a test three times"}],
219
+ stream=False,
220
+ )
221
+ return response
222
+
223
+
224
+ def main():
225
+ response = inject_additional_attributes(lambda: do_llm_stuff(name="llm"), {'user.id': 'userId'})
226
+
227
+ # if the function do not take arguments then this syntax will work
228
+ response = inject_additional_attributes(do_llm_stuff, {'user.id': 'userId'})
229
+ ```
230
+
231
+ - `with_additional_attributes` - is behaving the same as `inject_additional_attributes` but as a decorator, this will be deprecated soon.
209
232
 
210
233
  ```python
211
234
  from langtrace_python_sdk import with_langtrace_root_span, with_additional_attributes
@@ -277,7 +300,6 @@ We welcome contributions to this project. To get started, fork this repository a
277
300
 
278
301
  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
302
 
280
-
281
303
  ---
282
304
 
283
305
  ## Security
@@ -288,5 +310,5 @@ To report security vulnerabilites, email us at <security@scale3labs.com>. You ca
288
310
 
289
311
  ## License
290
312
 
291
- - 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).
313
+ - 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).
292
314
  - 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).
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Open Source & Open Telemetry(OTEL) Observability for LLM applications
4
4
 
5
- ![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)
5
+ ![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)
6
6
 
7
7
  ---
8
8
 
@@ -139,14 +139,14 @@ langtrace.init(custom_remote_exporter=<your_exporter>, batch=<True or False>)
139
139
 
140
140
  ### Configure Langtrace
141
141
 
142
- | Parameter | Type | Default Value | Description |
143
- | -------------------------- | ----------------------------------- | ----------------------------- | ------------------------------------------------------------------------------ |
144
- | `api_key` | `str` | `LANGTRACE_API_KEY` or `None` | The API key for authentication. |
145
- | `batch` | `bool` | `True` | Whether to batch spans before sending them. |
146
- | `write_spans_to_console` | `bool` | `False` | Whether to write spans to the console. |
147
- | `custom_remote_exporter` | `Optional[Exporter]` | `None` | Custom remote exporter. If `None`, a default `LangTraceExporter` will be used. |
148
- | `api_host` | `Optional[str]` | `https://langtrace.ai/` | The API host for the remote exporter. |
149
- | `disable_instrumentations` | `Optional[DisableInstrumentations]` | `None` | You can pass an object to disable instrumentation for specific vendors ex: `{'only': ['openai']}` or `{'all_except': ['openai']}`
142
+ | Parameter | Type | Default Value | Description |
143
+ | -------------------------- | ----------------------------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
144
+ | `api_key` | `str` | `LANGTRACE_API_KEY` or `None` | The API key for authentication. |
145
+ | `batch` | `bool` | `True` | Whether to batch spans before sending them. |
146
+ | `write_spans_to_console` | `bool` | `False` | Whether to write spans to the console. |
147
+ | `custom_remote_exporter` | `Optional[Exporter]` | `None` | Custom remote exporter. If `None`, a default `LangTraceExporter` will be used. |
148
+ | `api_host` | `Optional[str]` | `https://langtrace.ai/` | The API host for the remote exporter. |
149
+ | `disable_instrumentations` | `Optional[DisableInstrumentations]` | `None` | You can pass an object to disable instrumentation for specific vendors ex: `{'only': ['openai']}` or `{'all_except': ['openai']}` |
150
150
 
151
151
  ### Additional Customization
152
152
 
@@ -165,7 +165,30 @@ def example():
165
165
  return response
166
166
  ```
167
167
 
168
- - `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.
168
+ - `inject_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.
169
+
170
+ ```python
171
+ from langtrace_python_sdk import inject_additional_attributes
172
+
173
+
174
+
175
+ def do_llm_stuff(name=""):
176
+ response = client.chat.completions.create(
177
+ model="gpt-4",
178
+ messages=[{"role": "user", "content": "Say this is a test three times"}],
179
+ stream=False,
180
+ )
181
+ return response
182
+
183
+
184
+ def main():
185
+ response = inject_additional_attributes(lambda: do_llm_stuff(name="llm"), {'user.id': 'userId'})
186
+
187
+ # if the function do not take arguments then this syntax will work
188
+ response = inject_additional_attributes(do_llm_stuff, {'user.id': 'userId'})
189
+ ```
190
+
191
+ - `with_additional_attributes` - is behaving the same as `inject_additional_attributes` but as a decorator, this will be deprecated soon.
169
192
 
170
193
  ```python
171
194
  from langtrace_python_sdk import with_langtrace_root_span, with_additional_attributes
@@ -237,7 +260,6 @@ We welcome contributions to this project. To get started, fork this repository a
237
260
 
238
261
  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`
239
262
 
240
-
241
263
  ---
242
264
 
243
265
  ## Security
@@ -248,5 +270,5 @@ To report security vulnerabilites, email us at <security@scale3labs.com>. You ca
248
270
 
249
271
  ## License
250
272
 
251
- - 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).
273
+ - 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).
252
274
  - 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).
@@ -18,7 +18,6 @@ _ = load_dotenv(find_dotenv())
18
18
  langtrace.init()
19
19
 
20
20
 
21
- # @with_additional_attributes({"user.id": "1234", "user.feedback.rating": 1})
22
21
  def api_call_1():
23
22
  llm = ChatOpenAI()
24
23
  prompt = ChatPromptTemplate.from_messages(
@@ -33,7 +32,6 @@ def api_call_1():
33
32
  print(res)
34
33
 
35
34
 
36
- # @with_additional_attributes({"user.id": "37373", "user.feedback.rating": 1})
37
35
  def api_call_2():
38
36
  llm = ChatOpenAI()
39
37
  prompt = ChatPromptTemplate.from_messages(
@@ -13,7 +13,6 @@ 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})
17
16
  def api():
18
17
  response = client.chat.completions.create(
19
18
  model="gpt-4",
@@ -0,0 +1,16 @@
1
+ from langtrace_python_sdk import (
2
+ get_prompt_from_registry,
3
+ with_langtrace_root_span,
4
+ with_additional_attributes,
5
+ inject_additional_attributes,
6
+ )
7
+
8
+
9
+ class PineconeRunner:
10
+ @with_langtrace_root_span("Pinecone")
11
+ def run(self):
12
+ from .basic import basic as do_llm_stuff
13
+
14
+ response = inject_additional_attributes(do_llm_stuff, {"user.id": 1234})
15
+ print(response)
16
+ return response
@@ -7,6 +7,7 @@ from openai import OpenAI
7
7
  from pinecone import Pinecone, ServerlessSpec
8
8
 
9
9
  from langtrace_python_sdk import (
10
+ get_prompt_from_registry,
10
11
  langtrace,
11
12
  with_langtrace_root_span,
12
13
  with_additional_attributes,
@@ -14,7 +15,6 @@ from langtrace_python_sdk import (
14
15
  from langtrace_python_sdk.utils.with_root_span import SendUserFeedback
15
16
 
16
17
  _ = load_dotenv(find_dotenv())
17
-
18
18
  langtrace.init()
19
19
 
20
20
  client = OpenAI()
@@ -32,10 +32,8 @@ def create_index():
32
32
  )
33
33
 
34
34
 
35
- @with_additional_attributes({"db.embedding_model": "text-embedding-ada-002"})
36
35
  @with_langtrace_root_span("Pinecone Basic")
37
- def basic(span_id=None, trace_id=None):
38
-
36
+ def basic():
39
37
  result = client.embeddings.create(
40
38
  model="text-embedding-ada-002",
41
39
  input="Some random text string goes here",
@@ -53,10 +51,7 @@ def basic(span_id=None, trace_id=None):
53
51
  resp = index.query(
54
52
  vector=embedding, top_k=1, include_values=False, namespace="test-namespace"
55
53
  )
56
- SendUserFeedback().evaluate(
57
- {"spanId": span_id, "traceId": trace_id, "userScore": 1, "userId": "123"}
58
- )
54
+ # SendUserFeedback().evaluate(
55
+ # {"spanId": span_id, "traceId": trace_id, "userScore": 1, "userId": "123"}
56
+ # )
59
57
  return [res, resp]
60
-
61
-
62
- # create_index()
@@ -21,12 +21,16 @@ from langtrace_python_sdk.utils.with_root_span import (
21
21
  )
22
22
 
23
23
  from langtrace_python_sdk.utils.prompt_registry import get_prompt_from_registry
24
- from langtrace_python_sdk.utils.with_root_span import SendUserFeedback
24
+ from langtrace_python_sdk.utils.with_root_span import (
25
+ SendUserFeedback,
26
+ inject_additional_attributes,
27
+ )
25
28
 
26
29
  __all__ = [
27
30
  "langtrace",
28
31
  "with_langtrace_root_span",
29
32
  "with_additional_attributes",
33
+ "inject_additional_attributes",
30
34
  "get_prompt_from_registry",
31
35
  "SendUserFeedback",
32
36
  ]
@@ -16,6 +16,7 @@ limitations under the License.
16
16
 
17
17
  import asyncio
18
18
  import os
19
+ from deprecated import deprecated
19
20
  from functools import wraps
20
21
  from typing import Optional
21
22
 
@@ -23,9 +24,6 @@ import requests
23
24
  from opentelemetry import baggage, context, trace
24
25
  from opentelemetry.trace import SpanKind
25
26
 
26
- from langtrace_python_sdk.constants.exporter.langtrace_exporter import (
27
- LANGTRACE_REMOTE_URL,
28
- )
29
27
  from langtrace_python_sdk.constants.instrumentation.common import (
30
28
  LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY,
31
29
  )
@@ -87,7 +85,14 @@ def with_langtrace_root_span(
87
85
  return decorator
88
86
 
89
87
 
88
+ @deprecated(reason="Use inject_additional_attributes instead")
90
89
  def with_additional_attributes(attributes={}):
90
+ print(
91
+ Fore.YELLOW
92
+ + "with_additional_attributes is deprecated, use inject_additional_attributes instead"
93
+ + Fore.RESET
94
+ )
95
+
91
96
  def decorator(func):
92
97
  @wraps(func)
93
98
  def sync_wrapper(*args, **kwargs):
@@ -113,6 +118,16 @@ def with_additional_attributes(attributes={}):
113
118
  return decorator
114
119
 
115
120
 
121
+ def inject_additional_attributes(fn, attributes=None):
122
+ if attributes:
123
+ new_ctx = baggage.set_baggage(
124
+ LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY, attributes
125
+ )
126
+ context.attach(new_ctx)
127
+
128
+ return fn()
129
+
130
+
116
131
  class SendUserFeedback:
117
132
  _langtrace_host: str
118
133
  _langtrace_api_key: str
@@ -0,0 +1 @@
1
+ __version__ = "2.1.16"
@@ -1,9 +0,0 @@
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()
@@ -1 +0,0 @@
1
- __version__ = "2.1.14"