mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
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:
parent
e8ff184912
commit
52b63908ca
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
@ -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')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user