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

stop agent from executing if model is not found #1155

Merged
merged 1 commit into from
Aug 30, 2023
Merged
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
11 changes: 8 additions & 3 deletions superagi/jobs/agent_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,14 @@
logger.error(f"Agent execution stopped. Max iteration exceeded. {agent.id}: {agent_execution.status}")
return

model_config = AgentConfiguration.get_model_api_key(session, agent_execution.agent_id, agent_config["model"])
model_api_key = model_config['api_key']
model_llm_source = model_config['provider']
try:
model_config = AgentConfiguration.get_model_api_key(session, agent_execution.agent_id, agent_config["model"])
model_api_key = model_config['api_key']
model_llm_source = model_config['provider']
except Exception as e:
logger.info(f"Unable to get model config...{e}")

Check warning on line 63 in superagi/jobs/agent_executor.py

View check run for this annotation

Codecov / codecov/patch

superagi/jobs/agent_executor.py#L58-L63

Added lines #L58 - L63 were not covered by tests
return

try:
memory = None
if "OpenAI" in model_llm_source:
Expand Down