Skip to content

Commit

Permalink
set company id if not set
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT committed Jan 13, 2025
1 parent b4bb122 commit b126f7b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions agixt/Agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,17 @@ def get_agents(user=DEFAULT_USER, company=None):
if company_id and company:
if company_id != company:
continue
if not company_id:
auth = MagicalAuth(token=impersonate_user(user_id=str(user_data.id)))
company_id = str(auth.company_id)
# update agent settings
agent_setting = AgentSettingModel(
agent_id=agent.id,
name="company_id",
value=company_id,
)
session.add(agent_setting)
session.commit()
output.append(
{
"name": agent.name,
Expand Down

0 comments on commit b126f7b

Please sign in to comment.