1- /* eslint-disable @typescript-eslint/no-explicit-any */
2-
31import {
42 type WorkflowEvent ,
53 type WorkflowEventData ,
64 workflowEvent ,
75} from "@llamaindex/workflow" ;
86import type { Message } from "ai" ;
7+ import type { JSONValue } from "llamaindex" ;
98import z from "zod" ;
109
1110export type HumanInputEventData = {
1211 type : string ;
13- data ?: any ;
12+ data ?: JSONValue ;
1413 response : WorkflowEvent < HumanResponseEventData > ;
1514} ;
1615
1716export const humanInputEvent = workflowBaseEvent < HumanInputEventData > ( ) ;
1817
1918export type HumanResponseEventData = {
2019 type : "human_response" ;
21- data ?: any ;
20+ data ?: JSONValue ;
2221} ;
2322
2423export const humanResponseEvent = workflowBaseEvent < HumanResponseEventData > ( ) ;
@@ -37,9 +36,9 @@ export const getHumanResponsesFromMessage = (message: Message) => {
3736export type BaseEvent < K > = ( < T extends K > ( ) => WorkflowEvent < T > ) &
3837 WorkflowEvent < K > ;
3938
40- export function workflowBaseEvent < K = any > ( ) : BaseEvent < K > {
39+ export function workflowBaseEvent < K = unknown > ( ) : BaseEvent < K > {
4140 const baseEvent = workflowEvent < K > ( ) ;
42- const derivedEvents = new Set < WorkflowEvent < any > > ( ) ;
41+ const derivedEvents = new Set < WorkflowEvent < unknown > > ( ) ;
4342
4443 function eventFn < T > ( ) : WorkflowEvent < T > {
4544 const event = workflowEvent < T > ( ) ;
@@ -50,7 +49,7 @@ export function workflowBaseEvent<K = any>(): BaseEvent<K> {
5049 const originalInclude = baseEvent . include ;
5150 const enhancedBaseEvent = Object . assign ( baseEvent , {
5251 include : (
53- instance : WorkflowEventData < any > ,
52+ instance : WorkflowEventData < unknown > ,
5453 ) : instance is WorkflowEventData < void > => {
5554 // Base event accepts its own instances OR instances from any derived events
5655 return (
0 commit comments