@@ -988,8 +988,10 @@ def instrument_pydantic_ai(
988988        obj : pydantic_ai .Agent  |  None  =  None ,
989989        / ,
990990        * ,
991-         event_mode : Literal ['attributes' , 'logs' ] =  'attributes' ,
992991        include_binary_content : bool  |  None  =  None ,
992+         include_content : bool  |  None  =  None ,
993+         version : Literal [1 , 2 , 3 ] |  None  =  None ,
994+         event_mode : Literal ['attributes' , 'logs' ] |  None  =  None ,
993995        ** kwargs : Any ,
994996    ) ->  None : ...
995997
@@ -999,8 +1001,10 @@ def instrument_pydantic_ai(
9991001        obj : pydantic_ai .models .Model ,
10001002        / ,
10011003        * ,
1002-         event_mode : Literal ['attributes' , 'logs' ] =  'attributes' ,
10031004        include_binary_content : bool  |  None  =  None ,
1005+         include_content : bool  |  None  =  None ,
1006+         version : Literal [1 , 2 , 3 ] |  None  =  None ,
1007+         event_mode : Literal ['attributes' , 'logs' ] |  None  =  None ,
10041008        ** kwargs : Any ,
10051009    ) ->  pydantic_ai .models .Model : ...
10061010
@@ -1009,8 +1013,10 @@ def instrument_pydantic_ai(
10091013        obj : pydantic_ai .Agent  |  pydantic_ai .models .Model  |  None  =  None ,
10101014        / ,
10111015        * ,
1012-         event_mode : Literal ['attributes' , 'logs' ] |  None  =  None ,
10131016        include_binary_content : bool  |  None  =  None ,
1017+         include_content : bool  |  None  =  None ,
1018+         version : Literal [1 , 2 , 3 ] |  None  =  None ,
1019+         event_mode : Literal ['attributes' , 'logs' ] |  None  =  None ,
10141020        ** kwargs : Any ,
10151021    ) ->  pydantic_ai .models .Model  |  None :
10161022        """Instrument Pydantic AI. 
@@ -1020,10 +1026,24 @@ def instrument_pydantic_ai(
10201026                By default, all agents are instrumented. 
10211027                You can also pass a specific model or agent. 
10221028                If you pass a model, a new instrumented model will be returned. 
1023-             event_mode: See the [Pydantic AI docs](https://ai.pydantic.dev/logfire/#data-format). 
1024-                 The default is whatever the default is in your version of Pydantic AI. 
1025-             include_binary_content: Whether to include base64 encoded binary content (e.g. images) in the events. 
1029+             include_binary_content: Whether to include base64 encoded binary content (e.g. images) in the telemetry. 
10261030                On by default. Requires Pydantic AI 0.2.5 or newer. 
1031+             include_content: Whether to include prompts, completions, and tool call arguments and responses 
1032+                 in the telemetry. On by default. Requires Pydantic AI 0.3.4 or newer. 
1033+             version: Version of the data format. This is unrelated to the Pydantic AI package version. 
1034+                 Requires Pydantic AI 0.7.5 or newer. 
1035+                 Version 1 is based on the legacy event-based OpenTelemetry GenAI spec 
1036+                     and will be removed in a future release. 
1037+                     The parameter `event_mode` is only relevant for version 1. 
1038+                 Version 2 uses the newer OpenTelemetry GenAI spec and stores messages in the following attributes: 
1039+                     - `gen_ai.system_instructions` for instructions passed to the agent. 
1040+                     - `gen_ai.input.messages` and `gen_ai.output.messages` on model request spans. 
1041+                     - `pydantic_ai.all_messages` on agent run spans. 
1042+                 Version 3 changes the names of some attributes and spans but not the shape of the data. 
1043+                 The default version depends on Pydantic AI. 
1044+             event_mode: The mode for emitting events in version 1. 
1045+                 If `'attributes'`, events are attached to the span as attributes. 
1046+                 If `'logs'`, events are emitted as OpenTelemetry log-based events. 
10271047            kwargs: Additional keyword arguments to pass to 
10281048                [`InstrumentationSettings`](https://ai.pydantic.dev/api/models/instrumented/#pydantic_ai.models.instrumented.InstrumentationSettings) 
10291049                for future compatibility. 
@@ -1032,13 +1052,13 @@ def instrument_pydantic_ai(
10321052
10331053        self ._warn_if_not_initialized_for_instrumentation ()
10341054
1035-         if  include_binary_content  is  not   None :
1036-             kwargs ['include_binary_content' ] =  include_binary_content 
1037- 
10381055        return  instrument_pydantic_ai (
10391056            self ,
10401057            obj = obj ,
10411058            event_mode = event_mode ,
1059+             version = version ,
1060+             include_content = include_content ,
1061+             include_binary_content = include_binary_content ,
10421062            ** kwargs ,
10431063        )
10441064
0 commit comments