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

Update agent #31

Merged
merged 2 commits into from
Mar 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion polymind/core/agent.py
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ async def __call__(self, agent: "Agent", input: Message) -> Message:
Returns:
Message: The output message from the thought process.
"""
return await self._execute(input)
return await self._execute(agent=agent, input=input)

@abstractmethod
async def _execute(self, agent: "Agent", input: Message) -> Message:
4 changes: 2 additions & 2 deletions tests/polymind/core/test_agent.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@


class MockThoughtProcess(ThoughtProcess):
async def _execute(self, input: Message) -> Message:
async def _execute(self, agent: Agent, input: Message) -> Message:
# Implement a simple test logic, for example, just echo back the input with some modification
modified_content = {"processed": True, **input.content}
return Message(content=modified_content)
@@ -30,7 +30,7 @@ async def test_process_simple_message(self):
input_message = Message(content={"hello": "world"})

# Now, pass both the input_message and agent to the thought_process call
output_message = await thought_process(input_message, agent)
output_message = await thought_process(agent=agent, input=input_message)

# Assertions to verify the behavior
assert output_message.content.get("processed") == True