FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-sdk/docs_src/structured_output/tutorial003.py at main · uuzzrm/python-sdk · GitHub
uuzzrm
python-sdk
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-sdk
/
docs_src
/
structured_output
/
tutorial003.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
17 lines (11 loc) · 360 Bytes
Breadcrumbs
python-sdk
/
docs_src
/
structured_output
/
tutorial003.py
Copy path
File metadata and controls
17 lines (11 loc) · 360 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from
typing
import
TypedDict
from
mcp
.
server
import
MCPServer
mcp
=
MCPServer
(
"Weather"
)
class
WeatherData
(
TypedDict
):
temperature
:
float
humidity
:
float
conditions
:
str
@
mcp
.
tool
()
def
get_weather
(
city
:
str
)
->
WeatherData
:
"""Current weather for a city."""
return
WeatherData
(
temperature
=
16.2
,
humidity
=
0.83
,
conditions
=
"Overcast"
)
Back
|
FazBrowse Home
|
New Git URL