Awesome, impressed with the speed at which you shipped that through 🚀
j
Jeremiah
10/25/2024, 1:27 AM
🙌
c
Constantin Teo
10/25/2024, 1:35 AM
It's weird how this was not a thing - coming from openai completions you would normally do something like:
Copy code
async for chunk in await openai.chat.completions.create(**kwargs):
...
Which, with controlflow, would look like this:
Copy code
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
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.