Skip to content

Commit d4c84ac

Browse files
docs: update deprecated .schema() to .model_json_schema() in tool_run… (#31615)
This PR updates the tool runtime example notebook to replace the deprecated `.schema()` method with `.model_json_schema()`, aligning it with Pydantic V2. ### 🔧 Changes: - Replaced: ```python update_favorite_pets.get_input_schema().schema() with update_favorite_pets.get_input_schema().model_json_schema() ``` Fixes #31609
1 parent b9357d4 commit d4c84ac

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/docs/how_to/tool_runtime.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
}
183183
],
184184
"source": [
185-
"update_favorite_pets.get_input_schema().schema()"
185+
"update_favorite_pets.get_input_schema().model_json_schema()"
186186
]
187187
},
188188
{
@@ -223,7 +223,7 @@
223223
}
224224
],
225225
"source": [
226-
"update_favorite_pets.tool_call_schema.schema()"
226+
"update_favorite_pets.tool_call_schema.model_json_schema()"
227227
]
228228
},
229229
{
@@ -500,7 +500,7 @@
500500
" user_to_pets[user_id] = pets\n",
501501
"\n",
502502
"\n",
503-
"update_favorite_pets.get_input_schema().schema()"
503+
"update_favorite_pets.get_input_schema().model_json_schema()"
504504
]
505505
},
506506
{
@@ -534,7 +534,7 @@
534534
}
535535
],
536536
"source": [
537-
"update_favorite_pets.tool_call_schema.schema()"
537+
"update_favorite_pets.tool_call_schema.model_json_schema()"
538538
]
539539
},
540540
{
@@ -583,7 +583,7 @@
583583
" user_to_pets[user_id] = pets\n",
584584
"\n",
585585
"\n",
586-
"UpdateFavoritePets().get_input_schema().schema()"
586+
"UpdateFavoritePets().get_input_schema().model_json_schema()"
587587
]
588588
},
589589
{
@@ -617,7 +617,7 @@
617617
}
618618
],
619619
"source": [
620-
"UpdateFavoritePets().tool_call_schema.schema()"
620+
"UpdateFavoritePets().tool_call_schema.model_json_schema()"
621621
]
622622
},
623623
{
@@ -659,7 +659,7 @@
659659
" user_to_pets[user_id] = pets\n",
660660
"\n",
661661
"\n",
662-
"UpdateFavoritePets2().get_input_schema().schema()"
662+
"UpdateFavoritePets2().get_input_schema().model_json_schema()"
663663
]
664664
},
665665
{
@@ -692,7 +692,7 @@
692692
}
693693
],
694694
"source": [
695-
"UpdateFavoritePets2().tool_call_schema.schema()"
695+
"UpdateFavoritePets2().tool_call_schema.model_json_schema()"
696696
]
697697
}
698698
],

0 commit comments

Comments
 (0)