chore(log): better json parse (#5581)

This commit is contained in:
Cheng Yang 2024-12-31 00:04:21 +08:00 committed by GitHub
parent 2869d646b6
commit c7a8dcf079
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -101,7 +101,7 @@ class CodeActAgent(Agent):
codeact_enable_llm_editor=self.config.codeact_enable_llm_editor,
)
logger.debug(
f'TOOLS loaded for CodeActAgent: {json.dumps(self.tools, indent=2)}'
f'TOOLS loaded for CodeActAgent: {json.dumps(self.tools, indent=2, ensure_ascii=False).replace("\\n", "\n")}'
)
self.prompt_manager = PromptManager(
microagent_dir=os.path.join(os.path.dirname(__file__), 'micro')

View File

@ -359,7 +359,9 @@ class LLM(RetryMixin, DebugMixin):
# noinspection PyBroadException
except Exception:
pass
logger.debug(f'Model info: {self.model_info}')
from openhands.core.utils import json
logger.debug(f'Model info: {json.dumps(self.model_info, indent=2)}')
if self.config.model.startswith('huggingface'):
# HF doesn't support the OpenAI default value for top_p (1)