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

Add option to reduce context window #5193

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Nov 22, 2024

  1. Add option to reduce context window

    - Add max_input_tokens parameter to AgentController to allow setting a lower context window
    - Add token count checking and truncation when adding new events
    - Improve handling of first user message preservation
    - Add test case for context window parameter truncation
    openhands-agent committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    c329a2e View commit details
    Browse the repository at this point in the history
  2. Use configuration system for max_input_tokens

    - Remove max_input_tokens parameter from AgentController constructor
    - Use LLM configuration system to set max_input_tokens through config.toml or environment variables
    - Update test to set max_input_tokens directly in LLM config
    
    Users can now set max_input_tokens in two ways:
    1. Through config.toml:
       [llm]
       max_input_tokens = 20000
    
    2. Through environment variables:
       export LLM_MAX_INPUT_TOKENS=20000
    openhands-agent committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    2d094fe View commit details
    Browse the repository at this point in the history