Skip to content

Commit

Permalink
Pass datasource view id to core (#6730)
Browse files Browse the repository at this point in the history
  • Loading branch information
flvndvd authored Aug 9, 2024
1 parent 739dbb4 commit 556efd3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion front/lib/api/assistant/actions/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,10 @@ export class ProcessConfigurationServerRunner extends BaseActionConfigurationSer
workspace_id: isDevelopment()
? PRODUCTION_DUST_WORKSPACE_ID
: d.workspaceId,
data_source_id: d.dataSourceId,

// Use dataSourceViewId if it exists; otherwise, use dataSourceId.
// Note: This value is passed to the registry for lookup.
data_source_id: d.dataSourceViewId ?? d.dataSourceId,
})
);

Expand All @@ -283,6 +286,9 @@ export class ProcessConfigurationServerRunner extends BaseActionConfigurationSer
if (!config.DATASOURCE.filter.parents.in_map) {
config.DATASOURCE.filter.parents.in_map = {};
}

// Note: We use dataSourceId here because after the registry lookup,
// it returns either the data source itself or the data source associated with the data source view.
config.DATASOURCE.filter.parents.in_map[ds.dataSourceId] =
ds.filter.parents.in;
}
Expand Down
7 changes: 6 additions & 1 deletion front/lib/api/assistant/actions/retrieval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,9 @@ export class RetrievalConfigurationServerRunner extends BaseActionConfigurationS
workspace_id: isDevelopment()
? PRODUCTION_DUST_WORKSPACE_ID
: d.workspaceId,
data_source_id: d.dataSourceId,
// Use dataSourceViewId if it exists; otherwise, use dataSourceId.
// Note: This value is passed to the registry for lookup.
data_source_id: d.dataSourceViewId ?? d.dataSourceId,
})
);

Expand All @@ -452,6 +454,9 @@ export class RetrievalConfigurationServerRunner extends BaseActionConfigurationS
if (!config.DATASOURCE.filter.parents.in_map) {
config.DATASOURCE.filter.parents.in_map = {};
}

// Note: We use dataSourceId here because after the registry lookup,
// it returns either the data source itself or the data source associated with the data source view.
config.DATASOURCE.filter.parents.in_map[ds.dataSourceId] =
ds.filter.parents.in;
}
Expand Down

0 comments on commit 556efd3

Please sign in to comment.