メインコンテンツまでスキップ

Class: CallbackManager

Implements

  • CallbackManagerMethods

Constructors

constructor

new CallbackManager(handlers?): CallbackManager

Parameters

NameType
handlers?Partial<CallbackManagerMethods>

Returns

CallbackManager

Defined in

packages/core/src/callbacks/CallbackManager.ts:160

Properties

#handlers

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

Defined in

packages/core/src/callbacks/CallbackManager.ts:158

Accessors

onLLMStream

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

Returns

fn

▸ (params): void | Promise<void>

Parameters
NameType
paramsStreamCallbackResponse
Returns

void | Promise<void>

Deprecated

will be removed in the next major version

Implementation of

CallbackManagerMethods.onLLMStream

Defined in

packages/core/src/callbacks/CallbackManager.ts:117

set onLLMStream(_): void

Parameters

NameType
_never

Returns

void

Deprecated

will be removed in the next major version

Implementation of

CallbackManagerMethods.onLLMStream

Defined in

packages/core/src/callbacks/CallbackManager.ts:147


onRetrieve

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

Returns

fn

▸ (params): void | Promise<void>

Parameters
NameType
paramsRetrievalCallbackResponse
Returns

void | Promise<void>

Deprecated

will be removed in the next major version

Implementation of

CallbackManagerMethods.onRetrieve

Defined in

packages/core/src/callbacks/CallbackManager.ts:132

set onRetrieve(_): void

Parameters

NameType
_never

Returns

void

Deprecated

will be removed in the next major version

Implementation of

CallbackManagerMethods.onRetrieve

Defined in

packages/core/src/callbacks/CallbackManager.ts:154

Methods

dispatchEvent

dispatchEvent<K>(event, detail): void

Type parameters

NameType
Kextends keyof LlamaIndexEventMaps

Parameters

NameType
eventK
detailLlamaIndexEventMaps[K]["detail"]

Returns

void

Defined in

packages/core/src/callbacks/CallbackManager.ts:193


off

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

Type parameters

NameType
Kextends keyof LlamaIndexEventMaps
Hextends EventHandler<LlamaIndexEventMaps[K]>

Parameters

NameType
eventK
handlerH

Returns

undefined | CallbackManager

Defined in

packages/core/src/callbacks/CallbackManager.ts:178


on

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

Type parameters

NameType
Kextends keyof LlamaIndexEventMaps
Hextends EventHandler<LlamaIndexEventMaps[K]>

Parameters

NameType
eventK
handlerH

Returns

CallbackManager

Defined in

packages/core/src/callbacks/CallbackManager.ts:167