From a1ef7c2da76a997138b9cdb1f7d01b76f2469349 Mon Sep 17 00:00:00 2001 From: csunny Date: Wed, 17 Jan 2024 11:39:27 +0800 Subject: [PATCH] fix: agent chat use zhipu --- dbgpt/agent/agents/llm/llm_client.py | 2 +- dbgpt/serve/agent/agents/controller.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dbgpt/agent/agents/llm/llm_client.py b/dbgpt/agent/agents/llm/llm_client.py index e67575021..fc67e0639 100644 --- a/dbgpt/agent/agents/llm/llm_client.py +++ b/dbgpt/agent/agents/llm/llm_client.py @@ -180,7 +180,7 @@ async def _completions_create(self, llm_model, params): payload["model_cache_enable"] = self.model_cache_enable try: model_request = _build_model_request(payload) - model_output = await self._llm_client.generate(model_request) + model_output = await self._llm_client.generate(model_request.copy()) parsed_output = self._output_parser.parse_model_nostream_resp( model_output, "###" ) diff --git a/dbgpt/serve/agent/agents/controller.py b/dbgpt/serve/agent/agents/controller.py index d5ca93fb3..5d7ef91b4 100644 --- a/dbgpt/serve/agent/agents/controller.py +++ b/dbgpt/serve/agent/agents/controller.py @@ -110,7 +110,7 @@ async def _build_agent_context( worker_manager = CFG.SYSTEM_APP.get_component( ComponentType.WORKER_MANAGER_FACTORY, WorkerManagerFactory ).create() - llm_task = DefaultLLMClient(worker_manager) + llm_task = DefaultLLMClient(worker_manager, auto_convert_message=True) context: AgentContext = AgentContext(conv_id=conv_id, llm_provider=llm_task) context.gpts_name = gpts_instance.gpts_name context.resource_db = resource_db