feat: backwards-compatible create_message overloads for SEP-1577 (#1713)
This commit is contained in:
parent
f82b0c9371
commit
fa851d93a2
1 changed files with 209 additions and 32 deletions
|
|
@ -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)
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue