Skip to content

Commit

Permalink
delete if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT committed Jan 5, 2025
1 parent df824e3 commit 9fbd6d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion agixt/Agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,10 @@ def update_agent_config(self, new_config, config_key):
.first()
)
if agent_setting:
agent_setting.value = str(setting_value)
if setting_value == "":
session.delete(agent_setting)
else:
agent_setting.value = str(setting_value)
else:
agent_setting = AgentSettingModel(
agent_id=self.agent_id,
Expand Down
3 changes: 3 additions & 0 deletions agixt/endpoints/Provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,6 @@ async def get_embed_providers(user=Depends(verify_api_key)):
)
async def get_embedder_info(user=Depends(verify_api_key)) -> Dict[str, Any]:
return {"embedders": get_providers_by_service(service="embeddings")}


# put /v1/provider

0 comments on commit 9fbd6d2

Please sign in to comment.