Improve defualt agent Jarvis, fix some bug.

This commit is contained in:
Liu Zhicong
2023-09-19 21:36:56 -07:00
parent 42fe1ad4f4
commit e6d7b2b009
8 changed files with 117 additions and 30 deletions
+3 -10
View File
@@ -8,7 +8,7 @@ from typing import Optional,Tuple,List
from abc import ABC, abstractmethod
from .environment import Environment,EnvironmentEvent
from .agent_message import AgentMsg,AgentMsgStatus
from .agent_message import AgentMsg,AgentMsgStatus,FunctionItem,LLMResult
from .agent import AgentPrompt,AgentMsg
from .chatsession import AIChatSession
from .role import AIRole,AIRoleGroup
@@ -38,14 +38,7 @@ class MessageFilter:
return True
class LLMResult:
def __init__(self) -> None:
self.state : str = "ignore"
self.resp : str = ""
self.post_msgs : List[AgentMsg] = []
self.send_msgs : List[AgentMsg] = []
self.calls : List[FunctionItem] = []
self.post_calls : List[FunctionItem] = []
class Workflow:
@@ -306,7 +299,7 @@ class Workflow:
if current_func:
if check_args(current_func) is False:
r.resp += current_func.dumps()
if len(r.send_msgs) > 0 or len(r.calls) > 0:
r.state = "waiting"
else: