Expected Behaviour
minimize or eliminate thread creation if the entire stack is async
Current Behaviour
https://github.com/awslabs/multi-agent-orchestrator/blob/da9563fe9e87343fcda8abe6303b1e1d4f36c943/examples/fast-api-streaming/main.py#L119
Above line will spawn a new thread for every request.
Code snippet
https://github.com/awslabs/multi-agent-orchestrator/blob/da9563fe9e87343fcda8abe6303b1e1d4f36c943/examples/fast-api-streaming/main.py#L119
Possible Solution
What would be an issue if you do the following -
asyncio.create_task(start_generation(query, user_id, session_id, streamer_queue))
instead of spawning a new thread
Steps to Reproduce
See - https://github.com/awslabs/multi-agent-orchestrator/blob/da9563fe9e87343fcda8abe6303b1e1d4f36c943/examples/fast-api-streaming/main.py#L119