langtrace-python-sdk 3.3.11__tar.gz → 3.3.12__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/PKG-INFO +1 -1
- langtrace_python_sdk-3.3.12/src/examples/langgraph_example/main.py +173 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/crewai/patch.py +1 -1
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/langgraph/instrumentation.py +14 -19
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/langgraph/patch.py +2 -3
- langtrace_python_sdk-3.3.12/src/langtrace_python_sdk/version.py +1 -0
- langtrace_python_sdk-3.3.11/src/langtrace_python_sdk/version.py +0 -1
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/.gitignore +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/LICENSE +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/README.md +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/pyproject.toml +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/anthropic_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/anthropic_example/completion.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/autogen_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/autogen_example/main.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/awsbedrock_examples/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/awsbedrock_examples/converse.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/azureopenai_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/azureopenai_example/completion.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/cerebras_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/cerebras_example/main.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/chroma_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/chroma_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/cohere_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/cohere_example/chat.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/cohere_example/chat_stream.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/cohere_example/embed.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/cohere_example/rerank.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/cohere_example/tools.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/crewai_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/crewai_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/crewai_example/instagram_post/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/crewai_example/instagram_post/agents.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/crewai_example/instagram_post/main.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/crewai_example/instagram_post/tasks.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/crewai_example/instagram_post/tools/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/crewai_example/instagram_post/tools/browser_tools.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/crewai_example/simple_agent/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/crewai_example/simple_agent/agents.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/crewai_example/simple_agent/main.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/crewai_example/simple_agent/tasks.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/crewai_example/trip_planner/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/crewai_example/trip_planner/agents.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/crewai_example/trip_planner/main.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/crewai_example/trip_planner/tasks.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/crewai_example/trip_planner/tools/calculator.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/crewai_example/trip_planner/tools/search_tools.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/dspy_example/QA_basic.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/dspy_example/QA_basic_with_chain_of_thought.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/dspy_example/QA_basic_with_signature.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/dspy_example/QA_multi_step_with_chain_of_thought.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/dspy_example/math_problems_cot.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/dspy_example/math_problems_cot_parallel.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/dspy_example/optimizers/bootstrap_fewshot.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/dspy_example/program_of_thought_basic.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/dspy_example/quiz_gen.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/dspy_example/react.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/embedchain_example/simple.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/fastapi_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/fastapi_example/basic_route.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/gemini_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/gemini_example/function_tools.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/gemini_example/main.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/hiveagent_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/inspect_ai_example/basic_eval.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/langchain_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/langchain_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/langchain_example/groq_example.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/langchain_example/langchain_google_example.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/langchain_example/langgraph_example.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/langchain_example/langgraph_example_tools.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/langchain_example/sagemaker.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/langchain_example/tool.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/litellm_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/litellm_example/config.yaml +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/litellm_example/proxy_basic.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/llamaindex_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/llamaindex_example/agent.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/llamaindex_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/llamaindex_example/data/abramov.txt +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/milvus_example/main.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/mistral_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/mistral_example/complete.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/mistral_example/complete_async.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/mistral_example/embeddings.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/mongo_vector_search_example/main.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/ollama_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/ollama_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/openai_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/openai_example/async_tool_calling_nonstreaming.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/openai_example/async_tool_calling_streaming.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/openai_example/chat_completion.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/openai_example/chat_completion_tool_choice.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/openai_example/embeddings_create.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/openai_example/function_calling.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/openai_example/images_edit.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/openai_example/images_generate.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/openai_example/resources/lounge_flamingo.png +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/openai_example/resources/mask.png +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/openai_example/send_user_feedback.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/openai_example/tool_calling.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/openai_example/tool_calling_nonstreaming.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/openai_example/tool_calling_streaming.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/otlp_example/otlp_basic.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/otlp_example/otlp_with_langtrace.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/perplexity_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/pinecone_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/pinecone_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/qdrant_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/qdrant_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/routellm_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/vertexai_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/vertexai_example/main.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/weaviate_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/weaviate_example/query_text.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/constants/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/constants/exporter/langtrace_exporter.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/constants/instrumentation/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/constants/instrumentation/anthropic.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/constants/instrumentation/aws_bedrock.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/constants/instrumentation/chroma.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/constants/instrumentation/cohere.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/constants/instrumentation/common.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/constants/instrumentation/embedchain.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/constants/instrumentation/gemini.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/constants/instrumentation/groq.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/constants/instrumentation/litellm.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/constants/instrumentation/milvus.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/constants/instrumentation/mistral.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/constants/instrumentation/ollama.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/constants/instrumentation/openai.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/constants/instrumentation/pinecone.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/constants/instrumentation/pymongo.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/constants/instrumentation/qdrant.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/constants/instrumentation/vertexai.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/constants/instrumentation/weaviate.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/extensions/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/extensions/langtrace_exporter.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/extensions/langtrace_filesystem.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/anthropic/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/anthropic/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/anthropic/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/anthropic/types.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/autogen/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/autogen/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/autogen/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/aws_bedrock/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/aws_bedrock/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/aws_bedrock/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/cerebras/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/cerebras/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/cerebras/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/chroma/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/chroma/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/chroma/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/cohere/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/cohere/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/cohere/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/crewai/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/crewai/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/dspy/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/dspy/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/dspy/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/embedchain/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/embedchain/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/embedchain/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/gemini/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/gemini/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/gemini/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/groq/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/groq/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/groq/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/langchain/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/langchain/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/langchain/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/langchain_community/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/langchain_community/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/langchain_community/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/langchain_core/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/langchain_core/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/langchain_core/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/langgraph/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/litellm/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/litellm/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/litellm/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/litellm/types.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/llamaindex/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/llamaindex/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/llamaindex/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/milvus/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/milvus/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/milvus/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/mistral/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/mistral/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/mistral/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/ollama/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/ollama/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/ollama/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/openai/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/openai/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/openai/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/openai/types.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/pinecone/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/pinecone/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/pinecone/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/pymongo/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/pymongo/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/pymongo/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/qdrant/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/qdrant/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/qdrant/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/vertexai/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/vertexai/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/vertexai/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/weaviate/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/weaviate/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/instrumentation/weaviate/patch.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/langtrace.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/types/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/utils/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/utils/langtrace_sampler.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/utils/llm.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/utils/misc.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/utils/prompt_registry.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/utils/sdk_version_checker.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/utils/silently_fail.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/utils/types.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/utils/with_root_span.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/run_example.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/__init__.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/anthropic/cassettes/test_anthropic.yaml +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/anthropic/cassettes/test_anthropic_streaming.yaml +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/anthropic/cassettes/test_async_anthropic_streaming.yaml +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/anthropic/conftest.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/anthropic/test_anthropic.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/chroma/conftest.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/chroma/test_chroma.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/cohere/cassettes/test_cohere_chat.yaml +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/cohere/cassettes/test_cohere_chat_streaming.yaml +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/cohere/cassettes/test_cohere_embed.yaml +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/cohere/cassettes/test_cohere_rerank.yaml +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/cohere/conftest.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/cohere/test_cohere_chat.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/cohere/test_cohere_embed.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/cohere/test_cohere_rerank.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/conftest.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/groq/cassettes/test_async_chat_completion.yaml +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/groq/cassettes/test_async_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/groq/cassettes/test_chat_completion.yaml +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/groq/cassettes/test_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/groq/conftest.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/groq/test_groq.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/langchain/cassettes/test_langchain.yaml +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/langchain/conftest.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/langchain/test_langchain.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/openai/cassettes/test_async_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/openai/cassettes/test_async_image_generation.yaml +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/openai/cassettes/test_chat_completion.yaml +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/openai/cassettes/test_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/openai/cassettes/test_image_generation.yaml +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/openai/conftest.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/openai/test_chat_completion.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/openai/test_embeddings.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/openai/test_image_generation.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/pinecone/cassettes/test_query.yaml +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/pinecone/cassettes/test_upsert.yaml +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/pinecone/conftest.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/pinecone/test_pinecone.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/qdrant/conftest.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/qdrant/test_qdrant.py +0 -0
- {langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/tests/utils.py +0 -0
@@ -0,0 +1,173 @@
|
|
1
|
+
from typing import TypedDict, Union, Annotated
|
2
|
+
from langchain_core.agents import AgentAction, AgentFinish
|
3
|
+
from langchain_core.tools import tool
|
4
|
+
import operator
|
5
|
+
from dotenv import load_dotenv
|
6
|
+
from langchain_openai import ChatOpenAI
|
7
|
+
|
8
|
+
from langchain import hub
|
9
|
+
from langchain.agents import create_openai_tools_agent
|
10
|
+
import json
|
11
|
+
from langgraph.graph import StateGraph, END
|
12
|
+
from langtrace_python_sdk import langtrace, with_langtrace_root_span
|
13
|
+
|
14
|
+
load_dotenv()
|
15
|
+
|
16
|
+
langtrace.init(write_spans_to_console=False)
|
17
|
+
|
18
|
+
|
19
|
+
class AgentState(TypedDict):
|
20
|
+
input: str
|
21
|
+
agent_out: Union[AgentAction, AgentFinish, None]
|
22
|
+
intermediate_steps: Annotated[list[tuple[AgentAction, str]], operator.add]
|
23
|
+
|
24
|
+
|
25
|
+
ehi_information = """Title: EHI: End-to-end Learning of Hierarchical Index for
|
26
|
+
Efficient Dense Retrieval
|
27
|
+
Summary: Dense embedding-based retrieval is now the industry
|
28
|
+
standard for semantic search and ranking problems, like obtaining relevant web
|
29
|
+
documents for a given query. Such techniques use a two-stage process: (a)
|
30
|
+
contrastive learning to train a dual encoder to embed both the query and
|
31
|
+
documents and (b) approximate nearest neighbor search (ANNS) for finding similar
|
32
|
+
documents for a given query. These two stages are disjoint; the learned
|
33
|
+
embeddings might be ill-suited for the ANNS method and vice-versa, leading to
|
34
|
+
suboptimal performance. In this work, we propose End-to-end Hierarchical
|
35
|
+
Indexing -- EHI -- that jointly learns both the embeddings and the ANNS
|
36
|
+
structure to optimize retrieval performance. EHI uses a standard dual encoder
|
37
|
+
model for embedding queries and documents while learning an inverted file index
|
38
|
+
(IVF) style tree structure for efficient ANNS. To ensure stable and efficient
|
39
|
+
learning of discrete tree-based ANNS structure, EHI introduces the notion of
|
40
|
+
dense path embedding that captures the position of a query/document in the tree.
|
41
|
+
We demonstrate the effectiveness of EHI on several benchmarks, including
|
42
|
+
de-facto industry standard MS MARCO (Dev set and TREC DL19) datasets. For
|
43
|
+
example, with the same compute budget, EHI outperforms state-of-the-art (SOTA)
|
44
|
+
in by 0.6% (MRR@10) on MS MARCO dev set and by 4.2% (nDCG@10) on TREC DL19
|
45
|
+
benchmarks.
|
46
|
+
Author(s): Ramnath Kumar, Anshul Mittal, Nilesh Gupta, Aditya Kusupati,
|
47
|
+
Inderjit Dhillon, Prateek Jain
|
48
|
+
Source: https://arxiv.org/pdf/2310.08891.pdf"""
|
49
|
+
|
50
|
+
|
51
|
+
@tool("search")
|
52
|
+
def search_tool(query: str):
|
53
|
+
"""Searches for information on the topic of artificial intelligence (AI).
|
54
|
+
Cannot be used to research any other topics. Search query must be provided
|
55
|
+
in natural language and be verbose."""
|
56
|
+
# this is a "RAG" emulator
|
57
|
+
return ehi_information
|
58
|
+
|
59
|
+
|
60
|
+
@tool("final_answer")
|
61
|
+
def final_answer_tool(answer: str, source: str):
|
62
|
+
"""Returns a natural language response to the user in `answer`, and a
|
63
|
+
`source` which provides citations for where this information came from.
|
64
|
+
"""
|
65
|
+
return ""
|
66
|
+
|
67
|
+
|
68
|
+
llm = ChatOpenAI()
|
69
|
+
prompt = hub.pull("hwchase17/openai-functions-agent")
|
70
|
+
|
71
|
+
|
72
|
+
query_agent_runnable = create_openai_tools_agent(
|
73
|
+
llm=llm, tools=[final_answer_tool, search_tool], prompt=prompt
|
74
|
+
)
|
75
|
+
|
76
|
+
|
77
|
+
inputs = {"input": "what are EHI embeddings?", "intermediate_steps": []}
|
78
|
+
|
79
|
+
agent_out = query_agent_runnable.invoke(inputs)
|
80
|
+
|
81
|
+
|
82
|
+
def run_query_agent(state: list):
|
83
|
+
print("> run_query_agent")
|
84
|
+
agent_out = query_agent_runnable.invoke(state)
|
85
|
+
return {"agent_out": agent_out}
|
86
|
+
|
87
|
+
|
88
|
+
def execute_search(state: list):
|
89
|
+
print("> execute_search")
|
90
|
+
action = state["agent_out"]
|
91
|
+
tool_call = action[-1].message_log[-1].additional_kwargs["tool_calls"][-1]
|
92
|
+
out = search_tool.invoke(json.loads(tool_call["function"]["arguments"]))
|
93
|
+
return {"intermediate_steps": [{"search": str(out)}]}
|
94
|
+
|
95
|
+
|
96
|
+
def router(state: list):
|
97
|
+
print("> router")
|
98
|
+
if isinstance(state["agent_out"], list):
|
99
|
+
return state["agent_out"][-1].tool
|
100
|
+
else:
|
101
|
+
return "error"
|
102
|
+
|
103
|
+
|
104
|
+
# finally, we will have a single LLM call that MUST use the final_answer structure
|
105
|
+
final_answer_llm = llm.bind_tools([final_answer_tool], tool_choice="final_answer")
|
106
|
+
|
107
|
+
|
108
|
+
# this forced final_answer LLM call will be used to structure output from our
|
109
|
+
# RAG endpoint
|
110
|
+
def rag_final_answer(state: list):
|
111
|
+
print("> final_answer")
|
112
|
+
query = state["input"]
|
113
|
+
context = state["intermediate_steps"][-1]
|
114
|
+
|
115
|
+
prompt = f"""You are a helpful assistant, answer the user's question using the
|
116
|
+
context provided.
|
117
|
+
|
118
|
+
CONTEXT: {context}
|
119
|
+
|
120
|
+
QUESTION: {query}
|
121
|
+
"""
|
122
|
+
out = final_answer_llm.invoke(prompt)
|
123
|
+
function_call = out.additional_kwargs["tool_calls"][-1]["function"]["arguments"]
|
124
|
+
return {"agent_out": function_call}
|
125
|
+
|
126
|
+
|
127
|
+
# we use the same forced final_answer LLM call to handle incorrectly formatted
|
128
|
+
# output from our query_agent
|
129
|
+
def handle_error(state: list):
|
130
|
+
print("> handle_error")
|
131
|
+
query = state["input"]
|
132
|
+
prompt = f"""You are a helpful assistant, answer the user's question.
|
133
|
+
|
134
|
+
QUESTION: {query}
|
135
|
+
"""
|
136
|
+
out = final_answer_llm.invoke(prompt)
|
137
|
+
function_call = out.additional_kwargs["tool_calls"][-1]["function"]["arguments"]
|
138
|
+
return {"agent_out": function_call}
|
139
|
+
|
140
|
+
|
141
|
+
@with_langtrace_root_span("run_graph")
|
142
|
+
def run_graph():
|
143
|
+
graph = StateGraph(AgentState)
|
144
|
+
|
145
|
+
# we have four nodes that will consume our agent state and modify
|
146
|
+
# our agent state based on some internal process
|
147
|
+
graph.add_node("query_agent", run_query_agent)
|
148
|
+
graph.add_node("search", execute_search)
|
149
|
+
graph.add_node("error", handle_error)
|
150
|
+
graph.add_node("rag_final_answer", rag_final_answer)
|
151
|
+
# our graph will always begin with the query agent
|
152
|
+
graph.set_entry_point("query_agent")
|
153
|
+
# conditional edges are controlled by our router
|
154
|
+
graph.add_conditional_edges(
|
155
|
+
"query_agent",
|
156
|
+
router,
|
157
|
+
{
|
158
|
+
"search": "search",
|
159
|
+
"error": "error",
|
160
|
+
"final_answer": END,
|
161
|
+
},
|
162
|
+
)
|
163
|
+
graph.add_edge("search", "rag_final_answer")
|
164
|
+
graph.add_edge("error", END)
|
165
|
+
graph.add_edge("rag_final_answer", END)
|
166
|
+
|
167
|
+
runnable = graph.compile()
|
168
|
+
|
169
|
+
return runnable.invoke({"input": "what are EHI embeddings?"})
|
170
|
+
|
171
|
+
|
172
|
+
if __name__ == "__main__":
|
173
|
+
run_graph()
|
@@ -223,7 +223,7 @@ class CrewAISpanAttributes:
|
|
223
223
|
for task in tasks:
|
224
224
|
self.crew["tasks"].append(
|
225
225
|
{
|
226
|
-
"agent": task.agent.role,
|
226
|
+
"agent": task.agent.role if task.agent else None,
|
227
227
|
"description": task.description,
|
228
228
|
"async_execution": task.async_execution,
|
229
229
|
"expected_output": task.expected_output,
|
@@ -41,7 +41,8 @@ class LanggraphInstrumentation(BaseInstrumentor):
|
|
41
41
|
# List of modules to patch, with their corresponding patch names
|
42
42
|
modules_to_patch = [
|
43
43
|
(
|
44
|
-
"langgraph.graph.
|
44
|
+
"langgraph.graph.state", # Updated module path
|
45
|
+
"StateGraph", # Updated class name
|
45
46
|
[
|
46
47
|
"add_node",
|
47
48
|
"add_edge",
|
@@ -49,26 +50,20 @@ class LanggraphInstrumentation(BaseInstrumentor):
|
|
49
50
|
"set_finish_point",
|
50
51
|
"add_conditional_edges",
|
51
52
|
],
|
52
|
-
)
|
53
|
+
)
|
53
54
|
]
|
54
55
|
|
55
|
-
for module_name, methods in modules_to_patch:
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
module = f"{name}.{method_name}"
|
67
|
-
wrap_function_wrapper(
|
68
|
-
module_name,
|
69
|
-
module,
|
70
|
-
patch_graph_methods(module, tracer, version),
|
71
|
-
)
|
56
|
+
for module_name, class_name, methods in modules_to_patch:
|
57
|
+
for method_name in methods:
|
58
|
+
# Construct the correct path for the method
|
59
|
+
method_path = f"{class_name}.{method_name}"
|
60
|
+
wrap_function_wrapper(
|
61
|
+
module_name,
|
62
|
+
method_path,
|
63
|
+
patch_graph_methods(
|
64
|
+
f"{module_name}.{method_path}", tracer, version
|
65
|
+
),
|
66
|
+
)
|
72
67
|
|
73
68
|
def _uninstrument(self, **kwargs):
|
74
69
|
pass
|
@@ -30,6 +30,7 @@ from langtrace_python_sdk.constants.instrumentation.common import (
|
|
30
30
|
from importlib_metadata import version as v
|
31
31
|
|
32
32
|
from langtrace_python_sdk.constants import LANGTRACE_SDK_NAME
|
33
|
+
from langtrace_python_sdk.utils.llm import set_span_attributes
|
33
34
|
|
34
35
|
|
35
36
|
def patch_graph_methods(method_name, tracer, version):
|
@@ -57,9 +58,7 @@ def patch_graph_methods(method_name, tracer, version):
|
|
57
58
|
kind=SpanKind.CLIENT,
|
58
59
|
context=set_span_in_context(trace.get_current_span()),
|
59
60
|
) as span:
|
60
|
-
|
61
|
-
if value is not None:
|
62
|
-
span.set_attribute(field, value)
|
61
|
+
set_span_attributes(span, attributes)
|
63
62
|
try:
|
64
63
|
# Attempt to call the original method
|
65
64
|
result = wrapped(*args, **kwargs)
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "3.3.12"
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "3.3.11"
|
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-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/autogen_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/autogen_example/main.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/cerebras_example/main.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/chroma_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/chroma_example/basic.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/cohere_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/cohere_example/chat.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/cohere_example/embed.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/cohere_example/rerank.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/cohere_example/tools.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/crewai_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/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-3.3.11 → langtrace_python_sdk-3.3.12}/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-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/dspy_example/quiz_gen.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/dspy_example/react.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/fastapi_example/__init__.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/gemini_example/__init__.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/gemini_example/main.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/hiveagent_example/basic.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/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-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/langchain_example/tool.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/litellm_example/basic.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/litellm_example/config.yaml
RENAMED
File without changes
|
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/llamaindex_example/agent.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/llamaindex_example/basic.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/milvus_example/main.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/mistral_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/mistral_example/complete.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/ollama_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/ollama_example/basic.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/openai_example/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/otlp_example/otlp_basic.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/perplexity_example/basic.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/pinecone_example/basic.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/qdrant_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/qdrant_example/basic.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/routellm_example/basic.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/examples/vertexai_example/main.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.11 → langtrace_python_sdk-3.3.12}/src/langtrace_python_sdk/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|