Skip to content

Commit

Permalink
move actions
Browse files Browse the repository at this point in the history
  • Loading branch information
spolu committed Nov 15, 2024
1 parent 8db56d6 commit bbe9aa6
Show file tree
Hide file tree
Showing 15 changed files with 219 additions and 219 deletions.
32 changes: 32 additions & 0 deletions types/src/front/assistant/actions/browse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,35 @@ export interface BrowseActionType extends BaseAction {
step: number;
type: "browse_action";
}

/**
* Browse Action Events
*/

// Event sent before the execution with the finalized params to be used.
export type BrowseParamsEvent = {
type: "browse_params";
created: number;
configurationId: string;
messageId: string;
action: BrowseActionType;
};

export type BrowseErrorEvent = {
type: "browse_error";
created: number;
configurationId: string;
messageId: string;
error: {
code: string;
message: string;
};
};

export type BrowseSuccessEvent = {
type: "browse_success";
created: number;
configurationId: string;
messageId: string;
action: BrowseActionType;
};
40 changes: 40 additions & 0 deletions types/src/front/assistant/actions/dust_app_run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,43 @@ export interface DustAppRunActionType extends BaseAction {
step: number;
type: "dust_app_run_action";
}

/**
* DustAppRun Action Events
*/

// Event sent before the execution of a dust app run with the finalized params to be used.
export type DustAppRunParamsEvent = {
type: "dust_app_run_params";
created: number;
configurationId: string;
messageId: string;
action: DustAppRunActionType;
};

export type DustAppRunErrorEvent = {
type: "dust_app_run_error";
created: number;
configurationId: string;
messageId: string;
error: {
code: string;
message: string;
};
};

export type DustAppRunBlockEvent = {
type: "dust_app_run_block";
created: number;
configurationId: string;
messageId: string;
action: DustAppRunActionType;
};

export type DustAppRunSuccessEvent = {
type: "dust_app_run_success";
created: number;
configurationId: string;
messageId: string;
action: DustAppRunActionType;
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ModelId } from "../../../../../shared/model_id";
import { FunctionCallType, FunctionMessageTypeModel } from "../generation";
import {
FunctionCallType,
FunctionMessageTypeModel,
} from "../../../front/assistant/generation";
import { ModelId } from "../../../shared/model_id";

type BaseActionType =
| "dust_app_run_action"
Expand Down
34 changes: 34 additions & 0 deletions types/src/front/assistant/actions/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,37 @@ export interface ProcessActionType extends BaseAction {
step: number;
type: "process_action";
}

/**
* Process Action Events
*/

// Event sent before the execution with the finalized params to be used.
export type ProcessParamsEvent = {
type: "process_params";
created: number;
configurationId: string;
messageId: string;
dataSources: DataSourceConfiguration[];
action: ProcessActionType;
};

export type ProcessErrorEvent = {
type: "process_error";
created: number;
configurationId: string;
messageId: string;
error: {
code: string;
message: string;
};
};

export type ProcessSuccessEvent = {
type: "process_success";
created: number;
configurationId: string;
messageId: string;
action: ProcessActionType;
};

Check failure on line 127 in types/src/front/assistant/actions/process.ts

View workflow job for this annotation

GitHub Actions / check-eslint

Delete `⏎`
37 changes: 35 additions & 2 deletions types/src/front/assistant/actions/retrieval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
* Data Source configuration
*/

import { ConnectorProvider } from "../../../front/data_source";
import { DataSourceViewType } from "../../../front/data_source_view";
import { BaseAction } from "../../../front/lib/api/assistant/actions/index";
import { ModelId } from "../../../shared/model_id";
import { ioTsEnum } from "../../../shared/utils/iots_utils";
import { ConnectorProvider } from "../../data_source";
import { DataSourceViewType } from "../../data_source_view";

export const TIME_FRAME_UNITS = [
"hour",
Expand Down Expand Up @@ -143,3 +143,36 @@ export interface RetrievalActionType extends BaseAction {
step: number;
type: "retrieval_action";
}

/**
* Retrieval Action Events
*/

// Event sent during retrieval with the finalized query used to retrieve documents.
export type RetrievalParamsEvent = {
type: "retrieval_params";
created: number;
configurationId: string;
messageId: string;
dataSources: DataSourceConfiguration[];
action: RetrievalActionType;
};

export type RetrievalErrorEvent = {
type: "retrieval_error";
created: number;
configurationId: string;
messageId: string;
error: {
code: string;
message: string;
};
};

export type RetrievalSuccessEvent = {
type: "retrieval_success";
created: number;
configurationId: string;
messageId: string;
action: RetrievalActionType;
};
39 changes: 39 additions & 0 deletions types/src/front/assistant/actions/tables_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,42 @@ export function getTablesQueryResultsFileAttachment({

return `${attachment}>\n${resultsFileSnippet}\n</file>`;
}

/**
* TablesQuey Events
*/

export type TablesQueryErrorEvent = {
type: "tables_query_error";
created: number;
configurationId: string;
messageId: string;
error: {
code: "tables_query_error" | "too_many_result_rows";
message: string;
};
};

export type TablesQueryStartedEvent = {
type: "tables_query_started";
created: number;
configurationId: string;
messageId: string;
action: TablesQueryActionType;
};

export type TablesQueryModelOutputEvent = {
type: "tables_query_model_output";
created: number;
configurationId: string;
messageId: string;
action: TablesQueryActionType;
};

export type TablesQueryOutputEvent = {
type: "tables_query_output";
created: number;
configurationId: string;
messageId: string;
action: TablesQueryActionType;
};
32 changes: 32 additions & 0 deletions types/src/front/assistant/actions/websearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,35 @@ export interface WebsearchActionType extends BaseAction {
step: number;
type: "websearch_action";
}

/**
* WebSearch Action Events
*/

// Event sent before the execution with the finalized params to be used.
export type WebsearchParamsEvent = {
type: "websearch_params";
created: number;
configurationId: string;
messageId: string;
action: WebsearchActionType;
};

export type WebsearchErrorEvent = {
type: "websearch_error";
created: number;
configurationId: string;
messageId: string;
error: {
code: string;
message: string;
};
};

export type WebsearchSuccessEvent = {
type: "websearch_success";
created: number;
configurationId: string;
messageId: string;
action: WebsearchActionType;
};
File renamed without changes.
29 changes: 0 additions & 29 deletions types/src/front/lib/api/assistant/actions/browse.ts

This file was deleted.

41 changes: 0 additions & 41 deletions types/src/front/lib/api/assistant/actions/dust_app_run.ts

This file was deleted.

35 changes: 0 additions & 35 deletions types/src/front/lib/api/assistant/actions/process.ts

This file was deleted.

Loading

0 comments on commit bbe9aa6

Please sign in to comment.