Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ReAct Implementation #1515

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
2 changes: 2 additions & 0 deletions camel/agents/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from .critic_agent import CriticAgent
from .embodied_agent import EmbodiedAgent
from .knowledge_graph_agent import KnowledgeGraphAgent
from .react_agent import ReActAgent
from .role_assignment_agent import RoleAssignmentAgent
from .search_agent import SearchAgent
from .task_agent import (
Expand All @@ -41,4 +42,5 @@
'RoleAssignmentAgent',
'SearchAgent',
'KnowledgeGraphAgent',
'ReActAgent',
]
12 changes: 1 addition & 11 deletions camel/agents/chat_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
get_model_encoding,
get_pydantic_object_schema,
json_to_function_code,
track_agent,
)

if TYPE_CHECKING:
Expand All @@ -74,17 +75,6 @@

logger = logging.getLogger(__name__)

# AgentOps decorator setting
try:
import os

if os.getenv("AGENTOPS_API_KEY") is not None:
from agentops import track_agent
else:
raise ImportError
except (ImportError, AttributeError):
from camel.utils import track_agent


class ToolCallingRecord(BaseModel):
r"""Historical records of tools called in the conversation.
Expand Down
12 changes: 1 addition & 11 deletions camel/agents/deductive_reasoner_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,10 @@
from camel.models import BaseModelBackend
from camel.prompts import TextPrompt
from camel.types import RoleType
from camel.utils import track_agent

logger = get_logger(__name__)

# AgentOps decorator setting
try:
import os

if os.getenv("AGENTOPS_API_KEY") is not None:
from agentops import track_agent
else:
raise ImportError
except (ImportError, AttributeError):
from camel.utils import track_agent


@track_agent(name="DeductiveReasonerAgent")
class DeductiveReasonerAgent(ChatAgent):
Expand Down
13 changes: 1 addition & 12 deletions camel/agents/embodied_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,7 @@
from camel.messages import BaseMessage
from camel.models import BaseModelBackend
from camel.responses import ChatAgentResponse
from camel.utils import print_text_animated

# AgentOps decorator setting
try:
import os

if os.getenv("AGENTOPS_API_KEY") is not None:
from agentops import track_agent
else:
raise ImportError
except (ImportError, AttributeError):
from camel.utils import track_agent
from camel.utils import print_text_animated, track_agent


@track_agent(name="EmbodiedAgent")
Expand Down
13 changes: 1 addition & 12 deletions camel/agents/knowledge_graph_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,7 @@
Relationship,
)
from camel.types import RoleType

# AgentOps decorator setting
try:
import os

if os.getenv("AGENTOPS_API_KEY") is not None:
from agentops import track_agent
else:
raise ImportError
except (ImportError, AttributeError):
from camel.utils import track_agent

from camel.utils import track_agent

text_prompt = """
You are tasked with extracting nodes and relationships from given content and
Expand Down
Loading
Loading