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

Insufficient support managing multiple threads when several users interact with the same agency simultaneously. #163

Closed
orenneiberg opened this issue Aug 5, 2024 · 3 comments
Labels

Comments

@orenneiberg
Copy link

I have encountered a limitation in the Agncy class, specifically within the get_completion method. This method interacts with the Assistant API but does not currently support managing multiple threads effectively when several users interact with the same agency simultaneously.

The core of the issue lies in the inability to manage conversation threads and shared states uniquely for each user. This leads to potential conflicts or incorrect handling of state when multiple users interact with the agency concurrently.

Proposed Change:
I propose adding an enhancement to the get_completion method allowing it to accept a thread_id argument. This would enable:

Thread-specific interaction history management:
By passing a unique thread_id per user session, the library can maintain separate interaction histories, ensuring that responses and states are correctly handled on a per-user basis.

State management enhancement:
Alongside the thread management, modifying the shared state handling to be thread-specific would prevent users from affecting each other’s state during concurrent interactions.

Example:
Here's a simple example of how the enhanced method could be called:
response = agency.get_completion(prompt="Hello, how can I assist you today?", thread_id=user_session_id)

@SwapnaliDhotre12
Copy link

Great suggesstion! I faced the same issue and was thinking of using async thread instead of thread in agency class

Copy link
Contributor

This issue is stale because it has been open for 30 days with no activity. Please upgrade to the latest version and test it again.

@github-actions github-actions bot added the stale label Sep 21, 2024
Copy link
Contributor

github-actions bot commented Oct 5, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale. If the issue still persists, please reopen.

@github-actions github-actions bot closed this as completed Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants