Skip to content

Commit

Permalink
Fetch data source view in agent configuration (#6708)
Browse files Browse the repository at this point in the history
* Fetch data source view in agent configuration

* Setup Sequelize relationship

* Return both data source id and data source view id.

* Refactor process action

* Address naming comments from review

* Refactor dust app fetching logic

* Refactor table query actions fetch

* Refactor websearch and browse fetch logic

* ✨

* ✨
  • Loading branch information
flvndvd authored Aug 9, 2024
1 parent b0d41ba commit 362b099
Show file tree
Hide file tree
Showing 16 changed files with 663 additions and 291 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ export default function AssistantBuilderDataSourceModal({
...currentConfigurations,
[ds.name]: {
dataSource: ds,
// TODO(GROUPS_INFRA) Replace with DataSourceViewType once the UI has it.
dataSourceViewId: null,
selectedResources: [],
isSelectAll: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ export async function buildInitialActions({
const dataSource = dataSourcesByName[ds.dataSourceName];
if (!dataSource.connectorId || !ds.resources) {
return {
dataSource: dataSource,
dataSource,
// TODO(GROUPS_INFRA) Replace with DataSourceViewType once the UI has it.
dataSourceViewId: null,
selectedResources: [],
isSelectAll: ds.isSelectAll,
};
Expand All @@ -92,7 +94,9 @@ export async function buildInitialActions({
}

return {
dataSource: dataSource,
dataSource,
// TODO(GROUPS_INFRA) Replace with DataSourceViewType once the UI has it.
dataSourceViewId: null,
selectedResources: response.value.nodes,
isSelectAll: ds.isSelectAll,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ export async function submitAssistantBuilderForm({
a.configuration.dataSourceConfigurations
).map(({ dataSource, selectedResources, isSelectAll }) => ({
dataSourceId: dataSource.name,
// TODO(GROUPS_INFRA) Replace with DataSourceViewType once the UI has it.
dataSourceViewId: null,
workspaceId: owner.sId,
filter: {
parents: !isSelectAll
Expand Down Expand Up @@ -150,6 +152,8 @@ export async function submitAssistantBuilderForm({
a.configuration.dataSourceConfigurations
).map(({ dataSource, selectedResources, isSelectAll }) => ({
dataSourceId: dataSource.name,
// TODO(GROUPS_INFRA) Replace with DataSourceViewType once the UI has it.
dataSourceViewId: null,
workspaceId: owner.sId,
filter: {
parents: !isSelectAll
Expand Down
2 changes: 2 additions & 0 deletions front/components/assistant_builder/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export const ACTION_MODES = [

export type AssistantBuilderDataSourceConfiguration = {
dataSource: DataSourceType;
// TODO(GROUPS_INFRA) Replace with DataSourceViewType once the UI has it.
dataSourceViewId: null;
selectedResources: ContentNode[];
isSelectAll: boolean;
};
Expand Down
Loading

0 comments on commit 362b099

Please sign in to comment.