diff --git a/packages/server/src/types.ts b/packages/server/src/types.ts index 9567c41efd16c10726e7c3d6d93e3f9293f260cc..6743a689b04e044e17e20cb8af4dd24d585592b6 100644 --- a/packages/server/src/types.ts +++ b/packages/server/src/types.ts @@ -6,11 +6,19 @@ import { } from "llamaindex"; import type next from "next"; +/** + * The input for an AgentWorkflow + * userInput is the last message content from the user + * chatHistory is the previous chat history (not including the last message) + */ export type AgentInput = { - userInput: string; // the last message content from the user - chatHistory: ChatMessage[]; // the previous chat history (not including the last message) + userInput: string; + chatHistory: ChatMessage[]; }; +/** + * ServerWorkflow can be either a normal Workflow or an AgentWorkflow + */ export type ServerWorkflow = | Workflow<null, AgentInput, ChatResponseChunk> | AgentWorkflow; @@ -20,7 +28,8 @@ export type ServerWorkflow = * The requestBody parameter is the body from the request, which can be used to customize the workflow per request. */ export type WorkflowFactory = ( - requestBody?: unknown, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + requestBody?: any, ) => Promise<ServerWorkflow> | ServerWorkflow; export type NextAppOptions = Omit<Parameters<typeof next>[0], "dir">;