Files
autoMate/agent/require_alignment_agent.py
2024-06-03 17:37:56 +08:00

24 lines
687 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from actions.action_util import ActionUtil
from agent.prompt import require_alignment_prompt
from self_utils.llm_util import LLM_Util
# 需求对齐Agent负责与用户对齐需求
class RequireAlignmentAgent:
def __init__(self):
action_descriptions = ""
for action_class in ActionUtil.get_actions():
action = action_class()
action_descriptions += action.package_actions_description() + "\n"
self.messages = [{"content": require_alignment_prompt, "role": "system"}]
def run(self, question):
self.messages.append({"content": question, "role": "user"})
yield from LLM_Util().invoke(self.messages)