langtrace-python-sdk 2.3.12__tar.gz → 2.3.14__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.3.12 → langtrace_python_sdk-2.3.14}/PKG-INFO +32 -25
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/README.md +30 -24
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/pyproject.toml +1 -0
- langtrace_python_sdk-2.3.14/src/examples/autogen_example/__init__.py +8 -0
- langtrace_python_sdk-2.3.14/src/examples/autogen_example/main.py +72 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/langchain_example/__init__.py +2 -0
- langtrace_python_sdk-2.3.14/src/examples/langchain_example/langchain_google_example.py +29 -0
- langtrace_python_sdk-2.3.14/src/langtrace_python_sdk/constants/__init__.py +2 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/constants/instrumentation/common.py +1 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/__init__.py +2 -0
- langtrace_python_sdk-2.3.14/src/langtrace_python_sdk/instrumentation/autogen/__init__.py +3 -0
- langtrace_python_sdk-2.3.14/src/langtrace_python_sdk/instrumentation/autogen/instrumentation.py +42 -0
- langtrace_python_sdk-2.3.14/src/langtrace_python_sdk/instrumentation/autogen/patch.py +132 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/langchain/instrumentation.py +2 -7
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/langchain_core/instrumentation.py +14 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/langchain_core/patch.py +38 -17
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/weaviate/patch.py +9 -2
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/langtrace.py +28 -2
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/utils/__init__.py +18 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/utils/llm.py +12 -2
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/utils/sdk_version_checker.py +3 -0
- langtrace_python_sdk-2.3.14/src/langtrace_python_sdk/version.py +1 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/run_example.py +8 -2
- langtrace_python_sdk-2.3.12/src/langtrace_python_sdk/constants/__init__.py +0 -1
- langtrace_python_sdk-2.3.12/src/langtrace_python_sdk/version.py +0 -1
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/.gitignore +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/LICENSE +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/anthropic_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/anthropic_example/completion.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/azureopenai_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/azureopenai_example/completion.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/chroma_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/chroma_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/cohere_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/cohere_example/chat.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/cohere_example/chat_stream.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/cohere_example/embed.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/cohere_example/rerank.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/cohere_example/tools.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/crewai_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/crewai_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/crewai_example/instagram_post/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/crewai_example/instagram_post/agents.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/crewai_example/instagram_post/main.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/crewai_example/instagram_post/tasks.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/crewai_example/instagram_post/tools/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/crewai_example/instagram_post/tools/browser_tools.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/crewai_example/simple_agent/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/crewai_example/simple_agent/agents.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/crewai_example/simple_agent/main.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/crewai_example/simple_agent/tasks.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/crewai_example/trip_planner/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/crewai_example/trip_planner/agents.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/crewai_example/trip_planner/main.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/crewai_example/trip_planner/tasks.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/crewai_example/trip_planner/tools/calculator.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/crewai_example/trip_planner/tools/search_tools.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/dspy_example/math_problems_cot.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/dspy_example/math_problems_cot_parallel.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/dspy_example/program_of_thought_basic.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/dspy_example/quiz_gen.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/dspy_example/react.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/embedchain_example/simple.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/fastapi_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/fastapi_example/basic_route.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/gemini_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/gemini_example/function_tools.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/gemini_example/main.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/hiveagent_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/inspect_ai_example/basic_eval.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/langchain_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/langchain_example/groq_example.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/langchain_example/langgraph_example.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/langchain_example/langgraph_example_tools.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/langchain_example/sagemaker.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/langchain_example/tool.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/litellm_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/llamaindex_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/llamaindex_example/agent.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/llamaindex_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/llamaindex_example/data/abramov.txt +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/mistral_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/mistral_example/complete.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/mistral_example/complete_async.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/mistral_example/embeddings.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/ollama_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/ollama_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/openai_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/openai_example/async_tool_calling_nonstreaming.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/openai_example/async_tool_calling_streaming.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/openai_example/chat_completion.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/openai_example/chat_completion_tool_choice.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/openai_example/embeddings_create.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/openai_example/function_calling.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/openai_example/images_edit.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/openai_example/images_generate.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/openai_example/resources/lounge_flamingo.png +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/openai_example/resources/mask.png +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/openai_example/send_user_feedback.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/openai_example/tool_calling.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/openai_example/tool_calling_nonstreaming.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/openai_example/tool_calling_streaming.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/otlp_example/otlp_basic.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/otlp_example/otlp_with_langtrace.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/perplexity_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/pinecone_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/pinecone_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/qdrant_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/qdrant_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/routellm_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/vertexai_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/vertexai_example/main.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/weaviate_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/examples/weaviate_example/query_text.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/constants/exporter/langtrace_exporter.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/constants/instrumentation/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/constants/instrumentation/anthropic.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/constants/instrumentation/chroma.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/constants/instrumentation/cohere.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/constants/instrumentation/embedchain.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/constants/instrumentation/gemini.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/constants/instrumentation/groq.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/constants/instrumentation/mistral.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/constants/instrumentation/ollama.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/constants/instrumentation/openai.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/constants/instrumentation/pinecone.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/constants/instrumentation/qdrant.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/constants/instrumentation/vertexai.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/constants/instrumentation/weaviate.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/extensions/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/extensions/langtrace_exporter.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/extensions/langtrace_filesystem.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/anthropic/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/anthropic/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/anthropic/patch.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/anthropic/types.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/chroma/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/chroma/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/chroma/patch.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/cohere/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/cohere/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/cohere/patch.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/crewai/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/crewai/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/crewai/patch.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/dspy/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/dspy/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/dspy/patch.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/embedchain/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/embedchain/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/embedchain/patch.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/gemini/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/gemini/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/gemini/patch.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/groq/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/groq/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/groq/patch.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/langchain/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/langchain/patch.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/langchain_community/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/langchain_community/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/langchain_community/patch.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/langchain_core/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/langgraph/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/langgraph/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/langgraph/patch.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/llamaindex/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/llamaindex/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/llamaindex/patch.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/mistral/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/mistral/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/mistral/patch.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/ollama/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/ollama/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/ollama/patch.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/openai/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/openai/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/openai/patch.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/openai/types.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/pinecone/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/pinecone/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/pinecone/patch.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/qdrant/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/qdrant/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/qdrant/patch.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/vertexai/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/vertexai/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/vertexai/patch.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/weaviate/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/instrumentation/weaviate/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/types/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/utils/langtrace_sampler.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/utils/misc.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/utils/prompt_registry.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/utils/silently_fail.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/utils/types.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/langtrace_python_sdk/utils/with_root_span.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/__init__.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/anthropic/cassettes/test_anthropic.yaml +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/anthropic/cassettes/test_anthropic_streaming.yaml +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/anthropic/cassettes/test_async_anthropic_streaming.yaml +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/anthropic/conftest.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/anthropic/test_anthropic.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/chroma/conftest.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/chroma/test_chroma.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/cohere/cassettes/test_cohere_chat.yaml +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/cohere/cassettes/test_cohere_chat_streaming.yaml +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/cohere/cassettes/test_cohere_embed.yaml +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/cohere/cassettes/test_cohere_rerank.yaml +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/cohere/conftest.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/cohere/test_cohere_chat.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/cohere/test_cohere_embed.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/cohere/test_cohere_rerank.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/conftest.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/groq/cassettes/test_async_chat_completion.yaml +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/groq/cassettes/test_async_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/groq/cassettes/test_chat_completion.yaml +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/groq/cassettes/test_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/groq/conftest.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/groq/test_groq.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/langchain/cassettes/test_langchain.yaml +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/langchain/conftest.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/langchain/test_langchain.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/openai/cassettes/test_async_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/openai/cassettes/test_async_image_generation.yaml +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/openai/cassettes/test_chat_completion.yaml +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/openai/cassettes/test_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/openai/cassettes/test_image_generation.yaml +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/openai/conftest.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/openai/test_chat_completion.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/openai/test_embeddings.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/openai/test_image_generation.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/pinecone/cassettes/test_query.yaml +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/pinecone/cassettes/test_upsert.yaml +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/pinecone/conftest.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/pinecone/test_pinecone.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/qdrant/conftest.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/src/tests/qdrant/test_qdrant.py +0 -0
- {langtrace_python_sdk-2.3.12 → langtrace_python_sdk-2.3.14}/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.3.
|
|
3
|
+
Version: 2.3.14
|
|
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>
|
|
@@ -18,6 +18,7 @@ Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.25.0
|
|
|
18
18
|
Requires-Dist: opentelemetry-instrumentation-sqlalchemy>=0.46b0
|
|
19
19
|
Requires-Dist: opentelemetry-instrumentation>=0.47b0
|
|
20
20
|
Requires-Dist: opentelemetry-sdk>=1.25.0
|
|
21
|
+
Requires-Dist: sentry-sdk>=2.14.0
|
|
21
22
|
Requires-Dist: sqlalchemy
|
|
22
23
|
Requires-Dist: tiktoken>=0.1.1
|
|
23
24
|
Requires-Dist: trace-attributes==7.0.4
|
|
@@ -196,6 +197,10 @@ langtrace.init(custom_remote_exporter=<your_exporter>, batch=<True or False>)
|
|
|
196
197
|
| `api_host` | `Optional[str]` | `https://langtrace.ai/` | The API host for the remote exporter. |
|
|
197
198
|
| `disable_instrumentations` | `Optional[DisableInstrumentations]` | `None` | You can pass an object to disable instrumentation for specific vendors ex: `{'only': ['openai']}` or `{'all_except': ['openai']}` |
|
|
198
199
|
|
|
200
|
+
### Error Reporting to Langtrace
|
|
201
|
+
|
|
202
|
+
By default all sdk errors are reported to langtrace via Sentry. This can be disabled by setting the following enviroment variable to `False` like so `LANGTRACE_ERROR_REPORTING=False`
|
|
203
|
+
|
|
199
204
|
### Additional Customization
|
|
200
205
|
|
|
201
206
|
- `@with_langtrace_root_span` - this decorator is designed to organize and relate different spans, in a hierarchical manner. When you're performing multiple operations that you want to monitor together as a unit, this function helps by establishing a "parent" (`LangtraceRootSpan` or whatever is passed to `name`) span. Then, any calls to the LLM APIs made within the given function (fn) will be considered "children" of this parent span. This setup is especially useful for tracking the performance or behavior of a group of operations collectively, rather than individually.
|
|
@@ -277,6 +282,7 @@ prompt = get_prompt_from_registry(<Registry ID>, options={"prompt_version": 1, "
|
|
|
277
282
|
```
|
|
278
283
|
|
|
279
284
|
### Opt out of tracing prompt and completion data
|
|
285
|
+
|
|
280
286
|
By default, prompt and completion data are captured. If you would like to opt out of it, set the following env var,
|
|
281
287
|
|
|
282
288
|
`TRACE_PROMPT_COMPLETION_DATA=false`
|
|
@@ -285,30 +291,31 @@ By default, prompt and completion data are captured. If you would like to opt ou
|
|
|
285
291
|
|
|
286
292
|
Langtrace automatically captures traces from the following vendors:
|
|
287
293
|
|
|
288
|
-
| Vendor
|
|
289
|
-
|
|
|
290
|
-
| OpenAI
|
|
291
|
-
| Anthropic
|
|
292
|
-
| Azure OpenAI
|
|
293
|
-
| Cohere
|
|
294
|
-
| Groq
|
|
295
|
-
| Perplexity
|
|
296
|
-
| Gemini
|
|
297
|
-
| Mistral
|
|
298
|
-
| Langchain
|
|
299
|
-
| LlamaIndex
|
|
300
|
-
| Langgraph
|
|
301
|
-
| DSPy
|
|
302
|
-
| CrewAI
|
|
303
|
-
| Ollama
|
|
304
|
-
| VertexAI
|
|
305
|
-
| Vercel AI SDK| Framework | :white_check_mark: | :x: |
|
|
306
|
-
| EmbedChain
|
|
307
|
-
|
|
|
308
|
-
|
|
|
309
|
-
|
|
|
310
|
-
|
|
|
311
|
-
|
|
|
294
|
+
| Vendor | Type | Typescript SDK | Python SDK |
|
|
295
|
+
| ------------- | --------------- | ------------------ | ------------------------------- |
|
|
296
|
+
| OpenAI | LLM | :white_check_mark: | :white_check_mark: |
|
|
297
|
+
| Anthropic | LLM | :white_check_mark: | :white_check_mark: |
|
|
298
|
+
| Azure OpenAI | LLM | :white_check_mark: | :white_check_mark: |
|
|
299
|
+
| Cohere | LLM | :white_check_mark: | :white_check_mark: |
|
|
300
|
+
| Groq | LLM | :x: | :white_check_mark: |
|
|
301
|
+
| Perplexity | LLM | :white_check_mark: | :white_check_mark: |
|
|
302
|
+
| Gemini | LLM | :x: | :white_check_mark: |
|
|
303
|
+
| Mistral | LLM | :x: | :white_check_mark: |
|
|
304
|
+
| Langchain | Framework | :x: | :white_check_mark: |
|
|
305
|
+
| LlamaIndex | Framework | :white_check_mark: | :white_check_mark: |
|
|
306
|
+
| Langgraph | Framework | :x: | :white_check_mark: |
|
|
307
|
+
| DSPy | Framework | :x: | :white_check_mark: |
|
|
308
|
+
| CrewAI | Framework | :x: | :white_check_mark: |
|
|
309
|
+
| Ollama | Framework | :x: | :white_check_mark: |
|
|
310
|
+
| VertexAI | Framework | :x: | :white_check_mark: |
|
|
311
|
+
| Vercel AI SDK | Framework | :white_check_mark: | :x: |
|
|
312
|
+
| EmbedChain | Framework | :x: | :white_check_mark: |
|
|
313
|
+
| Autogen | Framework | :x: | :white_check_mark: |
|
|
314
|
+
| Pinecone | Vector Database | :white_check_mark: | :white_check_mark: |
|
|
315
|
+
| ChromaDB | Vector Database | :white_check_mark: | :white_check_mark: |
|
|
316
|
+
| QDrant | Vector Database | :white_check_mark: | :white_check_mark: |
|
|
317
|
+
| Weaviate | Vector Database | :white_check_mark: | :white_check_mark: |
|
|
318
|
+
| PGVector | Vector Database | :white_check_mark: | :white_check_mark: (SQLAlchemy) |
|
|
312
319
|
|
|
313
320
|
---
|
|
314
321
|
|
|
@@ -148,6 +148,10 @@ langtrace.init(custom_remote_exporter=<your_exporter>, batch=<True or False>)
|
|
|
148
148
|
| `api_host` | `Optional[str]` | `https://langtrace.ai/` | The API host for the remote exporter. |
|
|
149
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
|
+
### Error Reporting to Langtrace
|
|
152
|
+
|
|
153
|
+
By default all sdk errors are reported to langtrace via Sentry. This can be disabled by setting the following enviroment variable to `False` like so `LANGTRACE_ERROR_REPORTING=False`
|
|
154
|
+
|
|
151
155
|
### Additional Customization
|
|
152
156
|
|
|
153
157
|
- `@with_langtrace_root_span` - this decorator is designed to organize and relate different spans, in a hierarchical manner. When you're performing multiple operations that you want to monitor together as a unit, this function helps by establishing a "parent" (`LangtraceRootSpan` or whatever is passed to `name`) span. Then, any calls to the LLM APIs made within the given function (fn) will be considered "children" of this parent span. This setup is especially useful for tracking the performance or behavior of a group of operations collectively, rather than individually.
|
|
@@ -229,6 +233,7 @@ prompt = get_prompt_from_registry(<Registry ID>, options={"prompt_version": 1, "
|
|
|
229
233
|
```
|
|
230
234
|
|
|
231
235
|
### Opt out of tracing prompt and completion data
|
|
236
|
+
|
|
232
237
|
By default, prompt and completion data are captured. If you would like to opt out of it, set the following env var,
|
|
233
238
|
|
|
234
239
|
`TRACE_PROMPT_COMPLETION_DATA=false`
|
|
@@ -237,30 +242,31 @@ By default, prompt and completion data are captured. If you would like to opt ou
|
|
|
237
242
|
|
|
238
243
|
Langtrace automatically captures traces from the following vendors:
|
|
239
244
|
|
|
240
|
-
| Vendor
|
|
241
|
-
|
|
|
242
|
-
| OpenAI
|
|
243
|
-
| Anthropic
|
|
244
|
-
| Azure OpenAI
|
|
245
|
-
| Cohere
|
|
246
|
-
| Groq
|
|
247
|
-
| Perplexity
|
|
248
|
-
| Gemini
|
|
249
|
-
| Mistral
|
|
250
|
-
| Langchain
|
|
251
|
-
| LlamaIndex
|
|
252
|
-
| Langgraph
|
|
253
|
-
| DSPy
|
|
254
|
-
| CrewAI
|
|
255
|
-
| Ollama
|
|
256
|
-
| VertexAI
|
|
257
|
-
| Vercel AI SDK| Framework | :white_check_mark: | :x: |
|
|
258
|
-
| EmbedChain
|
|
259
|
-
|
|
|
260
|
-
|
|
|
261
|
-
|
|
|
262
|
-
|
|
|
263
|
-
|
|
|
245
|
+
| Vendor | Type | Typescript SDK | Python SDK |
|
|
246
|
+
| ------------- | --------------- | ------------------ | ------------------------------- |
|
|
247
|
+
| OpenAI | LLM | :white_check_mark: | :white_check_mark: |
|
|
248
|
+
| Anthropic | LLM | :white_check_mark: | :white_check_mark: |
|
|
249
|
+
| Azure OpenAI | LLM | :white_check_mark: | :white_check_mark: |
|
|
250
|
+
| Cohere | LLM | :white_check_mark: | :white_check_mark: |
|
|
251
|
+
| Groq | LLM | :x: | :white_check_mark: |
|
|
252
|
+
| Perplexity | LLM | :white_check_mark: | :white_check_mark: |
|
|
253
|
+
| Gemini | LLM | :x: | :white_check_mark: |
|
|
254
|
+
| Mistral | LLM | :x: | :white_check_mark: |
|
|
255
|
+
| Langchain | Framework | :x: | :white_check_mark: |
|
|
256
|
+
| LlamaIndex | Framework | :white_check_mark: | :white_check_mark: |
|
|
257
|
+
| Langgraph | Framework | :x: | :white_check_mark: |
|
|
258
|
+
| DSPy | Framework | :x: | :white_check_mark: |
|
|
259
|
+
| CrewAI | Framework | :x: | :white_check_mark: |
|
|
260
|
+
| Ollama | Framework | :x: | :white_check_mark: |
|
|
261
|
+
| VertexAI | Framework | :x: | :white_check_mark: |
|
|
262
|
+
| Vercel AI SDK | Framework | :white_check_mark: | :x: |
|
|
263
|
+
| EmbedChain | Framework | :x: | :white_check_mark: |
|
|
264
|
+
| Autogen | Framework | :x: | :white_check_mark: |
|
|
265
|
+
| Pinecone | Vector Database | :white_check_mark: | :white_check_mark: |
|
|
266
|
+
| ChromaDB | Vector Database | :white_check_mark: | :white_check_mark: |
|
|
267
|
+
| QDrant | Vector Database | :white_check_mark: | :white_check_mark: |
|
|
268
|
+
| Weaviate | Vector Database | :white_check_mark: | :white_check_mark: |
|
|
269
|
+
| PGVector | Vector Database | :white_check_mark: | :white_check_mark: (SQLAlchemy) |
|
|
264
270
|
|
|
265
271
|
---
|
|
266
272
|
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
from langtrace_python_sdk import langtrace
|
|
2
|
+
from autogen import ConversableAgent
|
|
3
|
+
from dotenv import load_dotenv
|
|
4
|
+
from autogen.coding import LocalCommandLineCodeExecutor
|
|
5
|
+
import tempfile
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
load_dotenv()
|
|
9
|
+
langtrace.init(write_spans_to_console=False)
|
|
10
|
+
# agentops.init(api_key=os.getenv("AGENTOPS_API_KEY"))
|
|
11
|
+
# Create a temporary directory to store the code files.
|
|
12
|
+
temp_dir = tempfile.TemporaryDirectory()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
# Create a local command line code executor.
|
|
16
|
+
executor = LocalCommandLineCodeExecutor(
|
|
17
|
+
timeout=10, # Timeout for each code execution in seconds.
|
|
18
|
+
work_dir=temp_dir.name, # Use the temporary directory to store the code files.
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def main():
|
|
23
|
+
|
|
24
|
+
agent = ConversableAgent(
|
|
25
|
+
"chatbot",
|
|
26
|
+
llm_config={"config_list": [{"model": "gpt-4"}], "cache_seed": None},
|
|
27
|
+
code_execution_config=False, # Turn off code execution, by default it is off.
|
|
28
|
+
function_map=None, # No registered functions, by default it is None.
|
|
29
|
+
human_input_mode="NEVER", # Never ask for human input.
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
reply = agent.generate_reply(
|
|
33
|
+
messages=[{"content": "Tell me a joke.", "role": "user"}]
|
|
34
|
+
)
|
|
35
|
+
return reply
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def comedy_show():
|
|
39
|
+
cathy = ConversableAgent(
|
|
40
|
+
name="cathy",
|
|
41
|
+
system_message="Your name is Cathy and you are a part of a duo of comedians.",
|
|
42
|
+
llm_config={
|
|
43
|
+
"config_list": [{"model": "gpt-4o-mini", "temperature": 0.9}],
|
|
44
|
+
"cache_seed": None,
|
|
45
|
+
},
|
|
46
|
+
description="Cathy is a comedian",
|
|
47
|
+
max_consecutive_auto_reply=10,
|
|
48
|
+
code_execution_config={
|
|
49
|
+
"executor": executor
|
|
50
|
+
}, # Use the local command line code executor.
|
|
51
|
+
function_map=None,
|
|
52
|
+
chat_messages=None,
|
|
53
|
+
silent=True,
|
|
54
|
+
default_auto_reply="Sorry, I don't know what to say.",
|
|
55
|
+
human_input_mode="NEVER", # Never ask for human input.
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
joe = ConversableAgent(
|
|
59
|
+
"joe",
|
|
60
|
+
system_message="Your name is Joe and you are a part of a duo of comedians.",
|
|
61
|
+
llm_config={
|
|
62
|
+
"config_list": [{"model": "gpt-4o-mini", "temperature": 0.7}],
|
|
63
|
+
"cache_seed": None,
|
|
64
|
+
},
|
|
65
|
+
human_input_mode="NEVER", # Never ask for human input.
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
result = joe.initiate_chat(
|
|
69
|
+
recipient=cathy, message="Cathy, tell me a joke.", max_turns=2
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
return result
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from examples.langchain_example.langchain_google_genai import basic_google_genai
|
|
1
2
|
from .basic import basic_app, rag, load_and_split
|
|
2
3
|
from langtrace_python_sdk import with_langtrace_root_span
|
|
3
4
|
|
|
@@ -12,6 +13,7 @@ class LangChainRunner:
|
|
|
12
13
|
rag()
|
|
13
14
|
load_and_split()
|
|
14
15
|
basic_graph_tools()
|
|
16
|
+
basic_google_genai()
|
|
15
17
|
|
|
16
18
|
|
|
17
19
|
class GroqRunner:
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from langchain_core.messages import HumanMessage
|
|
2
|
+
from langchain_google_genai import ChatGoogleGenerativeAI
|
|
3
|
+
from langtrace_python_sdk.utils.with_root_span import with_langtrace_root_span
|
|
4
|
+
from dotenv import find_dotenv, load_dotenv
|
|
5
|
+
from langtrace_python_sdk import langtrace
|
|
6
|
+
|
|
7
|
+
_ = load_dotenv(find_dotenv())
|
|
8
|
+
|
|
9
|
+
langtrace.init()
|
|
10
|
+
|
|
11
|
+
@with_langtrace_root_span("basic_google_genai")
|
|
12
|
+
def basic_google_genai():
|
|
13
|
+
llm = ChatGoogleGenerativeAI(model="gemini-1.5-flash")
|
|
14
|
+
# example
|
|
15
|
+
message = HumanMessage(
|
|
16
|
+
content=[
|
|
17
|
+
{
|
|
18
|
+
"type": "text",
|
|
19
|
+
"text": "What's in this image?",
|
|
20
|
+
},
|
|
21
|
+
]
|
|
22
|
+
)
|
|
23
|
+
message_image = HumanMessage(content="https://picsum.photos/seed/picsum/200/300")
|
|
24
|
+
|
|
25
|
+
res = llm.invoke([message, message_image])
|
|
26
|
+
# print(res)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
basic_google_genai()
|
|
@@ -14,6 +14,7 @@ from .qdrant import QdrantInstrumentation
|
|
|
14
14
|
from .weaviate import WeaviateInstrumentation
|
|
15
15
|
from .ollama import OllamaInstrumentor
|
|
16
16
|
from .dspy import DspyInstrumentation
|
|
17
|
+
from .autogen import AutogenInstrumentation
|
|
17
18
|
from .vertexai import VertexAIInstrumentation
|
|
18
19
|
from .gemini import GeminiInstrumentation
|
|
19
20
|
from .mistral import MistralInstrumentation
|
|
@@ -37,6 +38,7 @@ __all__ = [
|
|
|
37
38
|
"WeaviateInstrumentation",
|
|
38
39
|
"OllamaInstrumentor",
|
|
39
40
|
"DspyInstrumentation",
|
|
41
|
+
"AutogenInstrumentation",
|
|
40
42
|
"VertexAIInstrumentation",
|
|
41
43
|
"GeminiInstrumentation",
|
|
42
44
|
"MistralInstrumentation",
|
langtrace_python_sdk-2.3.14/src/langtrace_python_sdk/instrumentation/autogen/instrumentation.py
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
|
|
2
|
+
from opentelemetry.trace import get_tracer
|
|
3
|
+
from wrapt import wrap_function_wrapper as _W
|
|
4
|
+
from importlib_metadata import version as v
|
|
5
|
+
from .patch import patch_generate_reply, patch_initiate_chat
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class AutogenInstrumentation(BaseInstrumentor):
|
|
9
|
+
def instrumentation_dependencies(self):
|
|
10
|
+
return ["autogen >= 0.1.0"]
|
|
11
|
+
|
|
12
|
+
def _instrument(self, **kwargs):
|
|
13
|
+
print("Instrumneting autogen")
|
|
14
|
+
tracer_provider = kwargs.get("tracer_provider")
|
|
15
|
+
tracer = get_tracer(__name__, "", tracer_provider)
|
|
16
|
+
version = v("autogen")
|
|
17
|
+
# conversable_agent.intiate_chat
|
|
18
|
+
# conversable_agent.register_function
|
|
19
|
+
# agent.Agent
|
|
20
|
+
# AgentCreation
|
|
21
|
+
# Tools --> Register_for_llm, register_for_execution, register_for_function
|
|
22
|
+
try:
|
|
23
|
+
_W(
|
|
24
|
+
module="autogen.agentchat.conversable_agent",
|
|
25
|
+
name="ConversableAgent.initiate_chat",
|
|
26
|
+
wrapper=patch_initiate_chat(
|
|
27
|
+
"conversable_agent.initiate_chat", version, tracer
|
|
28
|
+
),
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
_W(
|
|
32
|
+
module="autogen.agentchat.conversable_agent",
|
|
33
|
+
name="ConversableAgent.generate_reply",
|
|
34
|
+
wrapper=patch_generate_reply(
|
|
35
|
+
"conversable_agent.generate_reply", version, tracer
|
|
36
|
+
),
|
|
37
|
+
)
|
|
38
|
+
except Exception as e:
|
|
39
|
+
pass
|
|
40
|
+
|
|
41
|
+
def _uninstrument(self, **kwargs):
|
|
42
|
+
pass
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
from langtrace_python_sdk.utils.llm import (
|
|
2
|
+
get_langtrace_attributes,
|
|
3
|
+
get_extra_attributes,
|
|
4
|
+
get_span_name,
|
|
5
|
+
set_span_attributes,
|
|
6
|
+
get_llm_request_attributes,
|
|
7
|
+
set_event_completion,
|
|
8
|
+
set_usage_attributes,
|
|
9
|
+
)
|
|
10
|
+
from langtrace_python_sdk.constants.instrumentation.common import SERVICE_PROVIDERS
|
|
11
|
+
from langtrace.trace_attributes import FrameworkSpanAttributes
|
|
12
|
+
from opentelemetry.trace.status import Status, StatusCode
|
|
13
|
+
from langtrace.trace_attributes import SpanAttributes
|
|
14
|
+
from opentelemetry.trace import Tracer, SpanKind
|
|
15
|
+
|
|
16
|
+
from langtrace_python_sdk.utils import deduce_args_and_kwargs, set_span_attribute
|
|
17
|
+
import json
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def patch_initiate_chat(name, version, tracer: Tracer):
|
|
21
|
+
def traced_method(wrapped, instance, args, kwargs):
|
|
22
|
+
all_params = deduce_args_and_kwargs(wrapped, *args, **kwargs)
|
|
23
|
+
all_params["recipient"] = json.dumps(parse_agent(all_params.get("recipient")))
|
|
24
|
+
span_attributes = {
|
|
25
|
+
**get_langtrace_attributes(
|
|
26
|
+
service_provider=SERVICE_PROVIDERS["AUTOGEN"],
|
|
27
|
+
version=version,
|
|
28
|
+
vendor_type="framework",
|
|
29
|
+
),
|
|
30
|
+
"sender": json.dumps(parse_agent(instance)),
|
|
31
|
+
**all_params,
|
|
32
|
+
}
|
|
33
|
+
attributes = FrameworkSpanAttributes(**span_attributes)
|
|
34
|
+
|
|
35
|
+
with tracer.start_as_current_span(
|
|
36
|
+
name=get_span_name(name), kind=SpanKind.CLIENT
|
|
37
|
+
) as span:
|
|
38
|
+
try:
|
|
39
|
+
set_span_attributes(span, attributes)
|
|
40
|
+
result = wrapped(*args, **kwargs)
|
|
41
|
+
# set_response_attributes(span, result)
|
|
42
|
+
return result
|
|
43
|
+
except Exception as err:
|
|
44
|
+
# Record the exception in the span
|
|
45
|
+
span.record_exception(err)
|
|
46
|
+
|
|
47
|
+
# Set the span status to indicate an error
|
|
48
|
+
span.set_status(Status(StatusCode.ERROR, str(err)))
|
|
49
|
+
|
|
50
|
+
# Reraise the exception to ensure it's not swallowed
|
|
51
|
+
raise
|
|
52
|
+
|
|
53
|
+
return traced_method
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def patch_generate_reply(name, version, tracer: Tracer):
|
|
57
|
+
|
|
58
|
+
def traced_method(wrapped, instance, args, kwargs):
|
|
59
|
+
|
|
60
|
+
llm_config = instance.llm_config
|
|
61
|
+
kwargs = {
|
|
62
|
+
**kwargs,
|
|
63
|
+
**llm_config.get("config_list")[0],
|
|
64
|
+
}
|
|
65
|
+
service_provider = SERVICE_PROVIDERS["AUTOGEN"]
|
|
66
|
+
|
|
67
|
+
span_attributes = {
|
|
68
|
+
**get_langtrace_attributes(
|
|
69
|
+
version=version,
|
|
70
|
+
service_provider=service_provider,
|
|
71
|
+
vendor_type="framework",
|
|
72
|
+
),
|
|
73
|
+
**get_llm_request_attributes(
|
|
74
|
+
kwargs,
|
|
75
|
+
prompts=kwargs.get("messages"),
|
|
76
|
+
),
|
|
77
|
+
**get_extra_attributes(),
|
|
78
|
+
}
|
|
79
|
+
attributes = FrameworkSpanAttributes(**span_attributes)
|
|
80
|
+
|
|
81
|
+
with tracer.start_as_current_span(
|
|
82
|
+
name=get_span_name(name), kind=SpanKind.CLIENT
|
|
83
|
+
) as span:
|
|
84
|
+
try:
|
|
85
|
+
|
|
86
|
+
result = wrapped(*args, **kwargs)
|
|
87
|
+
|
|
88
|
+
# if caching is disabled, return result as langtrace will instrument the rest.
|
|
89
|
+
if "cache_seed" in llm_config and llm_config.get("cache_seed") is None:
|
|
90
|
+
return result
|
|
91
|
+
|
|
92
|
+
set_span_attributes(span, attributes)
|
|
93
|
+
set_event_completion(span, [{"role": "assistant", "content": result}])
|
|
94
|
+
total_cost, response_model = list(instance.get_total_usage().keys())
|
|
95
|
+
set_span_attribute(
|
|
96
|
+
span, SpanAttributes.LLM_RESPONSE_MODEL, response_model
|
|
97
|
+
)
|
|
98
|
+
set_usage_attributes(
|
|
99
|
+
span, instance.get_total_usage().get(response_model)
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
return result
|
|
103
|
+
|
|
104
|
+
except Exception as err:
|
|
105
|
+
# Record the exception in the span
|
|
106
|
+
span.record_exception(err)
|
|
107
|
+
|
|
108
|
+
# Set the span status to indicate an error
|
|
109
|
+
span.set_status(Status(StatusCode.ERROR, str(err)))
|
|
110
|
+
|
|
111
|
+
# Reraise the exception to ensure it's not swallowed
|
|
112
|
+
raise
|
|
113
|
+
|
|
114
|
+
return traced_method
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def set_response_attributes(span, result):
|
|
118
|
+
summary = getattr(result, "summary", None)
|
|
119
|
+
if summary:
|
|
120
|
+
set_span_attribute(span, "autogen.chat.summary", summary)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def parse_agent(agent):
|
|
124
|
+
|
|
125
|
+
return {
|
|
126
|
+
"name": getattr(agent, "name", None),
|
|
127
|
+
"description": getattr(agent, "description", None),
|
|
128
|
+
"system_message": str(getattr(agent, "system_message", None)),
|
|
129
|
+
"silent": getattr(agent, "silent", None),
|
|
130
|
+
"llm_config": str(getattr(agent, "llm_config", None)),
|
|
131
|
+
"human_input_mode": getattr(agent, "human_input_mode", None),
|
|
132
|
+
}
|
|
@@ -81,21 +81,16 @@ class LangchainInstrumentation(BaseInstrumentor):
|
|
|
81
81
|
tracer_provider = kwargs.get("tracer_provider")
|
|
82
82
|
tracer = get_tracer(__name__, "", tracer_provider)
|
|
83
83
|
version = importlib.metadata.version("langchain")
|
|
84
|
-
|
|
85
84
|
wrap_function_wrapper(
|
|
86
85
|
"langchain.agents.agent",
|
|
87
86
|
"RunnableAgent.plan",
|
|
88
|
-
generic_patch(
|
|
89
|
-
"RunnableAgent.plan", "plan", tracer, version, True, True
|
|
90
|
-
),
|
|
87
|
+
generic_patch("RunnableAgent.plan", "plan", tracer, version, True, True),
|
|
91
88
|
)
|
|
92
89
|
|
|
93
90
|
wrap_function_wrapper(
|
|
94
91
|
"langchain.agents.agent",
|
|
95
92
|
"RunnableAgent.aplan",
|
|
96
|
-
generic_patch(
|
|
97
|
-
"RunnableAgent.aplan", "plan", tracer, version, True, True
|
|
98
|
-
),
|
|
93
|
+
generic_patch("RunnableAgent.aplan", "plan", tracer, version, True, True),
|
|
99
94
|
)
|
|
100
95
|
|
|
101
96
|
# modules_to_patch = []
|
|
@@ -134,6 +134,20 @@ class LangchainCoreInstrumentation(BaseInstrumentor):
|
|
|
134
134
|
]
|
|
135
135
|
|
|
136
136
|
modules_to_patch = [
|
|
137
|
+
(
|
|
138
|
+
"langchain_core.language_models.chat_models",
|
|
139
|
+
"chatmodel",
|
|
140
|
+
generic_patch,
|
|
141
|
+
True,
|
|
142
|
+
True,
|
|
143
|
+
),
|
|
144
|
+
(
|
|
145
|
+
"langchain_core.language_models.base",
|
|
146
|
+
"language_model",
|
|
147
|
+
generic_patch,
|
|
148
|
+
True,
|
|
149
|
+
True,
|
|
150
|
+
),
|
|
137
151
|
("langchain_core.retrievers", "retriever", generic_patch, True, True),
|
|
138
152
|
("langchain_core.prompts.chat", "prompt", generic_patch, True, True),
|
|
139
153
|
(
|
|
@@ -57,7 +57,24 @@ def generic_patch(
|
|
|
57
57
|
"langtrace.service.version": version,
|
|
58
58
|
"langtrace.version": v(LANGTRACE_SDK_NAME),
|
|
59
59
|
"langchain.task.name": task,
|
|
60
|
-
|
|
60
|
+
"gen_ai.request.model": (
|
|
61
|
+
instance.model if hasattr(instance, "model") else None
|
|
62
|
+
),
|
|
63
|
+
SpanAttributes.LLM_REQUEST_MAX_TOKENS: (
|
|
64
|
+
instance.max_output_tokens
|
|
65
|
+
if hasattr(instance, "max_output_tokens")
|
|
66
|
+
else None
|
|
67
|
+
),
|
|
68
|
+
SpanAttributes.LLM_TOP_K: (
|
|
69
|
+
instance.top_k if hasattr(instance, "top_k") else None
|
|
70
|
+
),
|
|
71
|
+
SpanAttributes.LLM_REQUEST_TOP_P: (
|
|
72
|
+
instance.top_p if hasattr(instance, "top_p") else None
|
|
73
|
+
),
|
|
74
|
+
SpanAttributes.LLM_REQUEST_TEMPERATURE: (
|
|
75
|
+
instance.temperature if hasattr(instance, "temperature") else None
|
|
76
|
+
),
|
|
77
|
+
**(extra_attributes if extra_attributes is not None else {}), # type: ignore
|
|
61
78
|
}
|
|
62
79
|
|
|
63
80
|
if trace_input and len(args) > 0:
|
|
@@ -79,21 +96,17 @@ def generic_patch(
|
|
|
79
96
|
try:
|
|
80
97
|
# Attempt to call the original method
|
|
81
98
|
result = wrapped(*args, **kwargs)
|
|
82
|
-
|
|
83
99
|
if trace_output:
|
|
84
100
|
span.set_attribute("langchain.outputs", to_json_string(result))
|
|
85
|
-
if hasattr(result,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
elif len(args) > 0 and len(args[0]) > 0 and hasattr(args[0][0], 'text') and isinstance(args[0][0].text, str) and hasattr(instance, 'get_num_tokens'):
|
|
95
|
-
span.set_attribute(SpanAttributes.LLM_USAGE_PROMPT_TOKENS, instance.get_num_tokens(args[0][0].text))
|
|
96
|
-
|
|
101
|
+
if hasattr(result, "usage_metadata"):
|
|
102
|
+
span.set_attribute(
|
|
103
|
+
SpanAttributes.LLM_USAGE_PROMPT_TOKENS,
|
|
104
|
+
result.usage_metadata["input_tokens"],
|
|
105
|
+
)
|
|
106
|
+
span.set_attribute(
|
|
107
|
+
SpanAttributes.LLM_USAGE_COMPLETION_TOKENS,
|
|
108
|
+
result.usage_metadata["output_tokens"],
|
|
109
|
+
)
|
|
97
110
|
span.set_status(StatusCode.OK)
|
|
98
111
|
return result
|
|
99
112
|
except Exception as err:
|
|
@@ -208,9 +221,17 @@ def clean_empty(d):
|
|
|
208
221
|
if not isinstance(d, (dict, list, tuple)):
|
|
209
222
|
return d
|
|
210
223
|
if isinstance(d, tuple):
|
|
211
|
-
return tuple(
|
|
224
|
+
return tuple(
|
|
225
|
+
val
|
|
226
|
+
for val in (clean_empty(val) for val in d)
|
|
227
|
+
if val != () and val is not None
|
|
228
|
+
)
|
|
212
229
|
if isinstance(d, list):
|
|
213
|
-
return [
|
|
230
|
+
return [
|
|
231
|
+
val
|
|
232
|
+
for val in (clean_empty(val) for val in d)
|
|
233
|
+
if val != [] and val is not None
|
|
234
|
+
]
|
|
214
235
|
result = {}
|
|
215
236
|
for k, val in d.items():
|
|
216
237
|
if isinstance(val, dict):
|
|
@@ -226,7 +247,7 @@ def clean_empty(d):
|
|
|
226
247
|
result[k] = val.strip()
|
|
227
248
|
elif isinstance(val, object):
|
|
228
249
|
# some langchain objects have a text attribute
|
|
229
|
-
val = getattr(val,
|
|
250
|
+
val = getattr(val, "text", None)
|
|
230
251
|
if val is not None and val.strip() != "":
|
|
231
252
|
result[k] = val.strip()
|
|
232
253
|
return result
|