Skip to content

Commit

Permalink
fixing the config exception issue
Browse files Browse the repository at this point in the history
  • Loading branch information
TransformerOptimus committed Jul 14, 2023
1 parent 672d092 commit 4d5c292
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion superagi/jobs/agent_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def get_model_api_key_from_execution(cls, model, agent_execution, session):

@classmethod
def get_llm_source(cls, agent_execution, session):
return Configuration.fetch_value_by_agent_id(session, agent_execution.agent_id, "model_source")
return Configuration.fetch_value_by_agent_id(session, agent_execution.agent_id, "model_source") or "OpenAi"

@classmethod
def get_embedding(cls, model_source, model_api_key):
Expand Down
2 changes: 1 addition & 1 deletion superagi/models/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,5 @@ def fetch_value_by_agent_id(cls, session, agent_id: int, key: str):
config = session.query(Configuration).filter(Configuration.organisation_id == organisation.id,
Configuration.key == key).first()
if not config:
raise HTTPException(status_code=404, detail="Configuration not found")
return None
return config.value if config else None

0 comments on commit 4d5c292

Please sign in to comment.