langtrace-python-sdk 2.1.15__tar.gz → 2.1.17__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 (156) hide show
  1. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/.gitignore +2 -0
  2. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/PKG-INFO +34 -11
  3. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/README.md +32 -10
  4. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/pyproject.toml +8 -4
  5. langtrace_python_sdk-2.1.17/src/examples/inspect_ai_example/basic_eval.py +28 -0
  6. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/langchain_example/basic.py +0 -2
  7. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/chat_completion.py +0 -1
  8. langtrace_python_sdk-2.1.17/src/examples/pinecone_example/__init__.py +16 -0
  9. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/pinecone_example/basic.py +5 -10
  10. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/__init__.py +7 -6
  11. langtrace_python_sdk-2.1.17/src/langtrace_python_sdk/extensions/langtrace_filesystem.py +178 -0
  12. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/utils/with_root_span.py +18 -3
  13. langtrace_python_sdk-2.1.17/src/langtrace_python_sdk/version.py +1 -0
  14. langtrace_python_sdk-2.1.15/src/examples/pinecone_example/__init__.py +0 -9
  15. langtrace_python_sdk-2.1.15/src/langtrace_python_sdk/version.py +0 -1
  16. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/LICENSE +0 -0
  17. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/__init__.py +0 -0
  18. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/__init__.py +0 -0
  19. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/anthropic_example/__init__.py +0 -0
  20. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/anthropic_example/completion.py +0 -0
  21. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/chroma_example/__init__.py +0 -0
  22. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/chroma_example/basic.py +0 -0
  23. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/cohere_example/__init__.py +0 -0
  24. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/cohere_example/chat.py +0 -0
  25. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/cohere_example/chat_stream.py +0 -0
  26. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/cohere_example/embed.py +0 -0
  27. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/cohere_example/rerank.py +0 -0
  28. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/cohere_example/tools.py +0 -0
  29. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/fastapi_example/__init__.py +0 -0
  30. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/fastapi_example/basic_route.py +0 -0
  31. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/hiveagent_example/basic.py +0 -0
  32. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/langchain_example/__init__.py +0 -0
  33. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/langchain_example/groq_example.py +0 -0
  34. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/langchain_example/langgraph_example.py +0 -0
  35. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/langchain_example/tool.py +0 -0
  36. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/llamaindex_example/__init__.py +0 -0
  37. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/llamaindex_example/agent.py +0 -0
  38. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/llamaindex_example/basic.py +0 -0
  39. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/llamaindex_example/data/abramov.txt +0 -0
  40. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/__init__.py +0 -0
  41. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/async_tool_calling_nonstreaming.py +0 -0
  42. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/async_tool_calling_streaming.py +0 -0
  43. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/embeddings_create.py +0 -0
  44. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/function_calling.py +0 -0
  45. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/images_edit.py +0 -0
  46. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/images_generate.py +0 -0
  47. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/resources/lounge_flamingo.png +0 -0
  48. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/resources/mask.png +0 -0
  49. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/tool_calling.py +0 -0
  50. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/tool_calling_nonstreaming.py +0 -0
  51. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/tool_calling_streaming.py +0 -0
  52. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/perplexity_example/basic.py +0 -0
  53. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/qdrant_example/__init__.py +0 -0
  54. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/qdrant_example/basic.py +0 -0
  55. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/weaviate_example/__init__.py +0 -0
  56. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/examples/weaviate_example/query_text.py +0 -0
  57. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/__init__.py +0 -0
  58. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/exporter/langtrace_exporter.py +0 -0
  59. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/instrumentation/__init__.py +0 -0
  60. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/instrumentation/anthropic.py +0 -0
  61. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/instrumentation/chroma.py +0 -0
  62. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/instrumentation/cohere.py +0 -0
  63. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/instrumentation/common.py +0 -0
  64. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/instrumentation/groq.py +0 -0
  65. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/instrumentation/openai.py +0 -0
  66. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/instrumentation/pinecone.py +0 -0
  67. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/instrumentation/qdrant.py +0 -0
  68. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/instrumentation/weaviate.py +0 -0
  69. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/extensions/__init__.py +0 -0
  70. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/extensions/langtrace_exporter.py +0 -0
  71. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/__init__.py +0 -0
  72. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/anthropic/__init__.py +0 -0
  73. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/anthropic/instrumentation.py +0 -0
  74. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/anthropic/patch.py +0 -0
  75. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/chroma/__init__.py +0 -0
  76. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/chroma/instrumentation.py +0 -0
  77. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/chroma/patch.py +0 -0
  78. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/cohere/__init__.py +0 -0
  79. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/cohere/instrumentation.py +0 -0
  80. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/cohere/patch.py +0 -0
  81. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/groq/__init__.py +0 -0
  82. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/groq/instrumentation.py +0 -0
  83. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/groq/patch.py +0 -0
  84. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langchain/__init__.py +0 -0
  85. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langchain/instrumentation.py +0 -0
  86. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langchain/patch.py +0 -0
  87. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langchain_community/__init__.py +0 -0
  88. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langchain_community/instrumentation.py +0 -0
  89. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langchain_community/patch.py +0 -0
  90. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langchain_core/__init__.py +0 -0
  91. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langchain_core/instrumentation.py +0 -0
  92. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langchain_core/patch.py +0 -0
  93. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langgraph/__init__.py +0 -0
  94. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langgraph/instrumentation.py +0 -0
  95. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langgraph/patch.py +0 -0
  96. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/llamaindex/__init__.py +0 -0
  97. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/llamaindex/instrumentation.py +0 -0
  98. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/llamaindex/patch.py +0 -0
  99. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/openai/__init__.py +0 -0
  100. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/openai/instrumentation.py +0 -0
  101. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/openai/patch.py +0 -0
  102. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/pinecone/__init__.py +0 -0
  103. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/pinecone/instrumentation.py +0 -0
  104. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/pinecone/patch.py +0 -0
  105. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/qdrant/__init__.py +0 -0
  106. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/qdrant/instrumentation.py +0 -0
  107. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/qdrant/patch.py +0 -0
  108. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/weaviate/__init__.py +0 -0
  109. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/weaviate/instrumentation.py +0 -0
  110. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/weaviate/patch.py +0 -0
  111. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/langtrace.py +0 -0
  112. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/types/__init__.py +0 -0
  113. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/utils/__init__.py +0 -0
  114. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/utils/llm.py +0 -0
  115. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/utils/misc.py +0 -0
  116. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/utils/prompt_registry.py +0 -0
  117. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/utils/sdk_version_checker.py +0 -0
  118. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/utils/silently_fail.py +0 -0
  119. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/utils/types.py +0 -0
  120. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/run_example.py +0 -0
  121. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/__init__.py +0 -0
  122. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/anthropic/cassettes/test_anthropic.yaml +0 -0
  123. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/anthropic/cassettes/test_anthropic_streaming.yaml +0 -0
  124. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/anthropic/cassettes/test_async_anthropic_streaming.yaml +0 -0
  125. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/anthropic/conftest.py +0 -0
  126. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/anthropic/test_anthropic.py +0 -0
  127. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/chroma/conftest.py +0 -0
  128. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/chroma/test_chroma.py +0 -0
  129. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/cohere/cassettes/test_cohere_chat.yaml +0 -0
  130. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/cohere/cassettes/test_cohere_chat_streaming.yaml +0 -0
  131. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/cohere/cassettes/test_cohere_embed.yaml +0 -0
  132. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/cohere/cassettes/test_cohere_rerank.yaml +0 -0
  133. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/cohere/conftest.py +0 -0
  134. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/cohere/test_cohere_chat.py +0 -0
  135. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/cohere/test_cohere_embed.py +0 -0
  136. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/cohere/test_cohere_rerank.py +0 -0
  137. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/conftest.py +0 -0
  138. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/langchain/cassettes/test_langchain.yaml +0 -0
  139. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/langchain/conftest.py +0 -0
  140. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/langchain/test_langchain.py +0 -0
  141. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/openai/cassettes/test_async_chat_completion_streaming.yaml +0 -0
  142. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/openai/cassettes/test_async_image_generation.yaml +0 -0
  143. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/openai/cassettes/test_chat_completion.yaml +0 -0
  144. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/openai/cassettes/test_chat_completion_streaming.yaml +0 -0
  145. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/openai/cassettes/test_image_generation.yaml +0 -0
  146. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/openai/conftest.py +0 -0
  147. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/openai/test_chat_completion.py +0 -0
  148. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/openai/test_embeddings.py +0 -0
  149. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/openai/test_image_generation.py +0 -0
  150. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/pinecone/cassettes/test_query.yaml +0 -0
  151. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/pinecone/cassettes/test_upsert.yaml +0 -0
  152. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/pinecone/conftest.py +0 -0
  153. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/pinecone/test_pinecone.py +0 -0
  154. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/qdrant/conftest.py +0 -0
  155. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/qdrant/test_qdrant.py +0 -0
  156. {langtrace_python_sdk-2.1.15 → langtrace_python_sdk-2.1.17}/src/tests/utils.py +0 -0
