fixing the imports for the prompts example (#318)
This commit is contained in:
parent
805fb469f5
commit
5a54d82459
1 changed files with 6 additions and 5 deletions
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:
|
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?"),
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue