Skip to content

Commit

Permalink
fix: AB parsing of include actions with timeframe (#9375)
Browse files Browse the repository at this point in the history
Co-authored-by: Henry Fontanier <[email protected]>
  • Loading branch information
fontanierh and Henry Fontanier authored Dec 13, 2024
1 parent ac1b2a5 commit 314db1d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions front/components/assistant_builder/actions/TimeDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { TIME_FRAME_UNIT_TO_LABEL } from "@app/components/assistant_builder/shar
import type { AssistantBuilderTimeFrame } from "@app/components/assistant_builder/types";

interface TimeUnitDropdownProps<
T extends { timeFrame?: AssistantBuilderTimeFrame },
T extends { timeFrame?: AssistantBuilderTimeFrame | null },
> {
timeFrame: AssistantBuilderTimeFrame;
disabled?: boolean;
Expand All @@ -20,7 +20,7 @@ interface TimeUnitDropdownProps<
}

export function TimeUnitDropdown<
T extends { timeFrame?: AssistantBuilderTimeFrame },
T extends { timeFrame?: AssistantBuilderTimeFrame | null },
>({ timeFrame, updateAction, onEdit, disabled }: TimeUnitDropdownProps<T>) {
return (
<DropdownMenu>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ async function getRetrievalActionConfiguration(
? getDefaultRetrievalSearchActionConfiguration()
: getDefaultRetrievalExhaustiveActionConfiguration();
if (
"timeFrame" in retrievalConfiguration.configuration &&
action.relativeTimeFrame !== "auto" &&
action.relativeTimeFrame !== "none" &&
"timeFrame" in retrievalConfiguration
action.relativeTimeFrame !== "none"
) {
retrievalConfiguration.timeFrame = {
retrievalConfiguration.configuration.timeFrame = {
value: action.relativeTimeFrame.duration,
unit: action.relativeTimeFrame.unit,
};
Expand Down
3 changes: 2 additions & 1 deletion front/components/assistant_builder/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export type AssistantBuilderRetrievalConfiguration = {
};

export type AssistantBuilderRetrievalExhaustiveConfiguration = {
timeFrame?: AssistantBuilderTimeFrame;
timeFrame?: AssistantBuilderTimeFrame | null;
} & AssistantBuilderRetrievalConfiguration;

// DustAppRun configuration
Expand Down Expand Up @@ -246,6 +246,7 @@ export function getDefaultRetrievalExhaustiveActionConfiguration() {
type: "RETRIEVAL_EXHAUSTIVE",
configuration: {
dataSourceConfigurations: {},
timeFrame: null,
} as AssistantBuilderRetrievalExhaustiveConfiguration,
name: DEFAULT_RETRIEVAL_NO_QUERY_ACTION_NAME,
description: "",
Expand Down

0 comments on commit 314db1d

Please sign in to comment.