@@ -161,3 +161,5 @@ chroma.sqlite3
161
161
  # and can be added to the global gitignore or merged into this file. For a more nuclear
162
162
  # option (not recommended) you can uncomment the following to ignore the entire idea folder.
163
163
  #.idea/
164
+
165
+ logs/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: langtrace-python-sdk
3
- Version: 2.1.15
3
+ Version: 2.1.17
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>
@@ -11,6 +11,7 @@ Classifier: Operating System :: OS Independent
11
11
  Classifier: Programming Language :: Python :: 3
12
12
  Requires-Python: >=3.9
13
13
  Requires-Dist: colorama>=0.4.6
14
+ Requires-Dist: fsspec>=2024.6.0
14
15
  Requires-Dist: opentelemetry-api>=1.25.0
15
16
  Requires-Dist: opentelemetry-exporter-otlp-proto-grpc>=1.25.0
16
17
  Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.25.0
@@ -179,14 +180,14 @@ langtrace.init(custom_remote_exporter=<your_exporter>, batch=<True or False>)
179
180
 
180
181
  ### Configure Langtrace
181
182
 
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']}`
183
+ | Parameter | Type | Default Value | Description |
184
+ | -------------------------- | ----------------------------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
185
+ | `api_key` | `str` | `LANGTRACE_API_KEY` or `None` | The API key for authentication. |
186
+ | `batch` | `bool` | `True` | Whether to batch spans before sending them. |
187
+ | `write_spans_to_console` | `bool` | `False` | Whether to write spans to the console. |
188
+ | `custom_remote_exporter` | `Optional[Exporter]` | `None` | Custom remote exporter. If `None`, a default `LangTraceExporter` will be used. |
189
+ | `api_host` | `Optional[str]` | `https://langtrace.ai/` | The API host for the remote exporter. |
190
+ | `disable_instrumentations` | `Optional[DisableInstrumentations]` | `None` | You can pass an object to disable instrumentation for specific vendors ex: `{'only': ['openai']}` or `{'all_except': ['openai']}` |
190
191
 
191
192
  ### Additional Customization
192
193
 
@@ -205,7 +206,30 @@ def example():
205
206
  return response
206
207
  ```
207
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
+ - `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.
210
+
211
+ ```python
212
+ from langtrace_python_sdk import inject_additional_attributes
213
+
214
+
215
+
216
+ def do_llm_stuff(name=""):
217
+ response = client.chat.completions.create(
218
+ model="gpt-4",
219
+ messages=[{"role": "user", "content": "Say this is a test three times"}],
220
+ stream=False,
221
+ )
222
+ return response
223
+
224
+
225
+ def main():
226
+ response = inject_additional_attributes(lambda: do_llm_stuff(name="llm"), {'user.id': 'userId'})
227
+
228
+ # if the function do not take arguments then this syntax will work
229
+ response = inject_additional_attributes(do_llm_stuff, {'user.id': 'userId'})
230
+ ```
231
+
232
+ - `with_additional_attributes` - is behaving the same as `inject_additional_attributes` but as a decorator, this will be deprecated soon.
209
233
 
210
234
  ```python
211
235
  from langtrace_python_sdk import with_langtrace_root_span, with_additional_attributes
@@ -277,7 +301,6 @@ We welcome contributions to this project. To get started, fork this repository a
277
301
 
278
302
  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
303
 
280
-
281
304
  ---
282
305
 
283
306
  ## Security
@@ -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
@@ -27,7 +27,8 @@ dependencies = [
27
27
  'opentelemetry-exporter-otlp-proto-grpc>=1.25.0',
28
28
  'tiktoken>=0.1.1',
29
29
  'colorama>=0.4.6',
30
- 'sqlalchemy'
30
+ 'sqlalchemy',
31
+ 'fsspec>=2024.6.0'
31
32
  ]
32
33
 
33
34
  requires-python = ">=3.9"
@@ -37,11 +38,11 @@ dev = [
37
38
  "openai",
38
39
  "anthropic",
39
40
  "chromadb",
40
- 'qdrant-client',
41
+ "qdrant-client",
41
42
  "python-dotenv",
42
- 'pinecone-client',
43
+ "pinecone-client",
43
44
  "langchain",
44
- 'langchain-community',
45
+ "langchain-community",
45
46
  "langchain-openai",
46
47
  "langchain-openai",
47
48
  "chromadb",
@@ -73,6 +74,9 @@ include = [
73
74
  [tool.hatch.build.targets.wheel]
74
75
  packages = ["src/langtrace_python_sdk", "src/examples", "src/tests"]
75
76
 
77
+ [project.entry-points."fsspec.specs"]
78
+ langtracefs = "langtrace_python_sdk:LangTraceFileSystem"
79
+
76
80
  # [tool.semantic_release]
77
81
  # version_variable = "pyproject.toml:version" # version location
78
82
  # branch = "development" # branch to make releases of
@@ -0,0 +1,28 @@
1
+ # langtrace.init(write_spans_to_console=True)
2
+ import fsspec
3
+ from inspect_ai import Task, task
4
+ from inspect_ai.dataset import csv_dataset
5
+ from inspect_ai.scorer import model_graded_qa
6
+ from inspect_ai.solver import chain_of_thought, generate, self_critique
7
+
8
+ from langtrace_python_sdk.extensions.langtrace_filesystem import \
9
+ LangTraceFileSystem
10
+
11
+ # from langtrace_python_sdk import langtrace
12
+
13
+
14
+ # Manually register the filesystem with fsspec
15
+ # Note: This is only necessary because the filesystem is not registered.
16
+ fsspec.register_implementation(LangTraceFileSystem.protocol, LangTraceFileSystem)
17
+
18
+
19
+ @task
20
+ def security_guide():
21
+ return Task(
22
+ dataset=csv_dataset("langtracefs://clxc2mxu6000lpc7ntsvcjvp9"),
23
+ plan=[
24
+ chain_of_thought(),
25
+ self_critique()
26
+ ],
27
+ scorer=model_graded_qa()
28
+ )
@@ -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()
@@ -15,18 +15,19 @@ 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 (
19
- with_langtrace_root_span,
20
- with_additional_attributes,
21
- )
22
-
18
+ from langtrace_python_sdk.extensions.langtrace_filesystem import \
19
+ LangTraceFileSystem
23
20
  from langtrace_python_sdk.utils.prompt_registry import get_prompt_from_registry
24
- from langtrace_python_sdk.utils.with_root_span import SendUserFeedback
21
+ from langtrace_python_sdk.utils.with_root_span import (
22
+ SendUserFeedback, inject_additional_attributes, with_additional_attributes,
23
+ with_langtrace_root_span)
25
24
 
26
25
  __all__ = [
27
26
  "langtrace",
28
27
  "with_langtrace_root_span",
29
28
  "with_additional_attributes",
29
+ "inject_additional_attributes",
30
30
  "get_prompt_from_registry",
31
31
  "SendUserFeedback",
32
+ "LangTraceFileSystem",
32
33
  ]
@@ -0,0 +1,178 @@
1
+ import json
2
+ import io
3
+ import os
4
+ import requests
5
+ from typing import Iterator, Literal, Union
6
+ from colorama import Fore
7
+ from langtrace_python_sdk.constants.exporter.langtrace_exporter import (
8
+ LANGTRACE_REMOTE_URL,
9
+ )
10
+ from fsspec.spec import AbstractFileSystem
11
+
12
+ OpenTextMode = Literal["r", "a", "w"]
13
+ OpenBinaryMode = Literal["rb", "ab", "wb"]
14
+
15
+
16
+ class OpenMode(str):
17
+ def __init_subclass__(cls, **kwargs):
18
+ allowed_values = set(OpenTextMode.__args__) | set(OpenBinaryMode.__args__)
19
+ super().__init_subclass__(**kwargs)
20
+
21
+ def __new__(cls, value):
22
+ if value not in allowed_values:
23
+ raise ValueError(f"Invalid value for OpenMode: {value}")
24
+ return super().__new__(cls, value)
25
+
26
+ cls.__new__ = __new__
27
+
28
+
29
+ class LangTraceFile(io.BytesIO):
30
+ def __init__(self, fs: "LangTraceFileSystem", path: str, mode: OpenMode):
31
+ super().__init__()
32
+ self.fs = fs
33
+ self.path = path
34
+ self.mode = mode
35
+
36
+ def close(self) -> None:
37
+ if not self.closed:
38
+ self.seek(0)
39
+ file_data = self.getvalue()
40
+ self.fs.files[self.path] = file_data
41
+
42
+ # Upload the file to the remote server
43
+ self.upload_to_server(file_data)
44
+
45
+ super().close()
46
+
47
+ def upload_to_server(self, file_data: bytes) -> None:
48
+ try:
49
+ # Parse the log file and upload it to the server
50
+ log = file_data.decode("utf-8")
51
+ eval_log = json.loads(log)
52
+ data = {
53
+ "runId": eval_log['eval']['run_id'],
54
+ "taskId": eval_log['eval']['task_id'],
55
+ "log": log,
56
+ }
57
+ if self.path is not None:
58
+ dataset_id = self.path.split("/")[0]
59
+ print(Fore.GREEN + f"Sending results to Langtrace for dataset: {dataset_id}" + Fore.RESET)
60
+ data["datasetId"] = dataset_id
61
+ else:
62
+ print(Fore.GREEN + "Sending results to Langtrace" + Fore.RESET)
63
+ response = requests.post(
64
+ url=f"{LANGTRACE_REMOTE_URL}/api/run",
65
+ data=json.dumps(data),
66
+ headers={
67
+ "Content-Type": "application/json",
68
+ "x-api-key": os.environ.get("LANGTRACE_API_KEY")
69
+ },
70
+ timeout=20,
71
+ )
72
+ response.raise_for_status()
73
+ print(
74
+ Fore.GREEN + "Results sent to Langtrace successfully." + Fore.RESET
75
+ )
76
+ except requests.exceptions.RequestException as error:
77
+ print(Fore.RED + f"Error reporting results: {error}" + Fore.RESET)
78
+
79
+
80
+ class LangTraceFileSystem(AbstractFileSystem):
81
+ protocol = "langtracefs"
82
+ sep = "/"
83
+
84
+ def __init__(self, *args, **kwargs):
85
+ super().__init__(*args, **kwargs)
86
+ self.files = {}
87
+ self.dirs = set()
88
+
89
+ def open(
90
+ self,
91
+ path: str,
92
+ mode: OpenTextMode | OpenBinaryMode = "rb",
93
+ **kwargs,
94
+ ) -> Iterator[LangTraceFile | io.BytesIO]:
95
+ if "r" in mode:
96
+ dataset_id = path
97
+ # Fetch file from API and return a BytesIO object
98
+ file_data = self.fetch_file_from_api(dataset_id)
99
+ return io.BytesIO(file_data)
100
+ elif "w" in mode or "a" in mode:
101
+ return LangTraceFile(self, path, mode)
102
+ else:
103
+ raise ValueError(f"Unsupported mode: {mode}")
104
+
105
+ def fetch_file_from_api(self, dataset_id: str) -> bytes:
106
+ try:
107
+ print(Fore.GREEN + f"Fetching dataset with id: {dataset_id} from Langtrace" + Fore.RESET)
108
+ response = requests.get(
109
+ url=f"{LANGTRACE_REMOTE_URL}/api/dataset/download?id={dataset_id}",
110
+ headers={
111
+ "Content-Type": "application/json",
112
+ "x-api-key": os.environ.get("LANGTRACE_API_KEY")
113
+ },
114
+ timeout=20,
115
+ )
116
+ print(Fore.GREEN + f"Successfully fetched dataset with id: {dataset_id} from Langtrace" + Fore.RESET)
117
+ response.raise_for_status()
118
+ file_data = response.content
119
+ return file_data
120
+ except requests.exceptions.RequestException as error:
121
+ print(Fore.RED + f"Error fetching dataset with id: {dataset_id} from Langtrace: {error}" + Fore.RESET)
122
+ return b""
123
+
124
+ def makedirs(self, path: str, exist_ok: bool = False) -> None:
125
+ if not exist_ok and path in self.dirs:
126
+ raise FileExistsError(f"Directory {path} already exists")
127
+ self.dirs.add(path)
128
+
129
+ def info(self, path: str, **kwargs):
130
+ if path in self.files:
131
+ return {"name": path, "size": len(self.files[path]), "type": "file"}
132
+ elif path in self.dirs:
133
+ return {"name": path, "type": "directory"}
134
+ else:
135
+ raise FileNotFoundError(f"No such file or directory: {path}")
136
+
137
+ def created(self, path: str) -> float:
138
+ # Return a dummy creation time
139
+ return 0.0
140
+
141
+ def exists(self, path: str) -> bool:
142
+ return path in self.files or path in self.dirs
143
+
144
+ def ls(self, path: str, detail: bool = False, **kwargs):
145
+ if path not in self.dirs:
146
+ raise FileNotFoundError(f"No such directory: {path}")
147
+ entries = []
148
+ for file_path in self.files:
149
+ if file_path.startswith(path + self.sep):
150
+ if detail:
151
+ entries.append(self.info(file_path))
152
+ else:
153
+ entries.append(file_path)
154
+ for dir_path in self.dirs:
155
+ if dir_path.startswith(path + self.sep):
156
+ if detail:
157
+ entries.append(self.info(dir_path))
158
+ else:
159
+ entries.append(dir_path)
160
+ return entries
161
+
162
+ def walk(self, path: str, maxdepth: int = None, **kwargs):
163
+ for root, dirs, files in self._walk(path):
164
+ yield root, dirs, [self.sep.join([root, f]) for f in files]
165
+
166
+ def _walk(self, path: str):
167
+ if path in self.dirs:
168
+ dirs = [d for d in self.dirs if d.startswith(path + self.sep)]
169
+ files = [f for f in self.files if f.startswith(path + self.sep)]
170
+ yield path, [d.split(self.sep)[-1] for d in dirs], [f.split(self.sep)[-1] for f in files]
171
+ for d in dirs:
172
+ yield from self._walk(d)
173
+
174
+ def unstrip_protocol(self, path: str) -> str:
175
+ return path
176
+
177
+ def invalidate_cache(self, path: str = None) -> None:
178
+ pass
@@ -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.17"
@@ -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.15"