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

[Bug]: ValueError with RetrieveUserProxyAgent's default client #51

Closed
lazToum opened this issue Nov 20, 2024 · 0 comments · Fixed by #118
Closed

[Bug]: ValueError with RetrieveUserProxyAgent's default client #51

lazToum opened this issue Nov 20, 2024 · 0 comments · Fixed by #118
Labels
bug Something isn't working

Comments

@lazToum
Copy link
Collaborator

lazToum commented Nov 20, 2024

Describe the bug

In RetrieveUserProxyAgent, when using a VectorDB instance for the vector_db argument, the client should be the one that the VectorDB instance uses.
https://github.com/ag2ai/ag2/blob/main/autogen/agentchat/contrib/retrieve_user_proxy_agent.py#L264

Steps to reproduce

  • Create a new chromadb client:
    import chromadb
    from chromadb.config import Settings
    client = chromadb.PersistentClient(path="/path/to/documents", settings=Settings(anonymized_telemetry=False)
    
  • Try to use this client in a RetrieveUserProxyAgent:
    from autogen.agentchat.contrib.retrieve_user_proxy_agent import RetrieveUserProxyAgent
    from autogen.agentchat.contrib.vectordb.chromadb import ChromaVectorDB
    from chromadb.utils.embedding_functions import SentenceTransformerEmbeddingFunction
    agent = RetrieveUserProxyAgent(
        ...,
        retrieve_config={
            ...,
            "vector_db": ChromaVectorDB(
                client=client,
                embedding_function=SentenceTransformerEmbeddingFunction(model_name="all-MiniLM-L6-v2")
            ),
           ...
     )
    
  • Trying to use this agent gives:
    ValueError: An instance of Chroma already exists for ephemeral with different settings:
    ...site-packages/autogen/agentchat/contrib/retrieve_user_proxy_agent.py#line=265), in RetrieveUserProxyAgent.__init__(self, name, human_input_mode, is_termination_msg, retrieve_config, **kwargs)
        264 self._client = self._retrieve_config.get("client", None)
        265 if self._client is None:
    --> 266     self._client = chromadb.Client()
    ....
    

Model Used

No response

Expected Behavior

Not to throw an error and use the provided client.

Screenshots and logs

No response

Additional Information

Maybe related: microsoft/autogen#2829

@lazToum lazToum added the bug Something isn't working label Nov 20, 2024
@lazToum lazToum changed the title [Bug]: RetrieveUserProxyAgent default client [Bug]: ValueError with RetrieveUserProxyAgent's default client Nov 20, 2024
github-merge-queue bot pushed a commit that referenced this issue Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant