We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 986a1be commit 8afac4bCopy full SHA for 8afac4b
1 file changed
examples/poet_chat/main.py
@@ -42,6 +42,11 @@ async def _openai_recv():
42
elif event.data.type == "turn_ended":
43
print(f"Agent said:\n{msg}\n")
44
msg = ""
45
+ elif event.data.type == "error":
46
+ print(event.data.error)
47
+ raise RuntimeError("Unexpected error from OpenAI API!")
48
+ elif event.data.type == "exception":
49
+ raise event.data.exception
50
51
async def _fishjam_recv():
52
async for event in fishjam_session.receive():
0 commit comments