Skip to content

RetrieveUserProxyAgent - Collection autogen-docs already exists. #41

@AaronWard

Description

@AaronWard

Can someone please explain what this output means? i have a directory called docs in the same folder as the notebook, the doc_ids list of lists is empty, but i have documents in that folder.

In the RetrieveAssistantAgent docstring:
docs_path (Optional, str): the path to the docs directory. It can also be the path to a single file, or the url to a single file. If key not provided, a default path `./docs` will be used.

Looking at the create_vector_db_from_dir() function, which is used by RetrieveAssistantAgent, i can't make out if it's that a certain file type is expected.

from autogen.agentchat.contrib.retrieve_assistant_agent import RetrieveAssistantAgent
from autogen.agentchat.contrib.retrieve_user_proxy_agent import RetrieveUserProxyAgent
import autogen
import chromadb

# Start logging
autogen.ChatCompletion.start_logging()

# Create an instance of RetrieveAssistantAgent
assistant = RetrieveAssistantAgent(
    name="assistant",
    system_message="You are a helpful assistant.",
    llm_config={
        "request_timeout": 600,
        "seed": 42,
        "config_list": config_list,
    },
)

# Create an instance of RetrieveUserProxyAgent
ragproxyagent = RetrieveUserProxyAgent(
    name="ragproxyagent",
    human_input_mode="NEVER",
    max_consecutive_auto_reply=10,
    retrieve_config={
        "task": "code",
        "docs_path": "./docs/",  # Assuming documentation is stored in a 'docs' directory
        "chunk_token_size": 2000,
        "model": config_list[0]["model"],
        "client": chromadb.PersistentClient(path="/tmp/chromadb"),
        "embedding_model": "all-mpnet-base-v2",
    },
)

# Simulate a user asking a question and initiate chat
user_question = "Can you provide a sample Python code for printing 'Hello, World!'?"
ragproxyagent.initiate_chat(assistant, problem=user_question)
Collection autogen-docs already exists.
doc_ids:  [[]]
No more context, will terminate.
ragproxyagent (to assistant):

TERMINATE

Any help would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions