langtrace-python-sdk 3.3.23__tar.gz → 3.3.24__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/PKG-INFO +1 -1
- langtrace_python_sdk-3.3.24/src/examples/awsbedrock_examples/__init__.py +18 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/awsbedrock_examples/converse.py +20 -6
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/aws_bedrock/patch.py +150 -19
- langtrace_python_sdk-3.3.24/src/langtrace_python_sdk/version.py +1 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/run_example.py +2 -2
- langtrace_python_sdk-3.3.23/src/examples/awsbedrock_examples/__init__.py +0 -19
- langtrace_python_sdk-3.3.23/src/langtrace_python_sdk/version.py +0 -1
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/.gitignore +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/LICENSE +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/README.md +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/pyproject.toml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/anthropic_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/anthropic_example/completion.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/autogen_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/autogen_example/main.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/azureopenai_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/azureopenai_example/completion.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/cerebras_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/cerebras_example/main.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/chroma_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/chroma_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/cohere_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/cohere_example/chat.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/cohere_example/chat_stream.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/cohere_example/chat_streamv2.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/cohere_example/chatv2.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/cohere_example/embed.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/cohere_example/rerank.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/cohere_example/rerankv2.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/cohere_example/tools.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/crewai_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/crewai_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/crewai_example/instagram_post/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/crewai_example/instagram_post/agents.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/crewai_example/instagram_post/main.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/crewai_example/instagram_post/tasks.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/crewai_example/instagram_post/tools/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/crewai_example/instagram_post/tools/browser_tools.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/crewai_example/simple_agent/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/crewai_example/simple_agent/agents.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/crewai_example/simple_agent/main.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/crewai_example/simple_agent/tasks.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/crewai_example/trip_planner/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/crewai_example/trip_planner/agents.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/crewai_example/trip_planner/main.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/crewai_example/trip_planner/tasks.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/crewai_example/trip_planner/tools/calculator.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/crewai_example/trip_planner/tools/search_tools.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/dspy_example/QA_basic.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/dspy_example/QA_basic_with_chain_of_thought.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/dspy_example/QA_basic_with_signature.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/dspy_example/QA_multi_step_with_chain_of_thought.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/dspy_example/math_problems_cot.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/dspy_example/math_problems_cot_parallel.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/dspy_example/optimizers/bootstrap_fewshot.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/dspy_example/program_of_thought_basic.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/dspy_example/quiz_gen.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/dspy_example/react.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/embedchain_example/simple.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/fastapi_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/fastapi_example/basic_route.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/gemini_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/gemini_example/function_tools.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/gemini_example/main.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/google_genai_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/google_genai_example/main.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/hiveagent_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/inspect_ai_example/basic_eval.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/langchain_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/langchain_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/langchain_example/groq_example.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/langchain_example/langchain_google_example.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/langchain_example/langgraph_example.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/langchain_example/langgraph_example_tools.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/langchain_example/sagemaker.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/langchain_example/tool.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/langgraph_example/main.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/litellm_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/litellm_example/config.yaml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/litellm_example/proxy_basic.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/llamaindex_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/llamaindex_example/agent.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/llamaindex_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/llamaindex_example/data/abramov.txt +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/milvus_example/main.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/mistral_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/mistral_example/complete.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/mistral_example/complete_async.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/mistral_example/embeddings.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/mongo_vector_search_example/main.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/ollama_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/ollama_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/openai_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/openai_example/async_tool_calling_nonstreaming.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/openai_example/async_tool_calling_streaming.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/openai_example/chat_completion.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/openai_example/chat_completion_tool_choice.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/openai_example/embeddings_create.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/openai_example/function_calling.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/openai_example/images_edit.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/openai_example/images_generate.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/openai_example/resources/lounge_flamingo.png +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/openai_example/resources/mask.png +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/openai_example/send_user_feedback.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/openai_example/tool_calling.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/openai_example/tool_calling_nonstreaming.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/openai_example/tool_calling_streaming.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/otlp_example/otlp_basic.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/otlp_example/otlp_with_langtrace.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/perplexity_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/pinecone_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/pinecone_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/qdrant_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/qdrant_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/routellm_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/vertexai_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/vertexai_example/main.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/weaviate_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/weaviate_example/query_text.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/constants/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/constants/exporter/langtrace_exporter.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/constants/instrumentation/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/constants/instrumentation/anthropic.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/constants/instrumentation/aws_bedrock.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/constants/instrumentation/chroma.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/constants/instrumentation/cohere.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/constants/instrumentation/common.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/constants/instrumentation/embedchain.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/constants/instrumentation/gemini.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/constants/instrumentation/groq.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/constants/instrumentation/litellm.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/constants/instrumentation/milvus.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/constants/instrumentation/mistral.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/constants/instrumentation/ollama.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/constants/instrumentation/openai.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/constants/instrumentation/pinecone.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/constants/instrumentation/pymongo.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/constants/instrumentation/qdrant.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/constants/instrumentation/vertexai.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/constants/instrumentation/weaviate.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/extensions/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/extensions/langtrace_exporter.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/extensions/langtrace_filesystem.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/anthropic/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/anthropic/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/anthropic/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/anthropic/types.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/autogen/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/autogen/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/autogen/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/aws_bedrock/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/aws_bedrock/bedrock_streaming_wrapper.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/aws_bedrock/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/aws_bedrock/stream_body_wrapper.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/cerebras/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/cerebras/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/cerebras/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/chroma/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/chroma/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/chroma/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/cohere/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/cohere/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/cohere/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/crewai/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/crewai/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/crewai/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/dspy/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/dspy/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/dspy/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/embedchain/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/embedchain/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/embedchain/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/gemini/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/gemini/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/gemini/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/google_genai/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/google_genai/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/google_genai/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/groq/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/groq/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/groq/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/langchain/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/langchain/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/langchain/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/langchain_community/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/langchain_community/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/langchain_community/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/langchain_core/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/langchain_core/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/langchain_core/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/langgraph/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/langgraph/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/langgraph/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/litellm/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/litellm/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/litellm/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/litellm/types.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/llamaindex/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/llamaindex/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/llamaindex/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/milvus/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/milvus/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/milvus/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/mistral/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/mistral/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/mistral/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/ollama/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/ollama/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/ollama/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/openai/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/openai/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/openai/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/openai/types.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/pinecone/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/pinecone/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/pinecone/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/pymongo/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/pymongo/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/pymongo/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/qdrant/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/qdrant/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/qdrant/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/vertexai/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/vertexai/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/vertexai/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/weaviate/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/weaviate/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/instrumentation/weaviate/patch.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/langtrace.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/types/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/utils/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/utils/langtrace_sampler.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/utils/llm.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/utils/misc.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/utils/prompt_registry.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/utils/sdk_version_checker.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/utils/silently_fail.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/utils/types.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/langtrace_python_sdk/utils/with_root_span.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/__init__.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/anthropic/cassettes/test_anthropic.yaml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/anthropic/cassettes/test_anthropic_streaming.yaml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/anthropic/cassettes/test_async_anthropic_streaming.yaml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/anthropic/conftest.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/anthropic/test_anthropic.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/chroma/conftest.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/chroma/test_chroma.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/cohere/cassettes/test_cohere_chat.yaml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/cohere/cassettes/test_cohere_chat_streaming.yaml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/cohere/cassettes/test_cohere_embed.yaml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/cohere/cassettes/test_cohere_rerank.yaml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/cohere/conftest.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/cohere/test_cohere_chat.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/cohere/test_cohere_embed.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/cohere/test_cohere_rerank.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/conftest.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/groq/cassettes/test_async_chat_completion.yaml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/groq/cassettes/test_async_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/groq/cassettes/test_chat_completion.yaml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/groq/cassettes/test_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/groq/conftest.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/groq/test_groq.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/langchain/cassettes/test_langchain.yaml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/langchain/conftest.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/langchain/test_langchain.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/openai/cassettes/test_async_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/openai/cassettes/test_async_image_generation.yaml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/openai/cassettes/test_chat_completion.yaml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/openai/cassettes/test_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/openai/cassettes/test_embeddings_base_url.yaml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/openai/cassettes/test_image_generation.yaml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/openai/conftest.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/openai/test_chat_completion.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/openai/test_embeddings.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/openai/test_image_generation.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/pinecone/cassettes/test_query.yaml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/pinecone/cassettes/test_upsert.yaml +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/pinecone/conftest.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/pinecone/test_pinecone.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/qdrant/conftest.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/qdrant/test_qdrant.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/test_session_id.py +0 -0
- {langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/tests/utils.py +0 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
from examples.awsbedrock_examples.converse import (
|
2
|
+
use_invoke_model_anthropic,
|
3
|
+
use_invoke_model_titan,
|
4
|
+
use_invoke_model_llama,
|
5
|
+
)
|
6
|
+
from langtrace_python_sdk import langtrace, with_langtrace_root_span
|
7
|
+
|
8
|
+
|
9
|
+
class AWSBedrockRunner:
|
10
|
+
@with_langtrace_root_span("AWS_Bedrock")
|
11
|
+
def run(self):
|
12
|
+
|
13
|
+
# use_converse_stream()
|
14
|
+
# use_converse()
|
15
|
+
# use_invoke_model_anthropic(stream=True)
|
16
|
+
# use_invoke_model_cohere()
|
17
|
+
# use_invoke_model_llama(stream=False)
|
18
|
+
use_invoke_model_titan(stream=False)
|
@@ -88,6 +88,12 @@ def use_invoke_model_titan(stream=False):
|
|
88
88
|
response = brt.invoke_model_with_response_stream(
|
89
89
|
body=body, modelId=modelId, accept=accept, contentType=contentType
|
90
90
|
)
|
91
|
+
# Extract and print the response text in real-time.
|
92
|
+
for event in response["body"]:
|
93
|
+
chunk = json.loads(event["chunk"]["bytes"])
|
94
|
+
if "outputText" in chunk:
|
95
|
+
print(chunk["outputText"], end="")
|
96
|
+
|
91
97
|
else:
|
92
98
|
response = brt.invoke_model(
|
93
99
|
body=body, modelId=modelId, accept=accept, contentType=contentType
|
@@ -130,7 +136,8 @@ def use_invoke_model_anthropic(stream=False):
|
|
130
136
|
for event in stream_response:
|
131
137
|
chunk = event.get("chunk")
|
132
138
|
if chunk:
|
133
|
-
print(json.loads(chunk.get("bytes").decode()))
|
139
|
+
# print(json.loads(chunk.get("bytes").decode()))
|
140
|
+
pass
|
134
141
|
|
135
142
|
else:
|
136
143
|
response = brt.invoke_model(
|
@@ -141,7 +148,7 @@ def use_invoke_model_anthropic(stream=False):
|
|
141
148
|
print(response_body.get("completion"))
|
142
149
|
|
143
150
|
|
144
|
-
def use_invoke_model_llama():
|
151
|
+
def use_invoke_model_llama(stream=False):
|
145
152
|
model_id = "meta.llama3-8b-instruct-v1:0"
|
146
153
|
prompt = "What is the capital of France?"
|
147
154
|
max_gen_len = 128
|
@@ -157,11 +164,18 @@ def use_invoke_model_llama():
|
|
157
164
|
"top_p": top_p,
|
158
165
|
}
|
159
166
|
)
|
160
|
-
response = brt.invoke_model(body=body, modelId=model_id)
|
161
|
-
|
162
|
-
response_body = json.loads(response.get("body").read())
|
163
167
|
|
164
|
-
|
168
|
+
if stream:
|
169
|
+
response = brt.invoke_model_with_response_stream(body=body, modelId=model_id)
|
170
|
+
for event in response["body"]:
|
171
|
+
chunk = json.loads(event["chunk"]["bytes"])
|
172
|
+
if "generation" in chunk:
|
173
|
+
# print(chunk["generation"], end="")
|
174
|
+
pass
|
175
|
+
else:
|
176
|
+
response = brt.invoke_model(body=body, modelId=model_id)
|
177
|
+
response_body = json.loads(response.get("body").read())
|
178
|
+
return response_body
|
165
179
|
|
166
180
|
|
167
181
|
# print(get_foundation_models())
|
@@ -16,9 +16,7 @@ limitations under the License.
|
|
16
16
|
|
17
17
|
import json
|
18
18
|
|
19
|
-
from
|
20
|
-
StreamingWrapper,
|
21
|
-
)
|
19
|
+
from wrapt import ObjectProxy
|
22
20
|
from .stream_body_wrapper import BufferedStreamBody
|
23
21
|
from functools import wraps
|
24
22
|
from langtrace.trace_attributes import (
|
@@ -87,6 +85,11 @@ def patch_aws_bedrock(tracer, version):
|
|
87
85
|
|
88
86
|
client = wrapped(*args, **kwargs)
|
89
87
|
client.invoke_model = patch_invoke_model(client.invoke_model, tracer, version)
|
88
|
+
client.invoke_model_with_response_stream = (
|
89
|
+
patch_invoke_model_with_response_stream(
|
90
|
+
client.invoke_model_with_response_stream, tracer, version
|
91
|
+
)
|
92
|
+
)
|
90
93
|
|
91
94
|
client.converse = patch_converse(client.converse, tracer, version)
|
92
95
|
client.converse_stream = patch_converse_stream(
|
@@ -186,6 +189,56 @@ def patch_invoke_model(original_method, tracer, version):
|
|
186
189
|
return traced_method
|
187
190
|
|
188
191
|
|
192
|
+
def patch_invoke_model_with_response_stream(original_method, tracer, version):
|
193
|
+
@wraps(original_method)
|
194
|
+
def traced_method(*args, **kwargs):
|
195
|
+
modelId = kwargs.get("modelId")
|
196
|
+
(vendor, _) = modelId.split(".")
|
197
|
+
span_attributes = {
|
198
|
+
**get_langtrace_attributes(version, vendor, vendor_type="framework"),
|
199
|
+
**get_extra_attributes(),
|
200
|
+
}
|
201
|
+
span = tracer.start_span(
|
202
|
+
name=get_span_name("aws_bedrock.invoke_model_with_response_stream"),
|
203
|
+
kind=SpanKind.CLIENT,
|
204
|
+
context=set_span_in_context(trace.get_current_span()),
|
205
|
+
)
|
206
|
+
set_span_attributes(span, span_attributes)
|
207
|
+
response = original_method(*args, **kwargs)
|
208
|
+
if span.is_recording():
|
209
|
+
handle_streaming_call(span, kwargs, response)
|
210
|
+
return response
|
211
|
+
|
212
|
+
return traced_method
|
213
|
+
|
214
|
+
|
215
|
+
def handle_streaming_call(span, kwargs, response):
|
216
|
+
|
217
|
+
def stream_finished(response_body):
|
218
|
+
request_body = json.loads(kwargs.get("body"))
|
219
|
+
|
220
|
+
(vendor, model) = kwargs.get("modelId").split(".")
|
221
|
+
|
222
|
+
set_span_attribute(span, SpanAttributes.LLM_REQUEST_MODEL, model)
|
223
|
+
set_span_attribute(span, SpanAttributes.LLM_RESPONSE_MODEL, model)
|
224
|
+
|
225
|
+
if vendor == "amazon":
|
226
|
+
set_amazon_attributes(span, request_body, response_body)
|
227
|
+
|
228
|
+
if vendor == "anthropic":
|
229
|
+
if "prompt" in request_body:
|
230
|
+
set_anthropic_completions_attributes(span, request_body, response_body)
|
231
|
+
elif "messages" in request_body:
|
232
|
+
set_anthropic_messages_attributes(span, request_body, response_body)
|
233
|
+
|
234
|
+
if vendor == "meta":
|
235
|
+
set_llama_meta_attributes(span, request_body, response_body)
|
236
|
+
|
237
|
+
span.end()
|
238
|
+
|
239
|
+
response["body"] = StreamingBedrockWrapper(response["body"], stream_finished)
|
240
|
+
|
241
|
+
|
189
242
|
def handle_call(span, kwargs, response):
|
190
243
|
modelId = kwargs.get("modelId")
|
191
244
|
(vendor, model_name) = modelId.split(".")
|
@@ -195,7 +248,6 @@ def handle_call(span, kwargs, response):
|
|
195
248
|
request_body = json.loads(kwargs.get("body"))
|
196
249
|
response_body = json.loads(response.get("body").read())
|
197
250
|
|
198
|
-
set_span_attribute(span, SpanAttributes.LLM_SYSTEM, vendor)
|
199
251
|
set_span_attribute(span, SpanAttributes.LLM_RESPONSE_MODEL, modelId)
|
200
252
|
set_span_attribute(span, SpanAttributes.LLM_REQUEST_MODEL, modelId)
|
201
253
|
|
@@ -222,12 +274,18 @@ def set_llama_meta_attributes(span, request_body, response_body):
|
|
222
274
|
set_span_attribute(
|
223
275
|
span, SpanAttributes.LLM_REQUEST_MAX_TOKENS, request_body.get("max_gen_len")
|
224
276
|
)
|
277
|
+
if "invocation_metrics" in response_body:
|
278
|
+
input_tokens = response_body.get("invocation_metrics").get("inputTokenCount")
|
279
|
+
output_tokens = response_body.get("invocation_metrics").get("outputTokenCount")
|
280
|
+
else:
|
281
|
+
input_tokens = response_body.get("prompt_token_count")
|
282
|
+
output_tokens = response_body.get("generation_token_count")
|
225
283
|
|
226
284
|
set_usage_attributes(
|
227
285
|
span,
|
228
286
|
{
|
229
|
-
"input_tokens":
|
230
|
-
"output_tokens":
|
287
|
+
"input_tokens": input_tokens,
|
288
|
+
"output_tokens": output_tokens,
|
231
289
|
},
|
232
290
|
)
|
233
291
|
|
@@ -245,7 +303,6 @@ def set_llama_meta_attributes(span, request_body, response_body):
|
|
245
303
|
}
|
246
304
|
]
|
247
305
|
set_span_attribute(span, SpanAttributes.LLM_PROMPTS, json.dumps(prompts))
|
248
|
-
print(completions)
|
249
306
|
set_event_completion(span, completions)
|
250
307
|
|
251
308
|
|
@@ -257,13 +314,22 @@ def set_amazon_attributes(span, request_body, response_body):
|
|
257
314
|
"content": request_body.get("inputText"),
|
258
315
|
}
|
259
316
|
]
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
317
|
+
if "results" in response_body:
|
318
|
+
completions = [
|
319
|
+
{
|
320
|
+
"role": "assistant",
|
321
|
+
"content": result.get("outputText"),
|
322
|
+
}
|
323
|
+
for result in response_body.get("results")
|
324
|
+
]
|
325
|
+
|
326
|
+
else:
|
327
|
+
completions = [
|
328
|
+
{
|
329
|
+
"role": "assistant",
|
330
|
+
"content": response_body.get("outputText"),
|
331
|
+
}
|
332
|
+
]
|
267
333
|
set_span_attribute(
|
268
334
|
span, SpanAttributes.LLM_REQUEST_MAX_TOKENS, config.get("maxTokenCount")
|
269
335
|
)
|
@@ -272,13 +338,19 @@ def set_amazon_attributes(span, request_body, response_body):
|
|
272
338
|
)
|
273
339
|
set_span_attribute(span, SpanAttributes.LLM_REQUEST_TOP_P, config.get("topP"))
|
274
340
|
set_span_attribute(span, SpanAttributes.LLM_PROMPTS, json.dumps(prompts))
|
341
|
+
input_tokens = response_body.get("inputTextTokenCount")
|
342
|
+
if "results" in response_body:
|
343
|
+
output_tokens = sum(
|
344
|
+
int(result.get("tokenCount")) for result in response_body.get("results")
|
345
|
+
)
|
346
|
+
else:
|
347
|
+
output_tokens = response_body.get("outputTextTokenCount")
|
348
|
+
|
275
349
|
set_usage_attributes(
|
276
350
|
span,
|
277
351
|
{
|
278
|
-
"input_tokens":
|
279
|
-
"output_tokens":
|
280
|
-
int(result.get("tokenCount")) for result in response_body.get("results")
|
281
|
-
),
|
352
|
+
"input_tokens": input_tokens,
|
353
|
+
"output_tokens": output_tokens,
|
282
354
|
},
|
283
355
|
)
|
284
356
|
set_event_completion(span, completions)
|
@@ -320,7 +392,7 @@ def set_anthropic_messages_attributes(span, request_body, response_body):
|
|
320
392
|
set_span_attribute(
|
321
393
|
span,
|
322
394
|
SpanAttributes.LLM_REQUEST_MAX_TOKENS,
|
323
|
-
request_body.get("max_tokens_to_sample"),
|
395
|
+
request_body.get("max_tokens_to_sample") or request_body.get("max_tokens"),
|
324
396
|
)
|
325
397
|
set_span_attribute(
|
326
398
|
span,
|
@@ -394,3 +466,62 @@ def set_span_streaming_response(span, response):
|
|
394
466
|
set_event_completion(
|
395
467
|
span, [{"role": role or "assistant", "content": streaming_response}]
|
396
468
|
)
|
469
|
+
|
470
|
+
|
471
|
+
class StreamingBedrockWrapper(ObjectProxy):
|
472
|
+
def __init__(
|
473
|
+
self,
|
474
|
+
response,
|
475
|
+
stream_done_callback=None,
|
476
|
+
):
|
477
|
+
super().__init__(response)
|
478
|
+
|
479
|
+
self._stream_done_callback = stream_done_callback
|
480
|
+
self._accumulating_body = {"generation": ""}
|
481
|
+
|
482
|
+
def __iter__(self):
|
483
|
+
for event in self.__wrapped__:
|
484
|
+
self._process_event(event)
|
485
|
+
yield event
|
486
|
+
|
487
|
+
def _process_event(self, event):
|
488
|
+
chunk = event.get("chunk")
|
489
|
+
if not chunk:
|
490
|
+
return
|
491
|
+
|
492
|
+
decoded_chunk = json.loads(chunk.get("bytes").decode())
|
493
|
+
type = decoded_chunk.get("type")
|
494
|
+
|
495
|
+
if type is None and "outputText" in decoded_chunk:
|
496
|
+
self._stream_done_callback(decoded_chunk)
|
497
|
+
return
|
498
|
+
if "generation" in decoded_chunk:
|
499
|
+
self._accumulating_body["generation"] += decoded_chunk.get("generation")
|
500
|
+
|
501
|
+
if type == "message_start":
|
502
|
+
self._accumulating_body = decoded_chunk.get("message")
|
503
|
+
elif type == "content_block_start":
|
504
|
+
self._accumulating_body["content"].append(
|
505
|
+
decoded_chunk.get("content_block")
|
506
|
+
)
|
507
|
+
elif type == "content_block_delta":
|
508
|
+
self._accumulating_body["content"][-1]["text"] += decoded_chunk.get(
|
509
|
+
"delta"
|
510
|
+
).get("text")
|
511
|
+
|
512
|
+
elif self.has_finished(type, decoded_chunk):
|
513
|
+
self._accumulating_body["invocation_metrics"] = decoded_chunk.get(
|
514
|
+
"amazon-bedrock-invocationMetrics"
|
515
|
+
)
|
516
|
+
self._stream_done_callback(self._accumulating_body)
|
517
|
+
|
518
|
+
def has_finished(self, type, chunk):
|
519
|
+
if type and type == "message_stop":
|
520
|
+
return True
|
521
|
+
|
522
|
+
if "completionReason" in chunk and chunk.get("completionReason") == "FINISH":
|
523
|
+
return True
|
524
|
+
|
525
|
+
if "stop_reason" in chunk and chunk.get("stop_reason") is not None:
|
526
|
+
return True
|
527
|
+
return False
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "3.3.24"
|
@@ -1,19 +0,0 @@
|
|
1
|
-
from examples.awsbedrock_examples.converse import (
|
2
|
-
use_converse_stream,
|
3
|
-
use_converse,
|
4
|
-
use_invoke_model_anthropic,
|
5
|
-
use_invoke_model_cohere,
|
6
|
-
use_invoke_model_amazon,
|
7
|
-
)
|
8
|
-
from langtrace_python_sdk import langtrace, with_langtrace_root_span
|
9
|
-
|
10
|
-
|
11
|
-
class AWSBedrockRunner:
|
12
|
-
@with_langtrace_root_span("AWS_Bedrock")
|
13
|
-
def run(self):
|
14
|
-
|
15
|
-
use_converse_stream()
|
16
|
-
use_converse()
|
17
|
-
use_invoke_model_anthropic()
|
18
|
-
use_invoke_model_cohere()
|
19
|
-
use_invoke_model_amazon()
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "3.3.23"
|
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.23 → langtrace_python_sdk-3.3.24}/src/examples/autogen_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/autogen_example/main.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/cerebras_example/main.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/chroma_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/chroma_example/basic.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/cohere_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/cohere_example/chat.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/cohere_example/chatv2.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/cohere_example/embed.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/cohere_example/rerank.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/cohere_example/rerankv2.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/cohere_example/tools.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/crewai_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/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.23 → langtrace_python_sdk-3.3.24}/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.23 → langtrace_python_sdk-3.3.24}/src/examples/dspy_example/quiz_gen.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/dspy_example/react.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/fastapi_example/__init__.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/gemini_example/__init__.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/gemini_example/main.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/hiveagent_example/basic.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/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.23 → langtrace_python_sdk-3.3.24}/src/examples/langchain_example/tool.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/langgraph_example/main.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/litellm_example/basic.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/litellm_example/config.yaml
RENAMED
File without changes
|
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/llamaindex_example/agent.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/llamaindex_example/basic.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/milvus_example/main.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/mistral_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/mistral_example/complete.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/ollama_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/src/examples/ollama_example/basic.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.23 → langtrace_python_sdk-3.3.24}/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
|