feat(llm): convert function call request for non-funcall OSS model (#4711)

Co-authored-by: Calvin Smith <email@cjsmith.io>
This commit is contained in:
Xingyao Wang
2024-11-14 10:40:09 -06:00
committed by GitHub
parent 52a428d74a
commit 07f0d1ccb3
40 changed files with 1752 additions and 1164 deletions

View File

@@ -12,6 +12,7 @@ from openhands.controller.state.state import State, TrafficControlState
from openhands.controller.stuck import StuckDetector
from openhands.core.config import AgentConfig, LLMConfig
from openhands.core.exceptions import (
FunctionCallValidationError,
LLMMalformedActionError,
LLMNoActionError,
LLMResponseError,
@@ -478,7 +479,12 @@ class AgentController:
action = self.agent.step(self.state)
if action is None:
raise LLMNoActionError('No action was returned')
except (LLMMalformedActionError, LLMNoActionError, LLMResponseError) as e:
except (
LLMMalformedActionError,
LLMNoActionError,
LLMResponseError,
FunctionCallValidationError,
) as e:
self.event_stream.add_event(
ErrorObservation(
content=str(e),