Saltar al contenido principal

Class: TreeSummarize

TreeSummarize repacks the text chunks into the smallest possible number of chunks and then summarizes them, then recursively does so until there's one chunk left.

Extends

Implements

Constructors

new TreeSummarize()

new TreeSummarize(serviceContext?, summaryTemplate?): TreeSummarize

Parameters

serviceContext?: ServiceContext

summaryTemplate?

Returns

TreeSummarize

Overrides

PromptMixin . constructor

Source

packages/llamaindex/src/synthesizers/builders.ts:286

Properties

llm

llm: LLM<object, object>

Source

packages/llamaindex/src/synthesizers/builders.ts:282


promptHelper

promptHelper: PromptHelper

Source

packages/llamaindex/src/synthesizers/builders.ts:283


summaryTemplate()

summaryTemplate: (__namedParameters) => string

Parameters

__namedParameters

__namedParameters.context: undefined | string= ""

__namedParameters.query: undefined | string= ""

Returns

string

Source

packages/llamaindex/src/synthesizers/builders.ts:284

Methods

_getPromptModules()

protected _getPromptModules(): Record<string, any>

Returns

Record<string, any>

Inherited from

PromptMixin . _getPromptModules

Source

packages/llamaindex/src/prompts/Mixin.ts:82


_getPrompts()

protected _getPrompts(): object

Returns

object

summaryTemplate()

summaryTemplate: (__namedParameters) => string

Parameters

__namedParameters

__namedParameters.context: undefined | string= ""

__namedParameters.query: undefined | string= ""

Returns

string

Overrides

PromptMixin . _getPrompts

Source

packages/llamaindex/src/synthesizers/builders.ts:297


_updatePrompts()

protected _updatePrompts(prompts): void

Parameters

prompts

prompts.summaryTemplate

Returns

void

Overrides

PromptMixin . _updatePrompts

Source

packages/llamaindex/src/synthesizers/builders.ts:303


getPrompts()

getPrompts(): PromptsDict

Returns all prompts from the mixin and its modules

Returns

PromptsDict

Implementation of

ResponseBuilder . getPrompts

Inherited from

PromptMixin . getPrompts

Source

packages/llamaindex/src/prompts/Mixin.ts:27


getResponse()

getResponse(params)

getResponse(params): Promise<AsyncIterable<string>>

Get the response from a query and a list of text chunks.

Parameters

params: ResponseBuilderParamsStreaming

Returns

Promise<AsyncIterable<string>>

Implementation of

ResponseBuilder . getResponse

Source

packages/llamaindex/src/synthesizers/builders.ts:311

getResponse(params)

getResponse(params): Promise<string>

Parameters

params: ResponseBuilderParamsNonStreaming

Returns

Promise<string>

Implementation of

ResponseBuilder . getResponse

Source

packages/llamaindex/src/synthesizers/builders.ts:314


updatePrompts()

updatePrompts(promptsDict): void

Updates the prompts in the mixin and its modules

Parameters

promptsDict: PromptsDict

Returns

void

Implementation of

ResponseBuilder . updatePrompts

Inherited from

PromptMixin . updatePrompts

Source

packages/llamaindex/src/prompts/Mixin.ts:48


validatePrompts()

validatePrompts(promptsDict, moduleDict): void

Validates the prompt keys and module keys

Parameters

promptsDict: PromptsDict

moduleDict: ModuleDict

Returns

void

Implementation of

ResponseBuilder . validatePrompts

Inherited from

PromptMixin . validatePrompts

Source

packages/llamaindex/src/prompts/Mixin.ts:10