File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -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
Original file line number Diff line number Diff line change @@ -78,6 +78,21 @@ def get_model(a: Agent):
7878 m2 = get_model (agent2 )
7979 assert m2 is model
8080
81+ # Test all known parameters
82+ logfire_inst .instrument_pydantic_ai (
83+ include_binary_content = False ,
84+ include_content = False ,
85+ version = 1 ,
86+ event_mode = 'logs' ,
87+ )
88+ m = get_model (agent2 )
89+ assert isinstance (m , InstrumentedModel )
90+ assert m .instrumentation_settings .version == 1
91+ assert not m .instrumentation_settings .include_binary_content
92+ assert not m .instrumentation_settings .include_content
93+ assert m .instrumentation_settings .event_mode == 'logs'
94+ Agent .instrument_all (False )
95+
8196
8297def test_invalid_instrument_pydantic_ai ():
8398 with pytest .raises (TypeError ):
You can’t perform that action at this time.
0 commit comments