انتقل إلى المحتوى الرئيسي

Class: CallbackManager

Implements

  • CallbackManagerMethods

Constructors

new CallbackManager()

new CallbackManager(handlers?): CallbackManager

Parameters

handlers?: Partial<CallbackManagerMethods>

Returns

CallbackManager

Source

packages/llamaindex/src/callbacks/CallbackManager.ts:179

Properties

#handlers

private #handlers: Map<keyof LlamaIndexEventMaps, EventHandler<CustomEvent<any>>[]>

Source

packages/llamaindex/src/callbacks/CallbackManager.ts:177

Accessors

onLLMStream

get onLLMStream(): (params) => void | Promise<void>

Deprecated

will be removed in the next major version

set onLLMStream(_): void

Deprecated

will be removed in the next major version

Parameters

_: never

Returns

Function

Parameters

params: StreamCallbackResponse

Returns

void | Promise<void>

Source

packages/llamaindex/src/callbacks/CallbackManager.ts:136


onRetrieve

get onRetrieve(): (params) => void | Promise<void>

Deprecated

will be removed in the next major version

set onRetrieve(_): void

Deprecated

will be removed in the next major version

Parameters

_: never

Returns

Function

Parameters

params: RetrievalCallbackResponse

Returns

void | Promise<void>

Source

packages/llamaindex/src/callbacks/CallbackManager.ts:151

Methods

dispatchEvent()

dispatchEvent<K>(event, detail): void

Type parameters

K extends keyof LlamaIndexEventMaps

Parameters

event: K

detail: LlamaIndexEventMaps[K]["detail"]

Returns

void

Source

packages/llamaindex/src/callbacks/CallbackManager.ts:212


off()

off<K, H>(event, handler): undefined | CallbackManager

Type parameters

K extends keyof LlamaIndexEventMaps

H extends EventHandler <LlamaIndexEventMaps[K]>

Parameters

event: K

handler: H

Returns

undefined | CallbackManager

Source

packages/llamaindex/src/callbacks/CallbackManager.ts:197


on()

on<K, H>(event, handler): CallbackManager

Type parameters

K extends keyof LlamaIndexEventMaps

H extends EventHandler <LlamaIndexEventMaps[K]>

Parameters

event: K

handler: H

Returns

CallbackManager

Source

packages/llamaindex/src/callbacks/CallbackManager.ts:186