FE config (#960)

* Send FE its own version of config

* Don't read some settings back

* Update opendevin/config.py

Co-authored-by: Robert Brennan <accounts@rbren.io>

---------

Co-authored-by: Robert Brennan <accounts@rbren.io>
This commit is contained in:
Engel Nyst 2024-04-10 15:08:09 +02:00 committed by GitHub
parent e8ff184912
commit 52b63908ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 8 deletions

View File

@ -75,8 +75,10 @@ def get(key: str):
return config.get(key)
def get_all() -> dict:
def get_fe_config() -> dict:
"""
Get all the configuration values by performing a deep copy.
"""
return copy.deepcopy(config)
fe_config = copy.deepcopy(config)
del fe_config['LLM_API_KEY']
return fe_config

View File

@ -88,6 +88,7 @@ class AgentManager:
Returns:
The value of the key or the default value.
"""
return _args.get(key, config.get(key))
async def create_controller(self, start_event: dict):
@ -104,11 +105,9 @@ class AgentManager:
directory = self.get_arg_or_default(args, ConfigType.WORKSPACE_DIR)
agent_cls = self.get_arg_or_default(args, ConfigType.AGENT)
model = self.get_arg_or_default(args, ConfigType.LLM_MODEL)
api_key = self.get_arg_or_default(args, ConfigType.LLM_API_KEY)
api_base = self.get_arg_or_default(args, ConfigType.LLM_BASE_URL)
container_image = self.get_arg_or_default(
args, ConfigType.SANDBOX_CONTAINER_IMAGE
)
api_key = config.get(ConfigType.LLM_API_KEY)
api_base = config.get(ConfigType.LLM_BASE_URL)
container_image = config.get(ConfigType.SANDBOX_CONTAINER_IMAGE)
max_iterations = self.get_arg_or_default(
args, ConfigType.MAX_ITERATIONS)

View File

@ -112,7 +112,7 @@ async def del_messages(
@app.get('/configurations')
def read_default_model():
return config.get_all()
return config.get_fe_config()
@app.get('/refresh-files')