File size: 485 Bytes
84bd7df
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import asyncio
from praisonai import PraisonAI
from typing import List, AsyncIterable, Annotated, Optional

async def process_agents(query: str) -> AsyncIterable[str]:

    # Create PraisonAI instance and task
    praisonai = PraisonAI(auto=query)
    print(praisonai.framework)
    
    # Run the task and await the result
    task = praisonai.main()

    
    # print(task)
    # Assuming `result` is an iterable of strings
    for item in task:
        yield item

    # await task