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?: TreeSummarizePrompt

Returns

TreeSummarize

Overrides

PromptMixin.constructor

Defined in

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

Properties

llm

llm: LLM<object, object>

Defined in

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


promptHelper

promptHelper: PromptHelper

Defined in

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


summaryTemplate

summaryTemplate: TreeSummarizePrompt

Defined in

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

Methods

_getPromptModules()

protected _getPromptModules(): ModuleRecord

Return a dictionary of sub-modules within the current module that also implement PromptMixin (so that their prompts can also be get/set).

Can be blank if no sub-modules.

Returns

ModuleRecord

Implementation of

ResponseBuilder._getPromptModules

Overrides

PromptMixin._getPromptModules

Defined in

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


_getPrompts()

protected _getPrompts(): object

Returns

object

summaryTemplate

summaryTemplate: TreeSummarizePrompt

Implementation of

ResponseBuilder._getPrompts

Overrides

PromptMixin._getPrompts

Defined in

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


_updatePrompts()

protected _updatePrompts(prompts): void

Parameters

prompts

prompts.summaryTemplate: TreeSummarizePrompt

Returns

void

Implementation of

ResponseBuilder._updatePrompts

Overrides

PromptMixin._updatePrompts

Defined in

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


getPrompts()

getPrompts(): PromptsRecord

Returns

PromptsRecord

Implementation of

ResponseBuilder.getPrompts

Inherited from

PromptMixin.getPrompts

Defined in

packages/core/dist/prompts/index.d.ts:58


getResponse()

getResponse(query, stream)

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

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

Parameters

query: ResponseBuilderQuery

stream: true

Returns

Promise<AsyncIterable<string, any, any>>

Implementation of

ResponseBuilder.getResponse

Defined in

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

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:326


updatePrompts()

updatePrompts(prompts): void

Parameters

prompts: PromptsRecord

Returns

void

Implementation of

ResponseBuilder.updatePrompts

Inherited from

PromptMixin.updatePrompts

Defined in

packages/core/dist/prompts/index.d.ts:59


validatePrompts()

validatePrompts(promptsDict, moduleDict): void

Parameters

promptsDict: PromptsRecord

moduleDict: ModuleRecord

Returns

void

Implementation of

ResponseBuilder.validatePrompts

Inherited from

PromptMixin.validatePrompts

Defined in

packages/core/dist/prompts/index.d.ts:57