From 865b0bb379a8cd1509e16976d04b5bde539e571c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=AE=AE=E0=AE=A9=E0=AF=8B=E0=AE=9C=E0=AF=8D=E0=AE=95?= =?UTF-8?q?=E0=AF=81=E0=AE=AE=E0=AE=BE=E0=AE=B0=E0=AF=8D=20=E0=AE=AA?= =?UTF-8?q?=E0=AE=B4=E0=AE=A9=E0=AE=BF=E0=AE=9A=E0=AF=8D=E0=AE=9A=E0=AE=BE?= =?UTF-8?q?=E0=AE=AE=E0=AE=BF?= Date: Thu, 6 Feb 2025 14:31:16 +0530 Subject: [PATCH] disable mock_function_calling for now --- openhands/llm/llm.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/openhands/llm/llm.py b/openhands/llm/llm.py index 879b0950f486..8f32f7b47261 100644 --- a/openhands/llm/llm.py +++ b/openhands/llm/llm.py @@ -419,23 +419,23 @@ def wrapper(*args, **kwargs): logger.debug(f'Calling LLM ...') self.log_first_request(*args, **kwargs) resp = self._completion_unwrapped(*args, **kwargs) - # non_fncall_response = copy.deepcopy(resp) - if mock_function_calling: - # assert len(resp.choices) == 1 - assert mock_fncall_tools is not None - non_fncall_response_message = resp.choices[0].message # type: ignore - fn_call_messages_with_response = ( - convert_non_fncall_messages_to_fncall_messages( - messages + [non_fncall_response_message], - mock_fncall_tools, - ) - ) # type: ignore - fn_call_response_message = fn_call_messages_with_response[-1] - if not isinstance(fn_call_response_message, LiteLLMMessage): - fn_call_response_message = LiteLLMMessage( - **fn_call_response_message - ) - resp.choices[0].message = fn_call_response_message # type: ignore + # # non_fncall_response = copy.deepcopy(resp) + # if mock_function_calling: + # # assert len(resp.choices) == 1 + # assert mock_fncall_tools is not None + # non_fncall_response_message = resp.choices[0].message # type: ignore + # fn_call_messages_with_response = ( + # convert_non_fncall_messages_to_fncall_messages( + # messages + [non_fncall_response_message], + # mock_fncall_tools, + # ) + # ) # type: ignore + # fn_call_response_message = fn_call_messages_with_response[-1] + # if not isinstance(fn_call_response_message, LiteLLMMessage): + # fn_call_response_message = LiteLLMMessage( + # **fn_call_response_message + # ) + # resp.choices[0].message = fn_call_response_message # type: ignore message_back = resp['choices'][0]['message']['content'] or '' self_analyse = int(os.environ.get('SELF_ANALYSE', '0')) if self_analyse: