Skip to content
Snippets Groups Projects
Commit 44fd5778 authored by thucpn's avatar thucpn
Browse files

fix: type any for workflow factory

parent 55293998
No related branches found
No related tags found
No related merge requests found
......@@ -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">;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment