Skip to content

Commit 66b8db6

Browse files
committed
remove any
1 parent 9b3c1ad commit 66b8db6

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

packages/server/src/utils/hitl/events.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
2-
31
import {
42
type WorkflowEvent,
53
type WorkflowEventData,
64
workflowEvent,
75
} from "@llamaindex/workflow";
86
import type { Message } from "ai";
7+
import type { JSONValue } from "llamaindex";
98
import z from "zod";
109

1110
export type HumanInputEventData = {
1211
type: string;
13-
data?: any;
12+
data?: JSONValue;
1413
response: WorkflowEvent<HumanResponseEventData>;
1514
};
1615

1716
export const humanInputEvent = workflowBaseEvent<HumanInputEventData>();
1817

1918
export type HumanResponseEventData = {
2019
type: "human_response";
21-
data?: any;
20+
data?: JSONValue;
2221
};
2322

2423
export const humanResponseEvent = workflowBaseEvent<HumanResponseEventData>();
@@ -37,9 +36,9 @@ export const getHumanResponsesFromMessage = (message: Message) => {
3736
export 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

Comments
 (0)