langtrace-python-sdk 2.3.27__tar.gz → 3.0.2__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/PKG-INFO +1 -2
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/pyproject.toml +1 -2
- langtrace_python_sdk-3.0.2/src/langtrace_python_sdk/constants/exporter/langtrace_exporter.py +1 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/openai/patch.py +1 -2
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/vertexai/instrumentation.py +9 -1
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/vertexai/patch.py +10 -13
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/weaviate/instrumentation.py +0 -4
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/langtrace.py +123 -83
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/types/__init__.py +21 -15
- langtrace_python_sdk-3.0.2/src/langtrace_python_sdk/version.py +1 -0
- langtrace_python_sdk-2.3.27/src/langtrace_python_sdk/constants/exporter/langtrace_exporter.py +0 -1
- langtrace_python_sdk-2.3.27/src/langtrace_python_sdk/version.py +0 -1
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/.gitignore +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/LICENSE +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/README.md +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/anthropic_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/anthropic_example/completion.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/autogen_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/autogen_example/main.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/azureopenai_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/azureopenai_example/completion.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/chroma_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/chroma_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/cohere_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/cohere_example/chat.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/cohere_example/chat_stream.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/cohere_example/embed.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/cohere_example/rerank.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/cohere_example/tools.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/crewai_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/crewai_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/crewai_example/instagram_post/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/crewai_example/instagram_post/agents.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/crewai_example/instagram_post/main.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/crewai_example/instagram_post/tasks.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/crewai_example/instagram_post/tools/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/crewai_example/instagram_post/tools/browser_tools.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/crewai_example/simple_agent/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/crewai_example/simple_agent/agents.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/crewai_example/simple_agent/main.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/crewai_example/simple_agent/tasks.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/crewai_example/trip_planner/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/crewai_example/trip_planner/agents.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/crewai_example/trip_planner/main.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/crewai_example/trip_planner/tasks.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/crewai_example/trip_planner/tools/calculator.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/crewai_example/trip_planner/tools/search_tools.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/dspy_example/QA_basic.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/dspy_example/QA_basic_with_chain_of_thought.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/dspy_example/QA_basic_with_signature.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/dspy_example/QA_multi_step_with_chain_of_thought.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/dspy_example/math_problems_cot.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/dspy_example/math_problems_cot_parallel.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/dspy_example/optimizers/bootstrap_fewshot.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/dspy_example/program_of_thought_basic.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/dspy_example/quiz_gen.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/dspy_example/react.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/embedchain_example/simple.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/fastapi_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/fastapi_example/basic_route.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/gemini_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/gemini_example/function_tools.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/gemini_example/main.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/hiveagent_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/inspect_ai_example/basic_eval.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/langchain_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/langchain_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/langchain_example/groq_example.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/langchain_example/langchain_google_example.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/langchain_example/langgraph_example.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/langchain_example/langgraph_example_tools.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/langchain_example/sagemaker.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/langchain_example/tool.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/litellm_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/llamaindex_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/llamaindex_example/agent.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/llamaindex_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/llamaindex_example/data/abramov.txt +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/mistral_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/mistral_example/complete.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/mistral_example/complete_async.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/mistral_example/embeddings.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/ollama_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/ollama_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/openai_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/openai_example/async_tool_calling_nonstreaming.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/openai_example/async_tool_calling_streaming.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/openai_example/chat_completion.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/openai_example/chat_completion_tool_choice.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/openai_example/embeddings_create.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/openai_example/function_calling.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/openai_example/images_edit.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/openai_example/images_generate.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/openai_example/resources/lounge_flamingo.png +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/openai_example/resources/mask.png +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/openai_example/send_user_feedback.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/openai_example/tool_calling.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/openai_example/tool_calling_nonstreaming.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/openai_example/tool_calling_streaming.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/otlp_example/otlp_basic.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/otlp_example/otlp_with_langtrace.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/perplexity_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/pinecone_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/pinecone_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/qdrant_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/qdrant_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/routellm_example/basic.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/vertexai_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/vertexai_example/main.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/weaviate_example/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/weaviate_example/query_text.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/constants/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/constants/instrumentation/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/constants/instrumentation/anthropic.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/constants/instrumentation/chroma.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/constants/instrumentation/cohere.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/constants/instrumentation/common.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/constants/instrumentation/embedchain.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/constants/instrumentation/gemini.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/constants/instrumentation/groq.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/constants/instrumentation/litellm.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/constants/instrumentation/mistral.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/constants/instrumentation/ollama.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/constants/instrumentation/openai.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/constants/instrumentation/pinecone.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/constants/instrumentation/qdrant.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/constants/instrumentation/vertexai.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/constants/instrumentation/weaviate.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/extensions/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/extensions/langtrace_exporter.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/extensions/langtrace_filesystem.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/anthropic/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/anthropic/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/anthropic/patch.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/anthropic/types.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/autogen/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/autogen/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/autogen/patch.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/chroma/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/chroma/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/chroma/patch.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/cohere/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/cohere/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/cohere/patch.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/crewai/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/crewai/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/crewai/patch.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/dspy/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/dspy/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/dspy/patch.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/embedchain/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/embedchain/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/embedchain/patch.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/gemini/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/gemini/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/gemini/patch.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/groq/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/groq/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/groq/patch.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/langchain/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/langchain/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/langchain/patch.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/langchain_community/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/langchain_community/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/langchain_community/patch.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/langchain_core/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/langchain_core/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/langchain_core/patch.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/langgraph/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/langgraph/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/langgraph/patch.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/litellm/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/litellm/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/litellm/patch.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/litellm/types.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/llamaindex/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/llamaindex/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/llamaindex/patch.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/mistral/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/mistral/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/mistral/patch.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/ollama/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/ollama/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/ollama/patch.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/openai/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/openai/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/openai/types.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/pinecone/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/pinecone/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/pinecone/patch.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/qdrant/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/qdrant/instrumentation.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/qdrant/patch.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/vertexai/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/weaviate/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/instrumentation/weaviate/patch.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/utils/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/utils/langtrace_sampler.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/utils/llm.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/utils/misc.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/utils/prompt_registry.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/utils/sdk_version_checker.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/utils/silently_fail.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/utils/types.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/utils/with_root_span.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/run_example.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/__init__.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/anthropic/cassettes/test_anthropic.yaml +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/anthropic/cassettes/test_anthropic_streaming.yaml +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/anthropic/cassettes/test_async_anthropic_streaming.yaml +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/anthropic/conftest.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/anthropic/test_anthropic.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/chroma/conftest.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/chroma/test_chroma.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/cohere/cassettes/test_cohere_chat.yaml +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/cohere/cassettes/test_cohere_chat_streaming.yaml +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/cohere/cassettes/test_cohere_embed.yaml +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/cohere/cassettes/test_cohere_rerank.yaml +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/cohere/conftest.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/cohere/test_cohere_chat.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/cohere/test_cohere_embed.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/cohere/test_cohere_rerank.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/conftest.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/groq/cassettes/test_async_chat_completion.yaml +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/groq/cassettes/test_async_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/groq/cassettes/test_chat_completion.yaml +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/groq/cassettes/test_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/groq/conftest.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/groq/test_groq.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/langchain/cassettes/test_langchain.yaml +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/langchain/conftest.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/langchain/test_langchain.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/openai/cassettes/test_async_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/openai/cassettes/test_async_image_generation.yaml +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/openai/cassettes/test_chat_completion.yaml +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/openai/cassettes/test_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/openai/cassettes/test_image_generation.yaml +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/openai/conftest.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/openai/test_chat_completion.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/openai/test_embeddings.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/openai/test_image_generation.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/pinecone/cassettes/test_query.yaml +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/pinecone/cassettes/test_upsert.yaml +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/pinecone/conftest.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/pinecone/test_pinecone.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/qdrant/conftest.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/qdrant/test_qdrant.py +0 -0
- {langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/tests/utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: langtrace-python-sdk
|
3
|
-
Version:
|
3
|
+
Version: 3.0.2
|
4
4
|
Summary: Python SDK for LangTrace
|
5
5
|
Project-URL: Homepage, https://github.com/Scale3-Labs/langtrace-python-sdk
|
6
6
|
Author-email: Scale3 Labs <engineering@scale3labs.com>
|
@@ -42,7 +42,6 @@ Requires-Dist: openai==1.45.0; extra == 'dev'
|
|
42
42
|
Requires-Dist: pinecone-client; extra == 'dev'
|
43
43
|
Requires-Dist: python-dotenv; extra == 'dev'
|
44
44
|
Requires-Dist: qdrant-client; extra == 'dev'
|
45
|
-
Requires-Dist: typing-extensions; extra == 'dev'
|
46
45
|
Requires-Dist: weaviate-client; extra == 'dev'
|
47
46
|
Provides-Extra: test
|
48
47
|
Requires-Dist: pytest; extra == 'test'
|
@@ -0,0 +1 @@
|
|
1
|
+
LANGTRACE_REMOTE_URL = "https://app.langtrace.ai"
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import json
|
2
|
-
import openai
|
3
2
|
from typing import Any, Dict, List, Optional, Callable, Awaitable, Union
|
4
3
|
from langtrace.trace_attributes import (
|
5
4
|
LLMSpanAttributes,
|
@@ -46,7 +45,7 @@ def filter_valid_attributes(attributes):
|
|
46
45
|
return {
|
47
46
|
key: value
|
48
47
|
for key, value in attributes.items()
|
49
|
-
if value is not None and value !=
|
48
|
+
if value is not None and value != NOT_GIVEN and value != ""
|
50
49
|
}
|
51
50
|
|
52
51
|
|
@@ -5,16 +5,24 @@ from wrapt import wrap_function_wrapper as _W
|
|
5
5
|
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
|
6
6
|
from opentelemetry.trace import get_tracer
|
7
7
|
from .patch import patch_vertexai
|
8
|
+
from langtrace_python_sdk.utils import is_package_installed
|
8
9
|
|
9
10
|
|
10
11
|
class VertexAIInstrumentation(BaseInstrumentor):
|
11
12
|
def instrumentation_dependencies(self) -> Collection[str]:
|
13
|
+
if is_package_installed("vertexai"):
|
14
|
+
return ["vertexai >= 1.0.0"]
|
15
|
+
|
12
16
|
return ["google-cloud-aiplatform >= 1.0.0"]
|
13
17
|
|
14
18
|
def _instrument(self, **kwargs):
|
15
19
|
trace_provider = kwargs.get("tracer_provider")
|
16
20
|
tracer = get_tracer(__name__, "", trace_provider)
|
17
|
-
version =
|
21
|
+
version = (
|
22
|
+
v("vertexai")
|
23
|
+
if is_package_installed("vertexai")
|
24
|
+
else v("google-cloud-aiplatform")
|
25
|
+
)
|
18
26
|
|
19
27
|
for _, api_config in APIS.items():
|
20
28
|
|
@@ -103,27 +103,24 @@ def is_streaming_response(response):
|
|
103
103
|
|
104
104
|
def get_llm_model(instance):
|
105
105
|
if hasattr(instance, "_model_name"):
|
106
|
-
return instance._model_name.replace("models/", "")
|
106
|
+
return instance._model_name.replace("publishers/google/models/", "")
|
107
107
|
return getattr(instance, "_model_id", "unknown")
|
108
108
|
|
109
109
|
|
110
110
|
def serialize_prompts(args, kwargs):
|
111
|
-
|
112
|
-
|
111
|
+
if args and len(args) > 0:
|
112
|
+
prompt_parts = []
|
113
113
|
for arg in args:
|
114
114
|
if isinstance(arg, str):
|
115
|
-
|
115
|
+
prompt_parts.append(arg)
|
116
116
|
elif isinstance(arg, list):
|
117
117
|
for subarg in arg:
|
118
118
|
if type(subarg).__name__ == "Part":
|
119
|
-
|
119
|
+
prompt_parts.append(json.dumps(subarg.to_dict()))
|
120
120
|
else:
|
121
|
-
|
121
|
+
prompt_parts.append(str(subarg))
|
122
|
+
|
123
|
+
return [{"role": "user", "content": "\n".join(prompt_parts)}]
|
122
124
|
else:
|
123
|
-
|
124
|
-
|
125
|
-
"role": "user",
|
126
|
-
"content": kwargs.get("prompt") or kwargs.get("message"),
|
127
|
-
}
|
128
|
-
]
|
129
|
-
return prompt
|
125
|
+
content = kwargs.get("prompt") or kwargs.get("message")
|
126
|
+
return [{"role": "user", "content": content}] if content else []
|
@@ -52,10 +52,6 @@ class WeaviateInstrumentation(BaseInstrumentor):
|
|
52
52
|
generic_query_patch(api_name, version, tracer),
|
53
53
|
)
|
54
54
|
elif api_config.get("OPERATION") == "create":
|
55
|
-
print(
|
56
|
-
api_config["MODULE"],
|
57
|
-
api_config["METHOD"],
|
58
|
-
)
|
59
55
|
wrap_function_wrapper(
|
60
56
|
api_config["MODULE"],
|
61
57
|
api_config["METHOD"],
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/langtrace_python_sdk/langtrace.py
RENAMED
@@ -16,7 +16,9 @@ limitations under the License.
|
|
16
16
|
|
17
17
|
import os
|
18
18
|
import sys
|
19
|
-
|
19
|
+
import sentry_sdk
|
20
|
+
import logging
|
21
|
+
from typing import Dict, Optional, Any
|
20
22
|
from colorama import Fore
|
21
23
|
from langtrace_python_sdk.constants import LANGTRACE_SDK_NAME, SENTRY_DSN
|
22
24
|
from opentelemetry import trace
|
@@ -57,11 +59,7 @@ from langtrace_python_sdk.instrumentation import (
|
|
57
59
|
VertexAIInstrumentation,
|
58
60
|
WeaviateInstrumentation,
|
59
61
|
)
|
60
|
-
from langtrace_python_sdk.types import
|
61
|
-
DisableInstrumentations,
|
62
|
-
InstrumentationMethods,
|
63
|
-
InstrumentationType,
|
64
|
-
)
|
62
|
+
from langtrace_python_sdk.types import DisableInstrumentations, InstrumentationMethods
|
65
63
|
from langtrace_python_sdk.utils import (
|
66
64
|
check_if_sdk_is_outdated,
|
67
65
|
get_sdk_version,
|
@@ -69,62 +67,143 @@ from langtrace_python_sdk.utils import (
|
|
69
67
|
validate_instrumentations,
|
70
68
|
)
|
71
69
|
from langtrace_python_sdk.utils.langtrace_sampler import LangtraceSampler
|
72
|
-
import sentry_sdk
|
73
70
|
from sentry_sdk.types import Event, Hint
|
74
71
|
|
72
|
+
logging.disable(level=logging.INFO)
|
73
|
+
|
74
|
+
|
75
|
+
class LangtraceConfig:
|
76
|
+
def __init__(self, **kwargs):
|
77
|
+
self.api_key = kwargs.get("api_key")
|
78
|
+
self.batch = kwargs.get("batch", True)
|
79
|
+
self.write_spans_to_console = kwargs.get("write_spans_to_console", False)
|
80
|
+
self.custom_remote_exporter = kwargs.get("custom_remote_exporter")
|
81
|
+
self.api_host = kwargs.get("api_host", LANGTRACE_REMOTE_URL)
|
82
|
+
self.disable_instrumentations = kwargs.get("disable_instrumentations")
|
83
|
+
self.disable_tracing_for_functions = kwargs.get("disable_tracing_for_functions")
|
84
|
+
self.service_name = kwargs.get("service_name")
|
85
|
+
self.disable_logging = kwargs.get("disable_logging", False)
|
86
|
+
self.headers = kwargs.get("headers", {})
|
87
|
+
|
88
|
+
|
89
|
+
def get_host(config: LangtraceConfig) -> str:
|
90
|
+
return (
|
91
|
+
os.environ.get("LANGTRACE_API_HOST")
|
92
|
+
or os.environ.get("OTEL_EXPORTER_OTLP_TRACES_ENDPOINT")
|
93
|
+
or os.environ.get("OTEL_EXPORTER_OTLP_ENDPOINT")
|
94
|
+
or config.api_host
|
95
|
+
or LANGTRACE_REMOTE_URL
|
96
|
+
)
|
97
|
+
|
98
|
+
|
99
|
+
def setup_tracer_provider(config: LangtraceConfig, host: str) -> TracerProvider:
|
100
|
+
sampler = LangtraceSampler(disabled_methods=config.disable_tracing_for_functions)
|
101
|
+
resource = Resource.create(
|
102
|
+
attributes={
|
103
|
+
SERVICE_NAME: os.environ.get("OTEL_SERVICE_NAME")
|
104
|
+
or config.service_name
|
105
|
+
or sys.argv[0]
|
106
|
+
}
|
107
|
+
)
|
108
|
+
return TracerProvider(resource=resource, sampler=sampler)
|
109
|
+
|
110
|
+
|
111
|
+
def get_exporter(config: LangtraceConfig, host: str):
|
112
|
+
if config.custom_remote_exporter:
|
113
|
+
return config.custom_remote_exporter
|
114
|
+
|
115
|
+
return LangTraceExporter(host, config.api_key, config.disable_logging)
|
116
|
+
|
117
|
+
|
118
|
+
def add_span_processor(provider: TracerProvider, config: LangtraceConfig, exporter):
|
119
|
+
if config.write_spans_to_console:
|
120
|
+
provider.add_span_processor(SimpleSpanProcessor(ConsoleSpanExporter()))
|
121
|
+
print(Fore.BLUE + "Writing spans to console" + Fore.RESET)
|
122
|
+
|
123
|
+
elif config.custom_remote_exporter or get_host(config) != LANGTRACE_REMOTE_URL:
|
124
|
+
processor = (
|
125
|
+
BatchSpanProcessor(exporter)
|
126
|
+
if config.batch
|
127
|
+
else SimpleSpanProcessor(exporter)
|
128
|
+
)
|
129
|
+
provider.add_span_processor(processor)
|
130
|
+
print(
|
131
|
+
Fore.BLUE
|
132
|
+
+ f"Exporting spans to custom host: {get_host(config)}.."
|
133
|
+
+ Fore.RESET
|
134
|
+
)
|
135
|
+
else:
|
136
|
+
provider.add_span_processor(BatchSpanProcessor(exporter))
|
137
|
+
print(Fore.BLUE + "Exporting spans to Langtrace cloud.." + Fore.RESET)
|
138
|
+
|
139
|
+
|
140
|
+
def init_sentry(config: LangtraceConfig, host: str):
|
141
|
+
if os.environ.get("LANGTRACE_ERROR_REPORTING", "True") == "True":
|
142
|
+
sentry_sdk.init(
|
143
|
+
dsn=SENTRY_DSN,
|
144
|
+
traces_sample_rate=1.0,
|
145
|
+
profiles_sample_rate=1.0,
|
146
|
+
before_send=before_send,
|
147
|
+
)
|
148
|
+
sdk_options = {
|
149
|
+
"service_name": os.environ.get("OTEL_SERVICE_NAME")
|
150
|
+
or config.service_name
|
151
|
+
or sys.argv[0],
|
152
|
+
"disable_logging": config.disable_logging,
|
153
|
+
"disable_instrumentations": config.disable_instrumentations,
|
154
|
+
"disable_tracing_for_functions": config.disable_tracing_for_functions,
|
155
|
+
"batch": config.batch,
|
156
|
+
"write_spans_to_console": config.write_spans_to_console,
|
157
|
+
"custom_remote_exporter": config.custom_remote_exporter,
|
158
|
+
"sdk_name": LANGTRACE_SDK_NAME,
|
159
|
+
"sdk_version": get_sdk_version(),
|
160
|
+
"api_host": host,
|
161
|
+
}
|
162
|
+
sentry_sdk.set_context("sdk_init_options", sdk_options)
|
163
|
+
|
75
164
|
|
76
165
|
def init(
|
77
|
-
api_key: str = None,
|
166
|
+
api_key: Optional[str] = None,
|
78
167
|
batch: bool = True,
|
79
168
|
write_spans_to_console: bool = False,
|
80
|
-
custom_remote_exporter=None,
|
169
|
+
custom_remote_exporter: Optional[Any] = None,
|
81
170
|
api_host: Optional[str] = LANGTRACE_REMOTE_URL,
|
82
171
|
disable_instrumentations: Optional[DisableInstrumentations] = None,
|
83
172
|
disable_tracing_for_functions: Optional[InstrumentationMethods] = None,
|
84
173
|
service_name: Optional[str] = None,
|
85
|
-
disable_logging=False,
|
174
|
+
disable_logging: bool = False,
|
175
|
+
headers: Dict[str, str] = {},
|
86
176
|
):
|
87
|
-
|
177
|
+
logging.disable(level=logging.INFO)
|
178
|
+
check_if_sdk_is_outdated()
|
179
|
+
config = LangtraceConfig(
|
180
|
+
api_key=api_key,
|
181
|
+
batch=batch,
|
182
|
+
write_spans_to_console=write_spans_to_console,
|
183
|
+
custom_remote_exporter=custom_remote_exporter,
|
184
|
+
api_host=api_host,
|
185
|
+
disable_instrumentations=disable_instrumentations,
|
186
|
+
disable_tracing_for_functions=disable_tracing_for_functions,
|
187
|
+
service_name=service_name,
|
188
|
+
disable_logging=disable_logging,
|
189
|
+
headers=headers,
|
190
|
+
)
|
191
|
+
|
192
|
+
if config.disable_logging:
|
88
193
|
sys.stdout = open(os.devnull, "w")
|
89
194
|
|
90
|
-
host = (
|
91
|
-
os.environ.get("LANGTRACE_API_HOST", None)
|
92
|
-
or os.environ.get("OTEL_EXPORTER_OTLP_TRACES_ENDPOINT", None)
|
93
|
-
or os.environ.get("OTEL_EXPORTER_OTLP_ENDPOINT", None)
|
94
|
-
or api_host
|
95
|
-
or LANGTRACE_REMOTE_URL
|
96
|
-
)
|
97
|
-
check_if_sdk_is_outdated()
|
195
|
+
host = get_host(config)
|
98
196
|
print(Fore.GREEN + "Initializing Langtrace SDK.." + Fore.RESET)
|
99
197
|
print(
|
100
198
|
Fore.WHITE
|
101
199
|
+ "⭐ Leave our github a star to stay on top of our updates - https://github.com/Scale3-Labs/langtrace"
|
102
200
|
+ Fore.RESET
|
103
201
|
)
|
104
|
-
sampler = LangtraceSampler(disabled_methods=disable_tracing_for_functions)
|
105
|
-
resource = Resource.create(
|
106
|
-
attributes={
|
107
|
-
SERVICE_NAME: os.environ.get("OTEL_SERVICE_NAME")
|
108
|
-
or service_name
|
109
|
-
or sys.argv[0]
|
110
|
-
}
|
111
|
-
)
|
112
|
-
provider = TracerProvider(resource=resource, sampler=sampler)
|
113
202
|
|
114
|
-
|
115
|
-
|
116
|
-
api_key=api_key, api_host=host, disable_logging=disable_logging
|
117
|
-
)
|
118
|
-
if custom_remote_exporter is None
|
119
|
-
else custom_remote_exporter
|
120
|
-
)
|
121
|
-
console_exporter = ConsoleSpanExporter()
|
122
|
-
batch_processor_remote = BatchSpanProcessor(remote_write_exporter)
|
123
|
-
simple_processor_remote = SimpleSpanProcessor(remote_write_exporter)
|
124
|
-
simple_processor_console = SimpleSpanProcessor(console_exporter)
|
203
|
+
provider = setup_tracer_provider(config, host)
|
204
|
+
exporter = get_exporter(config, host)
|
125
205
|
|
126
206
|
os.environ["LANGTRACE_API_HOST"] = host.replace("/api/trace", "")
|
127
|
-
# Initialize tracer
|
128
207
|
trace.set_tracer_provider(provider)
|
129
208
|
all_instrumentations = {
|
130
209
|
"openai": OpenAIInstrumentation(),
|
@@ -146,57 +225,18 @@ def init(
|
|
146
225
|
"ollama": OllamaInstrumentor(),
|
147
226
|
"dspy-ai": DspyInstrumentation(),
|
148
227
|
"crewai": CrewAIInstrumentation(),
|
228
|
+
"vertexai": VertexAIInstrumentation(),
|
149
229
|
"google-cloud-aiplatform": VertexAIInstrumentation(),
|
150
230
|
"google-generativeai": GeminiInstrumentation(),
|
151
231
|
"mistralai": MistralInstrumentation(),
|
152
232
|
"autogen": AutogenInstrumentation(),
|
153
233
|
}
|
154
234
|
|
155
|
-
init_instrumentations(disable_instrumentations, all_instrumentations)
|
156
|
-
|
157
|
-
print(Fore.BLUE + "Writing spans to console" + Fore.RESET)
|
158
|
-
provider.add_span_processor(simple_processor_console)
|
159
|
-
|
160
|
-
elif custom_remote_exporter is not None:
|
161
|
-
print(Fore.BLUE + "Exporting spans to custom remote exporter.." + Fore.RESET)
|
162
|
-
if batch:
|
163
|
-
provider.add_span_processor(batch_processor_remote)
|
164
|
-
else:
|
165
|
-
provider.add_span_processor(simple_processor_remote)
|
166
|
-
|
167
|
-
elif host != LANGTRACE_REMOTE_URL:
|
168
|
-
print(Fore.BLUE + f"Exporting spans to custom host: {host}.." + Fore.RESET)
|
169
|
-
if batch:
|
170
|
-
provider.add_span_processor(batch_processor_remote)
|
171
|
-
else:
|
172
|
-
provider.add_span_processor(simple_processor_remote)
|
173
|
-
else:
|
174
|
-
print(Fore.BLUE + "Exporting spans to Langtrace cloud.." + Fore.RESET)
|
175
|
-
provider.add_span_processor(batch_processor_remote)
|
235
|
+
init_instrumentations(config.disable_instrumentations, all_instrumentations)
|
236
|
+
add_span_processor(provider, config, exporter)
|
176
237
|
|
177
238
|
sys.stdout = sys.__stdout__
|
178
|
-
|
179
|
-
sentry_sdk.init(
|
180
|
-
dsn=SENTRY_DSN,
|
181
|
-
traces_sample_rate=1.0,
|
182
|
-
profiles_sample_rate=1.0,
|
183
|
-
before_send=before_send,
|
184
|
-
)
|
185
|
-
sdk_options = {
|
186
|
-
"service_name": os.environ.get("OTEL_SERVICE_NAME")
|
187
|
-
or service_name
|
188
|
-
or sys.argv[0],
|
189
|
-
"disable_logging": disable_logging,
|
190
|
-
"disable_instrumentations": disable_instrumentations,
|
191
|
-
"disable_tracing_for_functions": disable_tracing_for_functions,
|
192
|
-
"batch": batch,
|
193
|
-
"write_spans_to_console": write_spans_to_console,
|
194
|
-
"custom_remote_exporter": custom_remote_exporter,
|
195
|
-
"sdk_name": LANGTRACE_SDK_NAME,
|
196
|
-
"sdk_version": get_sdk_version(),
|
197
|
-
"api_host": host,
|
198
|
-
}
|
199
|
-
sentry_sdk.set_context("sdk_init_options", sdk_options)
|
239
|
+
init_sentry(config, host)
|
200
240
|
|
201
241
|
|
202
242
|
def before_send(event: Event, hint: Hint):
|
@@ -3,27 +3,33 @@ from enum import Enum
|
|
3
3
|
|
4
4
|
|
5
5
|
class InstrumentationType(Enum):
|
6
|
-
OPENAI = "openai"
|
7
|
-
COHERE = "cohere"
|
8
6
|
ANTHROPIC = "anthropic"
|
9
|
-
|
10
|
-
MISTRAL = "mistral"
|
11
|
-
PINECONE = "pinecone-client"
|
12
|
-
LLAMAINDEX = "llama-index"
|
7
|
+
AUTOGEN = "autogen"
|
13
8
|
CHROMADB = "chromadb"
|
14
|
-
|
9
|
+
COHERE = "cohere"
|
10
|
+
CREW_AI = "crewai"
|
11
|
+
CREWAI = "crewai"
|
12
|
+
DSPY = "dspy-ai"
|
13
|
+
EMBEDCHAIN = "embedchain"
|
14
|
+
GEMINI = "google-generativeai"
|
15
|
+
GOOGLE_CLOUD_AI_PLATFORM = "google-cloud-aiplatform"
|
16
|
+
GOOGLE_GENERATIVEAI = "google-generativeai"
|
17
|
+
GROQ = "groq"
|
15
18
|
LANGCHAIN = "langchain"
|
16
|
-
LANGCHAIN_CORE = "langchain-core"
|
17
19
|
LANGCHAIN_COMMUNITY = "langchain-community"
|
20
|
+
LANGCHAIN_CORE = "langchain-core"
|
18
21
|
LANGGRAPH = "langgraph"
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
DSPY = "dspy-ai"
|
23
|
-
CREWAI = "crewai"
|
24
|
-
GEMINI = "google-generativeai"
|
25
|
-
VERTEXAI = "google-cloud-aiplatform"
|
22
|
+
LITELLM = "litellm"
|
23
|
+
LLAMAINDEX = "llama-index"
|
24
|
+
MISTRAL = "mistral"
|
26
25
|
MISTRALAI = "mistralai"
|
26
|
+
OLLAMA = "ollama"
|
27
|
+
OPENAI = "openai"
|
28
|
+
PINECONE = "pinecone-client"
|
29
|
+
QDRANT = "qdrant"
|
30
|
+
SQLALCHEMY = "sqlalchemy"
|
31
|
+
VERTEXAI = "vertexai"
|
32
|
+
WEAVIATE = "weaviate"
|
27
33
|
|
28
34
|
@staticmethod
|
29
35
|
def from_string(value: str):
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "3.0.2"
|
langtrace_python_sdk-2.3.27/src/langtrace_python_sdk/constants/exporter/langtrace_exporter.py
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
LANGTRACE_REMOTE_URL = "https://langtrace.ai"
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "2.3.27"
|
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.3.27 → langtrace_python_sdk-3.0.2}/src/examples/autogen_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/autogen_example/main.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/chroma_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/chroma_example/basic.py
RENAMED
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/cohere_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/cohere_example/chat.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/cohere_example/embed.py
RENAMED
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/cohere_example/rerank.py
RENAMED
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/cohere_example/tools.py
RENAMED
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/crewai_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/crewai_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
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/dspy_example/QA_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
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/dspy_example/quiz_gen.py
RENAMED
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/dspy_example/react.py
RENAMED
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/embedchain_example/simple.py
RENAMED
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/fastapi_example/__init__.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/gemini_example/__init__.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/gemini_example/main.py
RENAMED
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/hiveagent_example/basic.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/langchain_example/basic.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/langchain_example/tool.py
RENAMED
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/litellm_example/basic.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/llamaindex_example/agent.py
RENAMED
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/llamaindex_example/basic.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/mistral_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/mistral_example/complete.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/ollama_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-2.3.27 → langtrace_python_sdk-3.0.2}/src/examples/ollama_example/basic.py
RENAMED
File without changes
|