Constantin Teo
10/24/2024, 6:07 AMon_agent_message_delta
writes the stream's chunks to display using an async display()
?Jeremiah
Jeremiah
Constantin Teo
10/25/2024, 12:57 AMJeremiah
Constantin Teo
10/25/2024, 1:35 AMasync for chunk in await openai.chat.completions.create(**kwargs):
...
Which, with controlflow, would look like this:
async for delta in agent._run_model_async(
stream=True,
messages=messages[::-1],
tools=[],
):
if isinstance(delta, AgentMessageDelta):
await on_agent_message_delta(delta
But this essentially locks us up from using actual flows, as all we're doing is "Call the LLM"
So, to use of flows, the async handler is essential
...Unless I'm wrong