langtrace-python-sdk 3.3.22__tar.gz → 3.3.23__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/PKG-INFO +1 -1
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/gemini_example/main.py +3 -3
- langtrace_python_sdk-3.3.23/src/examples/google_genai_example/__init__.py +7 -0
- langtrace_python_sdk-3.3.23/src/examples/google_genai_example/main.py +27 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/__init__.py +2 -0
- langtrace_python_sdk-3.3.23/src/langtrace_python_sdk/instrumentation/google_genai/__init__.py +3 -0
- langtrace_python_sdk-3.3.23/src/langtrace_python_sdk/instrumentation/google_genai/instrumentation.py +30 -0
- langtrace_python_sdk-3.3.23/src/langtrace_python_sdk/instrumentation/google_genai/patch.py +126 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/langtrace.py +2 -0
- langtrace_python_sdk-3.3.23/src/langtrace_python_sdk/version.py +1 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/run_example.py +8 -1
- langtrace_python_sdk-3.3.22/src/langtrace_python_sdk/version.py +0 -1
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/.gitignore +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/LICENSE +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/README.md +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/pyproject.toml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/anthropic_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/anthropic_example/completion.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/autogen_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/autogen_example/main.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/awsbedrock_examples/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/awsbedrock_examples/converse.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/azureopenai_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/azureopenai_example/completion.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/cerebras_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/cerebras_example/main.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/chroma_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/chroma_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/cohere_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/cohere_example/chat.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/cohere_example/chat_stream.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/cohere_example/chat_streamv2.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/cohere_example/chatv2.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/cohere_example/embed.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/cohere_example/rerank.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/cohere_example/rerankv2.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/cohere_example/tools.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/crewai_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/crewai_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/crewai_example/instagram_post/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/crewai_example/instagram_post/agents.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/crewai_example/instagram_post/main.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/crewai_example/instagram_post/tasks.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/crewai_example/instagram_post/tools/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/crewai_example/instagram_post/tools/browser_tools.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/crewai_example/simple_agent/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/crewai_example/simple_agent/agents.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/crewai_example/simple_agent/main.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/crewai_example/simple_agent/tasks.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/crewai_example/trip_planner/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/crewai_example/trip_planner/agents.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/crewai_example/trip_planner/main.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/crewai_example/trip_planner/tasks.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/crewai_example/trip_planner/tools/calculator.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/crewai_example/trip_planner/tools/search_tools.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/dspy_example/QA_basic.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/dspy_example/QA_basic_with_chain_of_thought.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/dspy_example/QA_basic_with_signature.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/dspy_example/QA_multi_step_with_chain_of_thought.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/dspy_example/math_problems_cot.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/dspy_example/math_problems_cot_parallel.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/dspy_example/optimizers/bootstrap_fewshot.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/dspy_example/program_of_thought_basic.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/dspy_example/quiz_gen.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/dspy_example/react.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/embedchain_example/simple.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/fastapi_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/fastapi_example/basic_route.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/gemini_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/gemini_example/function_tools.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/hiveagent_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/inspect_ai_example/basic_eval.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/langchain_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/langchain_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/langchain_example/groq_example.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/langchain_example/langchain_google_example.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/langchain_example/langgraph_example.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/langchain_example/langgraph_example_tools.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/langchain_example/sagemaker.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/langchain_example/tool.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/langgraph_example/main.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/litellm_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/litellm_example/config.yaml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/litellm_example/proxy_basic.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/llamaindex_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/llamaindex_example/agent.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/llamaindex_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/llamaindex_example/data/abramov.txt +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/milvus_example/main.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/mistral_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/mistral_example/complete.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/mistral_example/complete_async.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/mistral_example/embeddings.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/mongo_vector_search_example/main.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/ollama_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/ollama_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/openai_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/openai_example/async_tool_calling_nonstreaming.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/openai_example/async_tool_calling_streaming.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/openai_example/chat_completion.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/openai_example/chat_completion_tool_choice.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/openai_example/embeddings_create.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/openai_example/function_calling.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/openai_example/images_edit.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/openai_example/images_generate.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/openai_example/resources/lounge_flamingo.png +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/openai_example/resources/mask.png +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/openai_example/send_user_feedback.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/openai_example/tool_calling.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/openai_example/tool_calling_nonstreaming.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/openai_example/tool_calling_streaming.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/otlp_example/otlp_basic.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/otlp_example/otlp_with_langtrace.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/perplexity_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/pinecone_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/pinecone_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/qdrant_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/qdrant_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/routellm_example/basic.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/vertexai_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/vertexai_example/main.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/weaviate_example/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/weaviate_example/query_text.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/constants/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/constants/exporter/langtrace_exporter.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/constants/instrumentation/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/constants/instrumentation/anthropic.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/constants/instrumentation/aws_bedrock.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/constants/instrumentation/chroma.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/constants/instrumentation/cohere.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/constants/instrumentation/common.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/constants/instrumentation/embedchain.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/constants/instrumentation/gemini.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/constants/instrumentation/groq.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/constants/instrumentation/litellm.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/constants/instrumentation/milvus.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/constants/instrumentation/mistral.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/constants/instrumentation/ollama.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/constants/instrumentation/openai.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/constants/instrumentation/pinecone.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/constants/instrumentation/pymongo.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/constants/instrumentation/qdrant.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/constants/instrumentation/vertexai.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/constants/instrumentation/weaviate.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/extensions/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/extensions/langtrace_exporter.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/extensions/langtrace_filesystem.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/anthropic/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/anthropic/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/anthropic/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/anthropic/types.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/autogen/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/autogen/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/autogen/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/aws_bedrock/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/aws_bedrock/bedrock_streaming_wrapper.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/aws_bedrock/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/aws_bedrock/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/aws_bedrock/stream_body_wrapper.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/cerebras/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/cerebras/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/cerebras/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/chroma/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/chroma/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/chroma/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/cohere/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/cohere/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/cohere/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/crewai/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/crewai/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/crewai/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/dspy/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/dspy/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/dspy/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/embedchain/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/embedchain/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/embedchain/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/gemini/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/gemini/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/gemini/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/groq/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/groq/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/groq/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/langchain/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/langchain/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/langchain/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/langchain_community/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/langchain_community/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/langchain_community/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/langchain_core/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/langchain_core/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/langchain_core/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/langgraph/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/langgraph/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/langgraph/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/litellm/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/litellm/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/litellm/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/litellm/types.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/llamaindex/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/llamaindex/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/llamaindex/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/milvus/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/milvus/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/milvus/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/mistral/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/mistral/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/mistral/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/ollama/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/ollama/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/ollama/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/openai/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/openai/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/openai/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/openai/types.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/pinecone/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/pinecone/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/pinecone/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/pymongo/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/pymongo/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/pymongo/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/qdrant/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/qdrant/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/qdrant/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/vertexai/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/vertexai/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/vertexai/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/weaviate/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/weaviate/instrumentation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/instrumentation/weaviate/patch.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/types/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/utils/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/utils/langtrace_sampler.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/utils/llm.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/utils/misc.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/utils/prompt_registry.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/utils/sdk_version_checker.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/utils/silently_fail.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/utils/types.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/utils/with_root_span.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/__init__.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/anthropic/cassettes/test_anthropic.yaml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/anthropic/cassettes/test_anthropic_streaming.yaml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/anthropic/cassettes/test_async_anthropic_streaming.yaml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/anthropic/conftest.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/anthropic/test_anthropic.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/chroma/conftest.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/chroma/test_chroma.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/cohere/cassettes/test_cohere_chat.yaml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/cohere/cassettes/test_cohere_chat_streaming.yaml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/cohere/cassettes/test_cohere_embed.yaml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/cohere/cassettes/test_cohere_rerank.yaml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/cohere/conftest.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/cohere/test_cohere_chat.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/cohere/test_cohere_embed.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/cohere/test_cohere_rerank.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/conftest.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/groq/cassettes/test_async_chat_completion.yaml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/groq/cassettes/test_async_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/groq/cassettes/test_chat_completion.yaml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/groq/cassettes/test_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/groq/conftest.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/groq/test_groq.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/langchain/cassettes/test_langchain.yaml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/langchain/conftest.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/langchain/test_langchain.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/openai/cassettes/test_async_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/openai/cassettes/test_async_image_generation.yaml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/openai/cassettes/test_chat_completion.yaml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/openai/cassettes/test_chat_completion_streaming.yaml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/openai/cassettes/test_embeddings_base_url.yaml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/openai/cassettes/test_image_generation.yaml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/openai/conftest.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/openai/test_chat_completion.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/openai/test_embeddings.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/openai/test_image_generation.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/pinecone/cassettes/test_query.yaml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/pinecone/cassettes/test_upsert.yaml +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/pinecone/conftest.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/pinecone/test_pinecone.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/qdrant/conftest.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/qdrant/test_qdrant.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/test_session_id.py +0 -0
- {langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/tests/utils.py +0 -0
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/gemini_example/main.py
RENAMED
@@ -20,16 +20,16 @@ async def async_demo():
|
|
20
20
|
|
21
21
|
def basic():
|
22
22
|
generate()
|
23
|
-
generate(stream=True, with_tools=True)
|
23
|
+
# generate(stream=True, with_tools=True)
|
24
24
|
|
25
25
|
# image_to_text()
|
26
26
|
# audio_to_text()
|
27
|
-
asyncio.run(async_demo())
|
27
|
+
# asyncio.run(async_demo())
|
28
28
|
|
29
29
|
|
30
30
|
def generate(stream=False, with_tools=False):
|
31
31
|
model = genai.GenerativeModel(
|
32
|
-
"gemini-
|
32
|
+
"gemini-2.0-flash-exp", system_instruction="You are a cat. Your name is Neko."
|
33
33
|
)
|
34
34
|
|
35
35
|
response = model.generate_content(
|
@@ -0,0 +1,27 @@
|
|
1
|
+
from google import genai
|
2
|
+
from dotenv import load_dotenv
|
3
|
+
import os
|
4
|
+
from langtrace_python_sdk import langtrace
|
5
|
+
|
6
|
+
load_dotenv()
|
7
|
+
langtrace.init(write_spans_to_console=False)
|
8
|
+
|
9
|
+
|
10
|
+
def generate_content():
|
11
|
+
# Only run this block for Google AI API
|
12
|
+
client = genai.Client(api_key=os.getenv("GEMINI_API_KEY"))
|
13
|
+
response = client.models.generate_content(
|
14
|
+
model="gemini-2.0-flash-exp", contents="What is your name?"
|
15
|
+
)
|
16
|
+
|
17
|
+
print(response.text)
|
18
|
+
|
19
|
+
|
20
|
+
def generate_content_streaming():
|
21
|
+
client = genai.Client(api_key=os.getenv("GEMINI_API_KEY"))
|
22
|
+
response = client.models.generate_content_stream(
|
23
|
+
model="gemini-2.0-flash-exp", contents="What is your name?"
|
24
|
+
)
|
25
|
+
|
26
|
+
for chunk in response:
|
27
|
+
pass
|
@@ -24,6 +24,7 @@ from .litellm import LiteLLMInstrumentation
|
|
24
24
|
from .pymongo import PyMongoInstrumentation
|
25
25
|
from .cerebras import CerebrasInstrumentation
|
26
26
|
from .milvus import MilvusInstrumentation
|
27
|
+
from .google_genai import GoogleGenaiInstrumentation
|
27
28
|
|
28
29
|
__all__ = [
|
29
30
|
"AnthropicInstrumentation",
|
@@ -52,4 +53,5 @@ __all__ = [
|
|
52
53
|
"AWSBedrockInstrumentation",
|
53
54
|
"CerebrasInstrumentation",
|
54
55
|
"MilvusInstrumentation",
|
56
|
+
"GoogleGenaiInstrumentation",
|
55
57
|
]
|
langtrace_python_sdk-3.3.23/src/langtrace_python_sdk/instrumentation/google_genai/instrumentation.py
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
from typing import Collection
|
2
|
+
from importlib_metadata import version as v
|
3
|
+
from wrapt import wrap_function_wrapper as _W
|
4
|
+
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
|
5
|
+
from opentelemetry.trace import get_tracer
|
6
|
+
from .patch import patch_google_genai, patch_google_genai_streaming
|
7
|
+
|
8
|
+
|
9
|
+
class GoogleGenaiInstrumentation(BaseInstrumentor):
|
10
|
+
def instrumentation_dependencies(self) -> Collection[str]:
|
11
|
+
return ["google-genai >= 0.1.0", "google-generativeai < 1.0.0"]
|
12
|
+
|
13
|
+
def _instrument(self, **kwargs):
|
14
|
+
trace_provider = kwargs.get("tracer_provider")
|
15
|
+
tracer = get_tracer(__name__, "", trace_provider)
|
16
|
+
version = v("google-genai")
|
17
|
+
|
18
|
+
_W(
|
19
|
+
module="google.genai",
|
20
|
+
name="models.Models.generate_content",
|
21
|
+
wrapper=patch_google_genai(tracer, version),
|
22
|
+
)
|
23
|
+
_W(
|
24
|
+
module="google.genai",
|
25
|
+
name="models.Models.generate_content_stream",
|
26
|
+
wrapper=patch_google_genai_streaming(tracer, version),
|
27
|
+
)
|
28
|
+
|
29
|
+
def _uninstrument(self, **kwargs):
|
30
|
+
pass
|
@@ -0,0 +1,126 @@
|
|
1
|
+
from langtrace_python_sdk.utils.llm import (
|
2
|
+
get_langtrace_attributes,
|
3
|
+
get_llm_request_attributes,
|
4
|
+
set_span_attributes,
|
5
|
+
set_usage_attributes,
|
6
|
+
set_span_attribute,
|
7
|
+
set_event_completion,
|
8
|
+
)
|
9
|
+
from langtrace_python_sdk.utils import handle_span_error
|
10
|
+
|
11
|
+
from opentelemetry.trace import Tracer, SpanKind
|
12
|
+
from opentelemetry.sdk.trace import Span
|
13
|
+
from langtrace.trace_attributes import SpanAttributes
|
14
|
+
|
15
|
+
from typing import Iterator
|
16
|
+
|
17
|
+
|
18
|
+
def patch_google_genai(tracer: Tracer, version: str):
|
19
|
+
def traced_method(wrapped, instance, args, kwargs):
|
20
|
+
prompt = [
|
21
|
+
{
|
22
|
+
"role": "user",
|
23
|
+
"content": kwargs["contents"],
|
24
|
+
}
|
25
|
+
]
|
26
|
+
span_attributes = {
|
27
|
+
**get_langtrace_attributes(
|
28
|
+
service_provider="google_genai", version=version
|
29
|
+
),
|
30
|
+
**get_llm_request_attributes(kwargs=kwargs, prompts=prompt),
|
31
|
+
}
|
32
|
+
with tracer.start_as_current_span(
|
33
|
+
name="google.genai.generate_content",
|
34
|
+
kind=SpanKind.CLIENT,
|
35
|
+
) as span:
|
36
|
+
try:
|
37
|
+
set_span_attributes(span, span_attributes)
|
38
|
+
response = wrapped(*args, **kwargs)
|
39
|
+
set_response_attributes(span, response)
|
40
|
+
return response
|
41
|
+
except Exception as error:
|
42
|
+
handle_span_error(span, error)
|
43
|
+
raise
|
44
|
+
|
45
|
+
return traced_method
|
46
|
+
|
47
|
+
|
48
|
+
def patch_google_genai_streaming(tracer: Tracer, version: str):
|
49
|
+
def traced_method(wrapped, instance, args, kwargs):
|
50
|
+
prompt = [
|
51
|
+
{
|
52
|
+
"role": "user",
|
53
|
+
"content": kwargs["contents"],
|
54
|
+
}
|
55
|
+
]
|
56
|
+
span_attributes = {
|
57
|
+
**get_langtrace_attributes(
|
58
|
+
service_provider="google_genai", version=version
|
59
|
+
),
|
60
|
+
**get_llm_request_attributes(kwargs=kwargs, prompts=prompt),
|
61
|
+
}
|
62
|
+
with tracer.start_as_current_span(
|
63
|
+
name="google.genai.generate_content_stream",
|
64
|
+
kind=SpanKind.CLIENT,
|
65
|
+
) as span:
|
66
|
+
set_span_attributes(span, span_attributes)
|
67
|
+
response = wrapped(*args, **kwargs)
|
68
|
+
set_streaming_response_attributes(span, response)
|
69
|
+
return response
|
70
|
+
|
71
|
+
return traced_method
|
72
|
+
|
73
|
+
|
74
|
+
def set_streaming_response_attributes(span: Span, response):
|
75
|
+
accum_completion = ""
|
76
|
+
for chunk in response:
|
77
|
+
set_span_attribute(
|
78
|
+
span,
|
79
|
+
SpanAttributes.LLM_RESPONSE_MODEL,
|
80
|
+
chunk.model_version,
|
81
|
+
)
|
82
|
+
candidates = chunk.candidates
|
83
|
+
for candidate in candidates:
|
84
|
+
set_span_attribute(
|
85
|
+
span,
|
86
|
+
SpanAttributes.LLM_RESPONSE_FINISH_REASON,
|
87
|
+
candidate.finish_reason,
|
88
|
+
)
|
89
|
+
|
90
|
+
accum_completion += candidate.content.parts[0].text
|
91
|
+
|
92
|
+
if chunk.usage_metadata:
|
93
|
+
set_usage_attributes(
|
94
|
+
span,
|
95
|
+
{
|
96
|
+
"input_tokens": chunk.usage_metadata.prompt_token_count,
|
97
|
+
"output_tokens": chunk.usage_metadata.candidates_token_count,
|
98
|
+
},
|
99
|
+
)
|
100
|
+
set_event_completion(span, [{"role": "assistant", "content": accum_completion}])
|
101
|
+
|
102
|
+
|
103
|
+
def set_response_attributes(span: Span, response):
|
104
|
+
completions = []
|
105
|
+
for candidate in response.candidates:
|
106
|
+
set_span_attribute(
|
107
|
+
span, SpanAttributes.LLM_RESPONSE_FINISH_REASON, candidate.finish_reason
|
108
|
+
)
|
109
|
+
parts = candidate.content.parts
|
110
|
+
role = candidate.content.role
|
111
|
+
completion = {
|
112
|
+
"role": role or "assistant",
|
113
|
+
"content": [part.text for part in parts],
|
114
|
+
}
|
115
|
+
completions.append(completion)
|
116
|
+
|
117
|
+
set_span_attribute(span, SpanAttributes.LLM_RESPONSE_MODEL, response.model_version)
|
118
|
+
set_event_completion(span, completions)
|
119
|
+
if response.usage_metadata:
|
120
|
+
set_usage_attributes(
|
121
|
+
span,
|
122
|
+
{
|
123
|
+
"input_tokens": response.usage_metadata.prompt_token_count,
|
124
|
+
"output_tokens": response.usage_metadata.candidates_token_count,
|
125
|
+
},
|
126
|
+
)
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/langtrace_python_sdk/langtrace.py
RENAMED
@@ -68,6 +68,7 @@ from langtrace_python_sdk.instrumentation import (
|
|
68
68
|
PyMongoInstrumentation,
|
69
69
|
CerebrasInstrumentation,
|
70
70
|
MilvusInstrumentation,
|
71
|
+
GoogleGenaiInstrumentation,
|
71
72
|
)
|
72
73
|
from opentelemetry.util.re import parse_env_headers
|
73
74
|
|
@@ -301,6 +302,7 @@ def init(
|
|
301
302
|
"vertexai": VertexAIInstrumentation(),
|
302
303
|
"google-cloud-aiplatform": VertexAIInstrumentation(),
|
303
304
|
"google-generativeai": GeminiInstrumentation(),
|
305
|
+
"google-genai": GoogleGenaiInstrumentation(),
|
304
306
|
"mistralai": MistralInstrumentation(),
|
305
307
|
"boto3": AWSBedrockInstrumentation(),
|
306
308
|
"autogen": AutogenInstrumentation(),
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "3.3.23"
|
@@ -20,8 +20,9 @@ ENABLED_EXAMPLES = {
|
|
20
20
|
"vertexai": False,
|
21
21
|
"gemini": False,
|
22
22
|
"mistral": False,
|
23
|
-
"awsbedrock":
|
23
|
+
"awsbedrock": False,
|
24
24
|
"cerebras": False,
|
25
|
+
"google_genai": True,
|
25
26
|
}
|
26
27
|
|
27
28
|
if ENABLED_EXAMPLES["anthropic"]:
|
@@ -137,3 +138,9 @@ if ENABLED_EXAMPLES["cerebras"]:
|
|
137
138
|
|
138
139
|
print(Fore.BLUE + "Running Cerebras example" + Fore.RESET)
|
139
140
|
CerebrasRunner().run()
|
141
|
+
|
142
|
+
if ENABLED_EXAMPLES["google_genai"]:
|
143
|
+
from examples.google_genai_example import GoogleGenaiRunner
|
144
|
+
|
145
|
+
print(Fore.BLUE + "Running Google Genai example" + Fore.RESET)
|
146
|
+
GoogleGenaiRunner().run()
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "3.3.22"
|
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.22 → langtrace_python_sdk-3.3.23}/src/examples/autogen_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/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.22 → langtrace_python_sdk-3.3.23}/src/examples/cerebras_example/main.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/chroma_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/chroma_example/basic.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/cohere_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/cohere_example/chat.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/cohere_example/chatv2.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/cohere_example/embed.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/cohere_example/rerank.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/cohere_example/rerankv2.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/cohere_example/tools.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/crewai_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/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.22 → langtrace_python_sdk-3.3.23}/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.22 → langtrace_python_sdk-3.3.23}/src/examples/dspy_example/quiz_gen.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/dspy_example/react.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/fastapi_example/__init__.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/gemini_example/__init__.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/hiveagent_example/basic.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/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.22 → langtrace_python_sdk-3.3.23}/src/examples/langchain_example/tool.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/langgraph_example/main.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/litellm_example/basic.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/litellm_example/config.yaml
RENAMED
File without changes
|
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/llamaindex_example/agent.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/llamaindex_example/basic.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/milvus_example/main.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/mistral_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/mistral_example/complete.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/ollama_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/ollama_example/basic.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/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.22 → langtrace_python_sdk-3.3.23}/src/examples/otlp_example/otlp_basic.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/perplexity_example/basic.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/pinecone_example/basic.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/qdrant_example/__init__.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/qdrant_example/basic.py
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/routellm_example/basic.py
RENAMED
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/src/examples/vertexai_example/main.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{langtrace_python_sdk-3.3.22 → langtrace_python_sdk-3.3.23}/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
|