Skip to content

Commit

Permalink
fix: use parents.in_map instead of parents.in in retrieval.ts (#2636)
Browse files Browse the repository at this point in the history
Co-authored-by: Henry Fontanier <henry@dust.tt>
  • Loading branch information
fontanierh and Henry Fontanier authored Nov 23, 2023
1 parent a2347c1 commit cc45837
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion front/lib/actions/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const DustProdActionRegistry = createActionRegistry({
DATASOURCE: {
data_sources: [],
top_k: 32,
filter: { tags: null, parent: null, timestamp: null },
filter: { tags: null, parents: null, timestamp: null },
use_cache: false,
},
},
Expand Down
7 changes: 4 additions & 3 deletions front/lib/api/assistant/actions/retrieval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -588,10 +588,11 @@ export async function* runRetrieval(
config.DATASOURCE.filter.parents = {};
}
if (ds.filter.parents?.in) {
if (!config.DATASOURCE.filter.parents.in) {
config.DATASOURCE.filter.parents.in = [];
if (!config.DATASOURCE.filter.parents.in_map) {
config.DATASOURCE.filter.parents.in_map = {};
}
config.DATASOURCE.filter.parents.in.push(...ds.filter.parents.in);
config.DATASOURCE.filter.parents.in_map[ds.dataSourceId] =
ds.filter.parents.in;
}
if (ds.filter.parents?.not) {
if (!config.DATASOURCE.filter.parents.not) {
Expand Down

0 comments on commit cc45837

Please sign in to comment.