Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concurrent queries #1

Open
simondpalmer opened this issue May 2, 2024 · 0 comments
Open

Concurrent queries #1

simondpalmer opened this issue May 2, 2024 · 0 comments

Comments

@simondpalmer
Copy link

Hi Rohan,

I have you code up and running fine. However, I want to be able to do multiple queries concurrently. I guess multiple Threads using the top_agent. For instance

def query_llama_index(query, agent):
        response = agent.stream_chat(query)

queries = ["riddle me this", riddle me that"]
for query in queries:
  thread = Thread(target=query_llama_index, args=(query, agent))
  thread.start()
  thread.join()

This runs however I receive no output from the StreamingResponse.

Can OpenAIAgent's be used in multiple threads? If so, how do I 'queue' all these callbacks in the one queue and receive them? Or would I have to create a queue for each query?
I am kind of stuck and any help would be really appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant