Skip to main content

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

Defined in

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

Properties

llm

llm: LLM<object, object>

Defined in

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


promptHelper

promptHelper: PromptHelper

Defined in

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


summaryTemplate()

summaryTemplate: (__namedParameters) => string

Parameters

__namedParameters

__namedParameters.context: undefined | string = ""

__namedParameters.query: undefined | string = ""

Returns

string

Defined in

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

Methods

_getPromptModules()

protected _getPromptModules(): Record<string, any>

Returns

Record<string, any>

Inherited from

PromptMixin._getPromptModules

Defined in

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


_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

Defined in

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


_updatePrompts()

protected _updatePrompts(prompts): void

Parameters

prompts

prompts.summaryTemplate

Returns

void

Overrides

PromptMixin._updatePrompts

Defined in

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


getPrompts()

getPrompts(): PromptsDict

Returns all prompts from the mixin and its modules

Returns

PromptsDict

Implementation of

ResponseBuilder.getPrompts

Inherited from

PromptMixin.getPrompts

Defined in

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


getResponse()

getResponse(query, stream)

getResponse(query, stream): Promise<AsyncIterable<string>>

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

Parameters

query: ResponseBuilderQuery

stream: true

Returns

Promise<AsyncIterable<string>>

Implementation of

ResponseBuilder.getResponse

Defined in

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

getResponse(query, stream)

getResponse(query, stream?): Promise<string>

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

Parameters

query: ResponseBuilderQuery

stream?: false

Returns

Promise<string>

Implementation of

ResponseBuilder.getResponse

Defined in

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


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

Defined in

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

Defined in

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