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
This commit is contained in:
Shivnath Tathe 2025-06-17 03:37:18 +05:30 committed by GitHub
parent b9357d456e
commit d4c84acc39
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -182,7 +182,7 @@
}
],
"source": [
"update_favorite_pets.get_input_schema().schema()"
"update_favorite_pets.get_input_schema().model_json_schema()"
]
},
{
@ -223,7 +223,7 @@
}
],
"source": [
"update_favorite_pets.tool_call_schema.schema()"
"update_favorite_pets.tool_call_schema.model_json_schema()"
]
},
{
@ -500,7 +500,7 @@
" user_to_pets[user_id] = pets\n",
"\n",
"\n",
"update_favorite_pets.get_input_schema().schema()"
"update_favorite_pets.get_input_schema().model_json_schema()"
]
},
{
@ -534,7 +534,7 @@
}
],
"source": [
"update_favorite_pets.tool_call_schema.schema()"
"update_favorite_pets.tool_call_schema.model_json_schema()"
]
},
{
@ -583,7 +583,7 @@
" user_to_pets[user_id] = pets\n",
"\n",
"\n",
"UpdateFavoritePets().get_input_schema().schema()"
"UpdateFavoritePets().get_input_schema().model_json_schema()"
]
},
{
@ -617,7 +617,7 @@
}
],
"source": [
"UpdateFavoritePets().tool_call_schema.schema()"
"UpdateFavoritePets().tool_call_schema.model_json_schema()"
]
},
{
@ -659,7 +659,7 @@
" user_to_pets[user_id] = pets\n",
"\n",
"\n",
"UpdateFavoritePets2().get_input_schema().schema()"
"UpdateFavoritePets2().get_input_schema().model_json_schema()"
]
},
{
@ -692,7 +692,7 @@
}
],
"source": [
"UpdateFavoritePets2().tool_call_schema.schema()"
"UpdateFavoritePets2().tool_call_schema.model_json_schema()"
]
}
],