marigen_api / get_agents.py
jameszokah's picture
Synced repo using 'sync_with_huggingface' Github Action
84bd7df verified
raw
history blame contribute delete
485 Bytes
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