fixing the imports for the prompts example (#318)

This commit is contained in:
Niraj Fonseka 2025-03-19 09:42:45 -05:00 • committed by GitHub
commit 5a54d82459
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -238,7 +238,8 @@ async def fetch_weather(city: str) -> str:
Prompts are reusable templates that help LLMs interact with your server effectively: Prompts are reusable templates that help LLMs interact with your server effectively:
```python ```python
from mcp.server.fastmcp import FastMCP, types from mcp.server.fastmcp import FastMCP
from mcp.server.fastmcp.prompts import base
mcp = FastMCP("My App") mcp = FastMCP("My App")
@ -249,11 +250,11 @@ def review_code(code: str) -> str:
@mcp.prompt() @mcp.prompt()
def debug_error(error: str) -> list[types.Message]: def debug_error(error: str) -> list[base.Message]:
return [ return [
types.UserMessage("I'm seeing this error:"), base.UserMessage("I'm seeing this error:"),
types.UserMessage(error), base.UserMessage(error),
types.AssistantMessage("I'll help debug that. What have you tried so far?"), base.AssistantMessage("I'll help debug that. What have you tried so far?"),
] ]
``` ```