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

Issue 1418 resolved #1424

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
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
14 changes: 12 additions & 2 deletions superagi/jobs/agent_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,19 @@ def execute_next_step(self, agent_execution_id):
agent_workflow_step = session.query(AgentWorkflowStep).filter(
AgentWorkflowStep.id == agent_execution.current_agent_step_id).first()
try:
# Ensure messages are appended in the correct order
messages = [{"role": "system", "content": "test1"}]
messages.append({"role": "system", "content": "test2"})
messages.append({"role": "system", "content": prompt})
messages.append({"role": "system", "content": f"The current time and date is {time.strftime('%c')}"})
messages.append({"role": "system", "content": "test3"})

# Add logging to print the structure of the message array
logger.debug(f"Prompt messages: {messages}")

# Execute the workflow step
self.__execute_workflow_step(agent, agent_config, agent_execution_id, agent_workflow_step, memory,
model_api_key, organisation, session)

except Exception as e:
logger.info("Exception in executing the step: {}".format(e))
superagi.worker.execute_agent.apply_async((agent_execution_id, datetime.now()), countdown=15)
Expand Down Expand Up @@ -183,4 +193,4 @@ def execute_waiting_workflows(self):
AgentWaitStepHandler(session=session, agent_id=agent_execution.agent_id,
agent_execution_id=agent_execution.id).handle_next_step()
execute_agent.delay(agent_execution.id, datetime.now())
session.close()
session.close()