mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-24 06:24:18 +02:00
fix: Use Message function and PromptResult type in docs (#1515)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
eb00b9e368
commit
2547243038
1 changed files with 2 additions and 2 deletions
|
|
@ -188,10 +188,10 @@ FastMCP intelligently handles different return types from your prompt function:
|
|||
- **`Any`**: If the return type is not one of the above, the return value is attempted to be converted to a string and used as a `PromptMessage`.
|
||||
|
||||
```python
|
||||
from fastmcp.prompts.prompt import PromptMessage
|
||||
from fastmcp.prompts.prompt import Message, PromptResult
|
||||
|
||||
@mcp.prompt
|
||||
def roleplay_scenario(character: str, situation: str) -> list[PromptMessage]:
|
||||
def roleplay_scenario(character: str, situation: str) -> PromptResult:
|
||||
"""Sets up a roleplaying scenario with initial messages."""
|
||||
return [
|
||||
Message(f"Let's roleplay. You are {character}. The situation is: {situation}"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue