langtrace-python-sdk 2.1.16__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.
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/.gitignore +2 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/PKG-INFO +2 -1
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/pyproject.toml +8 -4
- langtrace_python_sdk-2.1.17/src/examples/inspect_ai_example/basic_eval.py +28 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/__init__.py +5 -8
- langtrace_python_sdk-2.1.17/src/langtrace_python_sdk/extensions/langtrace_filesystem.py +178 -0
- langtrace_python_sdk-2.1.17/src/langtrace_python_sdk/version.py +1 -0
- langtrace_python_sdk-2.1.16/src/langtrace_python_sdk/version.py +0 -1
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/LICENSE +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/README.md +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/anthropic_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/anthropic_example/completion.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/chroma_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/chroma_example/basic.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/cohere_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/cohere_example/chat.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/cohere_example/chat_stream.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/cohere_example/embed.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/cohere_example/rerank.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/cohere_example/tools.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/fastapi_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/fastapi_example/basic_route.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/hiveagent_example/basic.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/langchain_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/langchain_example/basic.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/langchain_example/groq_example.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/langchain_example/langgraph_example.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/langchain_example/tool.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/llamaindex_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/llamaindex_example/agent.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/llamaindex_example/basic.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/llamaindex_example/data/abramov.txt +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/async_tool_calling_nonstreaming.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/async_tool_calling_streaming.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/chat_completion.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/embeddings_create.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/function_calling.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/images_edit.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/images_generate.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/resources/lounge_flamingo.png +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/resources/mask.png +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/tool_calling.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/tool_calling_nonstreaming.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/tool_calling_streaming.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/perplexity_example/basic.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/pinecone_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/pinecone_example/basic.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/qdrant_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/qdrant_example/basic.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/weaviate_example/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/weaviate_example/query_text.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/exporter/langtrace_exporter.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/instrumentation/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/instrumentation/anthropic.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/instrumentation/chroma.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/instrumentation/cohere.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/instrumentation/common.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/instrumentation/groq.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/instrumentation/openai.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/instrumentation/pinecone.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/instrumentation/qdrant.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/constants/instrumentation/weaviate.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/extensions/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/extensions/langtrace_exporter.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/anthropic/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/anthropic/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/anthropic/patch.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/chroma/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/chroma/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/chroma/patch.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/cohere/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/cohere/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/cohere/patch.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/groq/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/groq/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/groq/patch.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langchain/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langchain/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langchain/patch.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langchain_community/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langchain_community/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langchain_community/patch.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langchain_core/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langchain_core/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langchain_core/patch.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langgraph/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langgraph/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/langgraph/patch.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/llamaindex/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/llamaindex/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/llamaindex/patch.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/openai/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/openai/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/openai/patch.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/pinecone/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/pinecone/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/pinecone/patch.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/qdrant/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/qdrant/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/qdrant/patch.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/weaviate/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/weaviate/instrumentation.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/instrumentation/weaviate/patch.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/langtrace.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/types/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/utils/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/utils/llm.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/utils/misc.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/utils/prompt_registry.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/utils/sdk_version_checker.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/utils/silently_fail.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/utils/types.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/utils/with_root_span.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/run_example.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/__init__.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/anthropic/cassettes/test_anthropic.yaml +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/anthropic/cassettes/test_anthropic_streaming.yaml +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/anthropic/cassettes/test_async_anthropic_streaming.yaml +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/anthropic/conftest.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/anthropic/test_anthropic.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/chroma/conftest.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/chroma/test_chroma.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/cohere/cassettes/test_cohere_chat.yaml +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/cohere/cassettes/test_cohere_chat_streaming.yaml +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/cohere/cassettes/test_cohere_embed.yaml +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/cohere/cassettes/test_cohere_rerank.yaml +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/cohere/conftest.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/cohere/test_cohere_chat.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/cohere/test_cohere_embed.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/cohere/test_cohere_rerank.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/conftest.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/langchain/cassettes/test_langchain.yaml +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/langchain/conftest.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/langchain/test_langchain.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/openai/cassettes/test_async_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/openai/cassettes/test_async_image_generation.yaml +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/openai/cassettes/test_chat_completion.yaml +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/openai/cassettes/test_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/openai/cassettes/test_image_generation.yaml +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/openai/conftest.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/openai/test_chat_completion.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/openai/test_embeddings.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/openai/test_image_generation.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/pinecone/cassettes/test_query.yaml +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/pinecone/cassettes/test_upsert.yaml +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/pinecone/conftest.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/pinecone/test_pinecone.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/qdrant/conftest.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/qdrant/test_qdrant.py +0 -0
- {langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/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.
|
|
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
|
|
@@ -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
|
-
|
|
41
|
+
"qdrant-client",
|
|
41
42
|
"python-dotenv",
|
|
42
|
-
|
|
43
|
+
"pinecone-client",
|
|
43
44
|
"langchain",
|
|
44
|
-
|
|
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
|
+
)
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/__init__.py
RENAMED
|
@@ -15,16 +15,12 @@ limitations under the License.
|
|
|
15
15
|
"""
|
|
16
16
|
|
|
17
17
|
from langtrace_python_sdk import langtrace
|
|
18
|
-
from langtrace_python_sdk.
|
|
19
|
-
|
|
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
21
|
from langtrace_python_sdk.utils.with_root_span import (
|
|
25
|
-
SendUserFeedback,
|
|
26
|
-
|
|
27
|
-
)
|
|
22
|
+
SendUserFeedback, inject_additional_attributes, with_additional_attributes,
|
|
23
|
+
with_langtrace_root_span)
|
|
28
24
|
|
|
29
25
|
__all__ = [
|
|
30
26
|
"langtrace",
|
|
@@ -33,4 +29,5 @@ __all__ = [
|
|
|
33
29
|
"inject_additional_attributes",
|
|
34
30
|
"get_prompt_from_registry",
|
|
35
31
|
"SendUserFeedback",
|
|
32
|
+
"LangTraceFileSystem",
|
|
36
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.1.17"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.1.16"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/chroma_example/__init__.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/chroma_example/basic.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/cohere_example/__init__.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/cohere_example/chat.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/cohere_example/embed.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/cohere_example/rerank.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/cohere_example/tools.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/fastapi_example/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/hiveagent_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/langchain_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/langchain_example/tool.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/llamaindex_example/agent.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/llamaindex_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/openai_example/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/perplexity_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/pinecone_example/basic.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/qdrant_example/__init__.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/examples/qdrant_example/basic.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/langtrace.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/utils/llm.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/utils/misc.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/langtrace_python_sdk/utils/types.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/anthropic/test_anthropic.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/cohere/test_cohere_chat.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/cohere/test_cohere_embed.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/cohere/test_cohere_rerank.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/langchain/test_langchain.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/openai/test_chat_completion.py
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/openai/test_embeddings.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{langtrace_python_sdk-2.1.16 → langtrace_python_sdk-2.1.17}/src/tests/pinecone/test_pinecone.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|