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

RetrieveUserProxyAgent, use context_max_tokens from retrieve_config if provided #2259

Merged
merged 2 commits into from
Apr 4, 2024

Conversation

r-b-g-b
Copy link
Contributor

@r-b-g-b r-b-g-b commented Apr 2, 2024

Why are these changes needed?

ragproxyagent = RetrieveUserProxyAgent(
    name="ragproxyagent",
    human_input_mode="NEVER",
    max_consecutive_auto_reply=3,
    retrieve_config={
        "task": "qa",
        "docs_path": ["mypath.md"],
        "chunk_token_size": 500,
        "context_max_tokens": 2000,
        "client": docdb,
        "embedding_model": "all-mpnet-base-v2",
        "get_or_create": True,
    },
    code_execution_config=False,  # set to False if you don't want to execute the code
)

RetrieveUserProxyAgent ignores the retrieve_config["context_max_tokens"] and always uses the default of self._max_tokens * 0.8. This is in conflict with the documented use:

- context_max_tokens (Optional, int): the context max token size for the retrieve chat.
    If key not provided, a default size `max_tokens * 0.8` will be used.

Checks

@ekzhu
Copy link
Collaborator

ekzhu commented Apr 3, 2024

Thanks for the PR! Cc @thinkall

@ekzhu ekzhu added the rag retrieve-augmented generative agents label Apr 3, 2024
Copy link
Collaborator

@thinkall thinkall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thank you @r-b-g-b .

@sonichi sonichi added this pull request to the merge queue Apr 4, 2024
Merged via the queue into microsoft:main with commit 513b0b7 Apr 4, 2024
60 of 72 checks passed
whiskyboy pushed a commit to whiskyboy/autogen that referenced this pull request Apr 17, 2024
@thinkall thinkall mentioned this pull request Jun 15, 2024
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rag retrieve-augmented generative agents
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants