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

Fix for schedule agent #1184

Merged
merged 1 commit into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions superagi/controllers/agent_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def create_agent_execution(agent_execution: AgentExecutionIn,
'agent_execution_name':db_agent_execution.name},
agent_execution.agent_id,
organisation.id if organisation else 0)
if agent_execution and agent_execution_knowledge.value != 'None':
if agent_execution_knowledge and agent_execution_knowledge.value != 'None':
knowledge_name = Knowledges.get_knowledge_from_id(db.session, int(agent_execution_knowledge.value)).name
if knowledge_name is not None:
EventHandler(session=db.session).create_event('knowledge_picked',
Expand Down Expand Up @@ -215,7 +215,7 @@ def create_agent_run(agent_execution: AgentRunIn, Authorize: AuthJWT = Depends(c
agent_execution.agent_id,
organisation.id if organisation else 0)
agent_execution_knowledge = AgentConfiguration.get_agent_config_by_key_and_agent_id(session= db.session, key= 'knowledge', agent_id= agent_execution.agent_id)
if agent_execution and agent_execution_knowledge.value != 'None':
if agent_execution_knowledge and agent_execution_knowledge.value != 'None':
knowledge_name = Knowledges.get_knowledge_from_id(db.session, int(agent_execution_knowledge.value)).name
if knowledge_name is not None:
EventHandler(session=db.session).create_event('knowledge_picked',
Expand Down
2 changes: 1 addition & 1 deletion superagi/controllers/api/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def create_run(agent_id:int,agent_execution: AgentExecutionIn,api_key: str = Sec
organisation.id if organisation else 0)

agent_execution_knowledge = AgentConfiguration.get_agent_config_by_key_and_agent_id(session= db.session, key= 'knowledge', agent_id= agent_id)
if agent_execution_knowledge:
if agent_execution_knowledge and agent_execution_knowledge.value != 'None':
knowledge_name = Knowledges.get_knowledge_from_id(db.session, int(agent_execution_knowledge.value)).name
if knowledge_name is not None:
EventHandler(session=db.session).create_event('knowledge_picked',
Expand Down
2 changes: 1 addition & 1 deletion superagi/jobs/scheduling_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def execute_scheduled_agent(self, agent_id: int, name: str):
agent_id,
organisation.id if organisation else 0)
agent_execution_knowledge = AgentConfiguration.get_agent_config_by_key_and_agent_id(session= session, key= 'knowledge', agent_id= agent_id)
if agent_execution_knowledge:
if agent_execution_knowledge and agent_execution_knowledge.value != 'None':
knowledge_name = Knowledges.get_knowledge_from_id(session, int(agent_execution_knowledge.value)).name
if knowledge_name is not None:
EventHandler(session=session).create_event('knowledge_picked',
Expand Down