mirror of
https://github.com/aljazceru/mcp-python-sdk.git
synced 2025-12-24 01:04:20 +01:00
fixing the imports for the prompts example (#318)
This commit is contained in:
11
README.md
11
README.md
@@ -238,7 +238,8 @@ async def fetch_weather(city: str) -> str:
|
||||
Prompts are reusable templates that help LLMs interact with your server effectively:
|
||||
|
||||
```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")
|
||||
|
||||
@@ -249,11 +250,11 @@ def review_code(code: str) -> str:
|
||||
|
||||
|
||||
@mcp.prompt()
|
||||
def debug_error(error: str) -> list[types.Message]:
|
||||
def debug_error(error: str) -> list[base.Message]:
|
||||
return [
|
||||
types.UserMessage("I'm seeing this error:"),
|
||||
types.UserMessage(error),
|
||||
types.AssistantMessage("I'll help debug that. What have you tried so far?"),
|
||||
base.UserMessage("I'm seeing this error:"),
|
||||
base.UserMessage(error),
|
||||
base.AssistantMessage("I'll help debug that. What have you tried so far?"),
|
||||
]
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user