Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import asyncio

from agent_framework import Message
from agent_framework.openai import OpenAIChatClient
from dotenv import load_dotenv

Expand All @@ -28,7 +29,7 @@ async def main() -> None:
client = OpenAIChatClient()

try:
task = asyncio.create_task(client.get_response(messages=["Tell me a fantasy story."]))
task = asyncio.create_task(client.get_response(messages=[Message(role="user", text="Tell me a fantasy story.")]))
await asyncio.sleep(1)
task.cancel()
await task
Expand Down