Content-Length: 282765 | pFad | http://github.com/Michaelzag/python-sdk/commit/5a54d824591ae73a5785c4fbce627d103c5c7df8

6E fixing the imports for the prompts example (#318) · Michaelzag/python-sdk@5a54d82 · GitHub
Skip to content

Commit 5a54d82

Browse files
fixing the imports for the prompts example (modelcontextprotocol#318)
1 parent 805fb46 commit 5a54d82

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ async def fetch_weather(city: str) -> str:
238238
Prompts are reusable templates that help LLMs interact with your server effectively:
239239

240240
```python
241-
from mcp.server.fastmcp import FastMCP, types
241+
from mcp.server.fastmcp import FastMCP
242+
from mcp.server.fastmcp.prompts import base
242243

243244
mcp = FastMCP("My App")
244245

@@ -249,11 +250,11 @@ def review_code(code: str) -> str:
249250

250251

251252
@mcp.prompt()
252-
def debug_error(error: str) -> list[types.Message]:
253+
def debug_error(error: str) -> list[base.Message]:
253254
return [
254-
types.UserMessage("I'm seeing this error:"),
255-
types.UserMessage(error),
256-
types.AssistantMessage("I'll help debug that. What have you tried so far?"),
255+
base.UserMessage("I'm seeing this error:"),
256+
base.UserMessage(error),
257+
base.AssistantMessage("I'll help debug that. What have you tried so far?"),
257258
]
258259
```
259260

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/Michaelzag/python-sdk/commit/5a54d824591ae73a5785c4fbce627d103c5c7df8

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy