feat: backwards-compatible create_message overloads for SEP-1577 (#1713)

This commit is contained in:
Felix Weinberger 2025-12-02 13:17:45 +00:00 • committed by GitHub
commit fa851d93a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -948,8 +948,9 @@ async def generate_poem(topic: str, ctx: Context[ServerSession, None]) -> str:
max_tokens=100,
)
if all(c.type == "text" for c in result.content_as_list):
return "\n".join(c.text for c in result.content_as_list if c.type == "text")
# Since we're not passing tools param, result.content is single content
if result.content.type == "text":
return result.content.text
return str(result.content)
```