Skip to content

Commit

Permalink
fix websearch action/config (#9658)
Browse files Browse the repository at this point in the history
  • Loading branch information
spolu authored Dec 30, 2024
1 parent 5eb0f09 commit 588f1a4
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions front/poke/temporal/activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ import {
AgentTablesQueryConfiguration,
AgentTablesQueryConfigurationTable,
} from "@app/lib/models/assistant/actions/tables_query";
import {
AgentWebsearchAction,
AgentWebsearchConfiguration,
} from "@app/lib/models/assistant/actions/websearch";
import {
AgentConfiguration,
AgentUserRelation,
Expand Down Expand Up @@ -297,6 +301,28 @@ export async function deleteAgentsActivity({
transaction: t,
});

const agentWebsearchConfigurations =
await AgentWebsearchConfiguration.findAll({
where: {
agentConfigurationId: agent.id,
},
transaction: t,
});
await AgentWebsearchAction.destroy({
where: {
websearchConfigurationId: {
[Op.in]: agentWebsearchConfigurations.map((r) => r.sId),
},
},
transaction: t,
});
await AgentWebsearchConfiguration.destroy({
where: {
agentConfigurationId: agent.id,
},
transaction: t,
});

await AgentUserRelation.destroy({
where: {
agentConfiguration: agent.sId,
Expand Down

0 comments on commit 588f1a4

Please sign in to comment.