mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
fix initialize (#1214)
This commit is contained in:
parent
2826e39056
commit
9e85550b46
@ -91,13 +91,6 @@ class AgentUnit:
|
||||
|
||||
match action:
|
||||
case ActionType.INIT:
|
||||
# FIXME: the parameters need be compared, to confirm whether reinit is needed
|
||||
if self.controller is not None:
|
||||
# Agent already started, no need to create a new one
|
||||
if data.get('args', {}).get('reconnect', 'false') != 'true':
|
||||
await self.controller.reset_task()
|
||||
await self.init_done()
|
||||
return
|
||||
await self.create_controller(data)
|
||||
case ActionType.START:
|
||||
await self.start_task(data)
|
||||
@ -149,6 +142,7 @@ class AgentUnit:
|
||||
max_iterations = self.get_arg_or_default(args, ConfigType.MAX_ITERATIONS)
|
||||
max_chars = self.get_arg_or_default(args, ConfigType.MAX_CHARS)
|
||||
|
||||
logger.info(f'Creating agent {agent_cls} using LLM {model}')
|
||||
llm = LLM(model=model, api_key=api_key, base_url=api_base)
|
||||
try:
|
||||
self.controller = AgentController(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user