openlit 1.34.32__tar.gz → 1.34.33__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {openlit-1.34.32 → openlit-1.34.33}/PKG-INFO +1 -1
- {openlit-1.34.32 → openlit-1.34.33}/pyproject.toml +1 -1
- openlit-1.34.33/src/openlit/instrumentation/pydantic_ai/__init__.py +170 -0
- openlit-1.34.33/src/openlit/instrumentation/pydantic_ai/async_pydantic_ai.py +38 -0
- openlit-1.34.33/src/openlit/instrumentation/pydantic_ai/pydantic_ai.py +193 -0
- openlit-1.34.33/src/openlit/instrumentation/pydantic_ai/utils.py +913 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/semcov/__init__.py +49 -0
- openlit-1.34.32/src/openlit/instrumentation/pydantic_ai/__init__.py +0 -82
- openlit-1.34.32/src/openlit/instrumentation/pydantic_ai/pydantic_ai.py +0 -104
- openlit-1.34.32/src/openlit/instrumentation/pydantic_ai/utils.py +0 -160
- {openlit-1.34.32 → openlit-1.34.33}/LICENSE +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/README.md +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/__helpers.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/_instrumentors.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/evals/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/evals/all.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/evals/bias_detection.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/evals/hallucination.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/evals/toxicity.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/evals/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/guard/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/guard/all.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/guard/prompt_injection.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/guard/restrict_topic.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/guard/sensitive_topic.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/guard/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/ag2/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/ag2/ag2.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/ag2/async_ag2.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/ag2/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/ai21/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/ai21/ai21.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/ai21/async_ai21.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/ai21/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/anthropic/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/anthropic/anthropic.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/anthropic/async_anthropic.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/anthropic/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/assemblyai/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/assemblyai/assemblyai.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/assemblyai/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/astra/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/astra/astra.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/astra/async_astra.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/astra/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/azure_ai_inference/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/azure_ai_inference/async_azure_ai_inference.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/azure_ai_inference/azure_ai_inference.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/azure_ai_inference/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/bedrock/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/bedrock/bedrock.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/bedrock/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/chroma/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/chroma/chroma.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/chroma/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/cohere/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/cohere/async_cohere.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/cohere/cohere.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/cohere/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/controlflow/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/controlflow/controlflow.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/crawl4ai/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/crawl4ai/async_crawl4ai.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/crawl4ai/crawl4ai.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/crewai/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/crewai/async_crewai.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/crewai/crewai.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/crewai/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/dynamiq/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/dynamiq/dynamiq.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/elevenlabs/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/elevenlabs/async_elevenlabs.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/elevenlabs/elevenlabs.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/elevenlabs/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/embedchain/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/embedchain/embedchain.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/firecrawl/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/firecrawl/firecrawl.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/google_ai_studio/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/google_ai_studio/async_google_ai_studio.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/google_ai_studio/google_ai_studio.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/google_ai_studio/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/gpt4all/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/gpt4all/gpt4all.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/gpt4all/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/gpu/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/groq/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/groq/async_groq.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/groq/groq.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/groq/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/haystack/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/haystack/async_haystack.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/haystack/haystack.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/haystack/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/julep/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/julep/async_julep.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/julep/julep.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/langchain/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/langchain/callback_handler.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/langchain_community/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/langchain_community/async_langchain_community.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/langchain_community/langchain_community.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/langchain_community/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/letta/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/letta/letta.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/litellm/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/litellm/async_litellm.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/litellm/litellm.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/litellm/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/llamaindex/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/llamaindex/async_llamaindex.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/llamaindex/llamaindex.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/llamaindex/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/mem0/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/mem0/mem0.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/milvus/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/milvus/milvus.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/milvus/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/mistral/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/mistral/async_mistral.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/mistral/mistral.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/mistral/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/multion/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/multion/async_multion.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/multion/multion.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/ollama/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/ollama/async_ollama.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/ollama/ollama.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/ollama/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/openai/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/openai/async_openai.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/openai/openai.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/openai/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/openai_agents/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/openai_agents/processor.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/phidata/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/phidata/phidata.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/pinecone/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/pinecone/async_pinecone.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/pinecone/pinecone.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/pinecone/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/premai/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/premai/premai.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/premai/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/qdrant/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/qdrant/async_qdrant.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/qdrant/qdrant.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/qdrant/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/reka/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/reka/async_reka.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/reka/reka.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/reka/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/together/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/together/async_together.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/together/together.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/together/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/transformers/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/transformers/transformers.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/transformers/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/vertexai/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/vertexai/async_vertexai.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/vertexai/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/vertexai/vertexai.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/vllm/__init__.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/vllm/utils.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/instrumentation/vllm/vllm.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/otel/events.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/otel/metrics.py +0 -0
- {openlit-1.34.32 → openlit-1.34.33}/src/openlit/otel/tracing.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: openlit
|
3
|
-
Version: 1.34.
|
3
|
+
Version: 1.34.33
|
4
4
|
Summary: OpenTelemetry-native Auto instrumentation library for monitoring LLM Applications and GPUs, facilitating the integration of observability into your GenAI-driven projects
|
5
5
|
License: Apache-2.0
|
6
6
|
Keywords: OpenTelemetry,otel,otlp,llm,tracing,openai,anthropic,claude,cohere,llm monitoring,observability,monitoring,gpt,Generative AI,chatGPT,gpu
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "openlit"
|
3
|
-
version = "1.34.
|
3
|
+
version = "1.34.33"
|
4
4
|
description = "OpenTelemetry-native Auto instrumentation library for monitoring LLM Applications and GPUs, facilitating the integration of observability into your GenAI-driven projects"
|
5
5
|
authors = ["OpenLIT"]
|
6
6
|
license = "Apache-2.0"
|
@@ -0,0 +1,170 @@
|
|
1
|
+
"""Initializer of Auto Instrumentation of Pydantic AI Functions"""
|
2
|
+
|
3
|
+
from typing import Collection
|
4
|
+
import importlib.metadata
|
5
|
+
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
|
6
|
+
from wrapt import wrap_function_wrapper
|
7
|
+
|
8
|
+
from openlit.instrumentation.pydantic_ai.pydantic_ai import (
|
9
|
+
agent_create,
|
10
|
+
agent_run,
|
11
|
+
graph_execution,
|
12
|
+
user_prompt_processing,
|
13
|
+
model_request_processing,
|
14
|
+
tool_calls_processing,
|
15
|
+
)
|
16
|
+
from openlit.instrumentation.pydantic_ai.async_pydantic_ai import (
|
17
|
+
async_agent_run,
|
18
|
+
)
|
19
|
+
|
20
|
+
_instruments = ("pydantic-ai >= 0.2.17",)
|
21
|
+
|
22
|
+
|
23
|
+
class PydanticAIInstrumentor(BaseInstrumentor):
|
24
|
+
"""
|
25
|
+
An instrumentor for Pydantic AI's client library.
|
26
|
+
"""
|
27
|
+
|
28
|
+
def instrumentation_dependencies(self) -> Collection[str]:
|
29
|
+
return _instruments
|
30
|
+
|
31
|
+
def _instrument(self, **kwargs):
|
32
|
+
application_name = kwargs.get("application_name", "default_application")
|
33
|
+
environment = kwargs.get("environment", "default_environment")
|
34
|
+
tracer = kwargs.get("tracer")
|
35
|
+
metrics = kwargs.get("metrics_dict")
|
36
|
+
pricing_info = kwargs.get("pricing_info", {})
|
37
|
+
capture_message_content = kwargs.get("capture_message_content", False)
|
38
|
+
disable_metrics = kwargs.get("disable_metrics")
|
39
|
+
version = importlib.metadata.version("pydantic-ai")
|
40
|
+
|
41
|
+
wrap_function_wrapper(
|
42
|
+
"pydantic_ai.agent",
|
43
|
+
"Agent.__init__",
|
44
|
+
agent_create(
|
45
|
+
version,
|
46
|
+
environment,
|
47
|
+
application_name,
|
48
|
+
tracer,
|
49
|
+
pricing_info,
|
50
|
+
capture_message_content,
|
51
|
+
metrics,
|
52
|
+
disable_metrics,
|
53
|
+
),
|
54
|
+
)
|
55
|
+
|
56
|
+
wrap_function_wrapper(
|
57
|
+
"pydantic_ai.agent",
|
58
|
+
"Agent.run_sync",
|
59
|
+
agent_run(
|
60
|
+
version,
|
61
|
+
environment,
|
62
|
+
application_name,
|
63
|
+
tracer,
|
64
|
+
pricing_info,
|
65
|
+
capture_message_content,
|
66
|
+
metrics,
|
67
|
+
disable_metrics,
|
68
|
+
),
|
69
|
+
)
|
70
|
+
|
71
|
+
wrap_function_wrapper(
|
72
|
+
"pydantic_ai.agent",
|
73
|
+
"Agent.run",
|
74
|
+
async_agent_run(
|
75
|
+
version,
|
76
|
+
environment,
|
77
|
+
application_name,
|
78
|
+
tracer,
|
79
|
+
pricing_info,
|
80
|
+
capture_message_content,
|
81
|
+
metrics,
|
82
|
+
disable_metrics,
|
83
|
+
),
|
84
|
+
)
|
85
|
+
|
86
|
+
# Enhanced instrumentation for richer span hierarchy
|
87
|
+
# These wrap internal Pydantic AI graph execution components
|
88
|
+
try:
|
89
|
+
# Agent.iter() - Graph execution iterator
|
90
|
+
wrap_function_wrapper(
|
91
|
+
"pydantic_ai.agent",
|
92
|
+
"Agent.iter",
|
93
|
+
graph_execution(
|
94
|
+
version,
|
95
|
+
environment,
|
96
|
+
application_name,
|
97
|
+
tracer,
|
98
|
+
pricing_info,
|
99
|
+
capture_message_content,
|
100
|
+
metrics,
|
101
|
+
disable_metrics,
|
102
|
+
),
|
103
|
+
)
|
104
|
+
except Exception:
|
105
|
+
# If Agent.iter doesn't exist, skip this instrumentation
|
106
|
+
pass
|
107
|
+
|
108
|
+
try:
|
109
|
+
# UserPromptNode.run() - User prompt processing
|
110
|
+
wrap_function_wrapper(
|
111
|
+
"pydantic_ai._agent_graph",
|
112
|
+
"UserPromptNode.run",
|
113
|
+
user_prompt_processing(
|
114
|
+
version,
|
115
|
+
environment,
|
116
|
+
application_name,
|
117
|
+
tracer,
|
118
|
+
pricing_info,
|
119
|
+
capture_message_content,
|
120
|
+
metrics,
|
121
|
+
disable_metrics,
|
122
|
+
),
|
123
|
+
)
|
124
|
+
except Exception:
|
125
|
+
# If UserPromptNode.run doesn't exist, skip this instrumentation
|
126
|
+
pass
|
127
|
+
|
128
|
+
try:
|
129
|
+
# ModelRequestNode.run() - Model request processing
|
130
|
+
wrap_function_wrapper(
|
131
|
+
"pydantic_ai._agent_graph",
|
132
|
+
"ModelRequestNode.run",
|
133
|
+
model_request_processing(
|
134
|
+
version,
|
135
|
+
environment,
|
136
|
+
application_name,
|
137
|
+
tracer,
|
138
|
+
pricing_info,
|
139
|
+
capture_message_content,
|
140
|
+
metrics,
|
141
|
+
disable_metrics,
|
142
|
+
),
|
143
|
+
)
|
144
|
+
except Exception:
|
145
|
+
# If ModelRequestNode.run doesn't exist, skip this instrumentation
|
146
|
+
pass
|
147
|
+
|
148
|
+
try:
|
149
|
+
# CallToolsNode.run() - Tool calls processing
|
150
|
+
wrap_function_wrapper(
|
151
|
+
"pydantic_ai._agent_graph",
|
152
|
+
"CallToolsNode.run",
|
153
|
+
tool_calls_processing(
|
154
|
+
version,
|
155
|
+
environment,
|
156
|
+
application_name,
|
157
|
+
tracer,
|
158
|
+
pricing_info,
|
159
|
+
capture_message_content,
|
160
|
+
metrics,
|
161
|
+
disable_metrics,
|
162
|
+
),
|
163
|
+
)
|
164
|
+
except Exception:
|
165
|
+
# If CallToolsNode.run doesn't exist, skip this instrumentation
|
166
|
+
pass
|
167
|
+
|
168
|
+
def _uninstrument(self, **kwargs):
|
169
|
+
# Proper uninstrumentation logic to revert patched methods
|
170
|
+
pass
|
@@ -0,0 +1,38 @@
|
|
1
|
+
"""
|
2
|
+
Module for monitoring async Pydantic AI API calls.
|
3
|
+
"""
|
4
|
+
|
5
|
+
from openlit.instrumentation.pydantic_ai.utils import (
|
6
|
+
common_agent_run_async,
|
7
|
+
)
|
8
|
+
|
9
|
+
|
10
|
+
def async_agent_run(
|
11
|
+
version,
|
12
|
+
environment,
|
13
|
+
application_name,
|
14
|
+
tracer,
|
15
|
+
pricing_info,
|
16
|
+
capture_message_content,
|
17
|
+
metrics,
|
18
|
+
disable_metrics,
|
19
|
+
):
|
20
|
+
"""
|
21
|
+
Generates a telemetry wrapper for async GenAI function call
|
22
|
+
"""
|
23
|
+
|
24
|
+
async def wrapper(wrapped, instance, args, kwargs):
|
25
|
+
return await common_agent_run_async(
|
26
|
+
wrapped,
|
27
|
+
instance,
|
28
|
+
args,
|
29
|
+
kwargs,
|
30
|
+
tracer,
|
31
|
+
version,
|
32
|
+
environment,
|
33
|
+
application_name,
|
34
|
+
capture_message_content,
|
35
|
+
pricing_info=pricing_info,
|
36
|
+
)
|
37
|
+
|
38
|
+
return wrapper
|
@@ -0,0 +1,193 @@
|
|
1
|
+
"""
|
2
|
+
Module for monitoring Pydantic AI API calls.
|
3
|
+
"""
|
4
|
+
|
5
|
+
from openlit.instrumentation.pydantic_ai.utils import (
|
6
|
+
common_agent_run,
|
7
|
+
common_agent_create,
|
8
|
+
common_graph_execution,
|
9
|
+
common_user_prompt_processing,
|
10
|
+
common_model_request_processing,
|
11
|
+
common_tool_calls_processing,
|
12
|
+
)
|
13
|
+
|
14
|
+
|
15
|
+
def agent_create(
|
16
|
+
version,
|
17
|
+
environment,
|
18
|
+
application_name,
|
19
|
+
tracer,
|
20
|
+
pricing_info,
|
21
|
+
capture_message_content,
|
22
|
+
metrics,
|
23
|
+
disable_metrics,
|
24
|
+
):
|
25
|
+
"""
|
26
|
+
Generates a telemetry wrapper for GenAI function call
|
27
|
+
"""
|
28
|
+
|
29
|
+
def wrapper(wrapped, instance, args, kwargs):
|
30
|
+
return common_agent_create(
|
31
|
+
wrapped,
|
32
|
+
instance,
|
33
|
+
args,
|
34
|
+
kwargs,
|
35
|
+
tracer,
|
36
|
+
version,
|
37
|
+
environment,
|
38
|
+
application_name,
|
39
|
+
capture_message_content,
|
40
|
+
)
|
41
|
+
|
42
|
+
return wrapper
|
43
|
+
|
44
|
+
|
45
|
+
def agent_run(
|
46
|
+
version,
|
47
|
+
environment,
|
48
|
+
application_name,
|
49
|
+
tracer,
|
50
|
+
pricing_info,
|
51
|
+
capture_message_content,
|
52
|
+
metrics,
|
53
|
+
disable_metrics,
|
54
|
+
):
|
55
|
+
"""
|
56
|
+
Generates a telemetry wrapper for GenAI function call
|
57
|
+
"""
|
58
|
+
|
59
|
+
def wrapper(wrapped, instance, args, kwargs):
|
60
|
+
return common_agent_run(
|
61
|
+
wrapped,
|
62
|
+
instance,
|
63
|
+
args,
|
64
|
+
kwargs,
|
65
|
+
tracer,
|
66
|
+
version,
|
67
|
+
environment,
|
68
|
+
application_name,
|
69
|
+
capture_message_content,
|
70
|
+
pricing_info=pricing_info,
|
71
|
+
)
|
72
|
+
|
73
|
+
return wrapper
|
74
|
+
|
75
|
+
|
76
|
+
def graph_execution(
|
77
|
+
version,
|
78
|
+
environment,
|
79
|
+
application_name,
|
80
|
+
tracer,
|
81
|
+
pricing_info,
|
82
|
+
capture_message_content,
|
83
|
+
metrics,
|
84
|
+
disable_metrics,
|
85
|
+
):
|
86
|
+
"""
|
87
|
+
Generates a telemetry wrapper for Pydantic AI graph execution
|
88
|
+
"""
|
89
|
+
|
90
|
+
def wrapper(wrapped, instance, args, kwargs):
|
91
|
+
return common_graph_execution(
|
92
|
+
wrapped,
|
93
|
+
instance,
|
94
|
+
args,
|
95
|
+
kwargs,
|
96
|
+
tracer,
|
97
|
+
version,
|
98
|
+
environment,
|
99
|
+
application_name,
|
100
|
+
capture_message_content,
|
101
|
+
)
|
102
|
+
|
103
|
+
return wrapper
|
104
|
+
|
105
|
+
|
106
|
+
def user_prompt_processing(
|
107
|
+
version,
|
108
|
+
environment,
|
109
|
+
application_name,
|
110
|
+
tracer,
|
111
|
+
pricing_info,
|
112
|
+
capture_message_content,
|
113
|
+
metrics,
|
114
|
+
disable_metrics,
|
115
|
+
):
|
116
|
+
"""
|
117
|
+
Generates a telemetry wrapper for Pydantic AI user prompt processing
|
118
|
+
"""
|
119
|
+
|
120
|
+
def wrapper(wrapped, instance, args, kwargs):
|
121
|
+
return common_user_prompt_processing(
|
122
|
+
wrapped,
|
123
|
+
instance,
|
124
|
+
args,
|
125
|
+
kwargs,
|
126
|
+
tracer,
|
127
|
+
version,
|
128
|
+
environment,
|
129
|
+
application_name,
|
130
|
+
capture_message_content,
|
131
|
+
)
|
132
|
+
|
133
|
+
return wrapper
|
134
|
+
|
135
|
+
|
136
|
+
def model_request_processing(
|
137
|
+
version,
|
138
|
+
environment,
|
139
|
+
application_name,
|
140
|
+
tracer,
|
141
|
+
pricing_info,
|
142
|
+
capture_message_content,
|
143
|
+
metrics,
|
144
|
+
disable_metrics,
|
145
|
+
):
|
146
|
+
"""
|
147
|
+
Generates a telemetry wrapper for Pydantic AI model request processing
|
148
|
+
"""
|
149
|
+
|
150
|
+
def wrapper(wrapped, instance, args, kwargs):
|
151
|
+
return common_model_request_processing(
|
152
|
+
wrapped,
|
153
|
+
instance,
|
154
|
+
args,
|
155
|
+
kwargs,
|
156
|
+
tracer,
|
157
|
+
version,
|
158
|
+
environment,
|
159
|
+
application_name,
|
160
|
+
capture_message_content,
|
161
|
+
)
|
162
|
+
|
163
|
+
return wrapper
|
164
|
+
|
165
|
+
|
166
|
+
def tool_calls_processing(
|
167
|
+
version,
|
168
|
+
environment,
|
169
|
+
application_name,
|
170
|
+
tracer,
|
171
|
+
pricing_info,
|
172
|
+
capture_message_content,
|
173
|
+
metrics,
|
174
|
+
disable_metrics,
|
175
|
+
):
|
176
|
+
"""
|
177
|
+
Generates a telemetry wrapper for Pydantic AI tool calls processing
|
178
|
+
"""
|
179
|
+
|
180
|
+
def wrapper(wrapped, instance, args, kwargs):
|
181
|
+
return common_tool_calls_processing(
|
182
|
+
wrapped,
|
183
|
+
instance,
|
184
|
+
args,
|
185
|
+
kwargs,
|
186
|
+
tracer,
|
187
|
+
version,
|
188
|
+
environment,
|
189
|
+
application_name,
|
190
|
+
capture_message_content,
|
191
|
+
)
|
192
|
+
|
193
|
+
return wrapper
|