Skip to content

Commit

Permalink
feat(Agent): use llm client api
Browse files Browse the repository at this point in the history
use llm client api
  • Loading branch information
yhjun1026 committed Dec 26, 2023
1 parent e1e43c6 commit 821b212
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dbgpt/agent/agents/expand/code_assistant_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from ...memory.gpts_memory import GptsMemory
from ..agent import Agent
from ..base_agent import ConversableAgent
from dbgpt.core.interface.message import ModelMessageRoleType

try:
from termcolor import colored
Expand Down Expand Up @@ -170,7 +171,7 @@ async def a_verify(self, message: Optional[Dict]):
check_reult, model = await self.a_reasoning_reply(
[
{
"role": "user",
"role": ModelMessageRoleType.HUMAN,
"content": f"""Please understand the following task objectives and results and give your judgment:
Task Gogal: {task_gogal}
Execution Result: {task_result}
Expand Down
2 changes: 1 addition & 1 deletion dbgpt/agent/agents/llm/llm_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ async def _completions_create(self, llm_model, params):
try:
model_request = _build_model_request(payload)
model_output = await self._llm_client.generate(model_request)
parsed_output = self._output_parser.parse_model_nostream_resp(model_output, "###")
parsed_output = self._output_parser.parse_model_nostream_resp(model_output, "###")
return parsed_output
except Exception as e:
logger.error(
Expand Down
3 changes: 2 additions & 1 deletion dbgpt/agent/agents/plan_group_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from ..memory.gpts_memory import GptsMemory, GptsMessage, GptsPlan
from .agent import Agent, AgentContext
from .base_agent import ConversableAgent
from dbgpt.core.interface.message import ModelMessageRoleType

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -135,7 +136,7 @@ async def a_select_speaker(
self.messages
+ [
{
"role": "user",
"role": ModelMessageRoleType.HUMAN,
"content": f"""Read and understand the following task content and assign the appropriate role to complete the task.
Task content: {now_plan_context}
select the role from: {[agent.name for agent in agents]},
Expand Down

0 comments on commit 821b212

Please sign in to comment.