Implement IssueAgent

This commit is contained in:
wugren
2023-12-04 10:51:45 +08:00
parent fde7389443
commit 1cdf6f73c0
+9 -1
View File
@@ -210,6 +210,14 @@ class IssueStorage:
return issue
class IssueAgent(CustomAIAgent):
async def _process_msg(self, msg: AgentMsg, workspace=None) -> AgentMsg:
pass
def __init__(self, agent_id: str, llm_model_name: str, max_token_size: int) -> None:
super().__init__(agent_id, llm_model_name, max_token_size)
class IssueParserEnvironment(Environment):
def __init__(self, env_id: str, storage: IssueStorage) -> None:
super().__init__(env_id)
@@ -305,7 +313,7 @@ class IssueParser:
Then call the function create_issue or update_issue.
if this mail is not associated with issue, you should ignore this mail.'''}
prompt.append(AgentPrompt(f'''Mail is {mail_str}, issue is {issue_str}. Answer me the function's return value or None if igonred.
prompt.append(IssueAgent(f'''Mail is {mail_str}, issue is {issue_str}. Answer me the function's return value or None if igonred.
'''))
llm_result = await CustomAIAgent("issue parser", "gpt-4-1106-preview", 4000).do_llm_complection(prompt, env=self.llm_env)