Nhảy tới nội dung

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.

Hierarchy

Implements

Constructors

constructor

new TreeSummarize(serviceContext, summaryTemplate?): TreeSummarize

Parameters

NameType
serviceContextServiceContext
summaryTemplate?(__namedParameters: { context: undefined | string = ""; query: undefined | string = "" }) => string

Returns

TreeSummarize

Overrides

PromptMixin.constructor

Defined in

packages/core/src/synthesizers/builders.ts:295

Properties

llm

llm: LLM

Defined in

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


promptHelper

promptHelper: PromptHelper

Defined in

packages/core/src/synthesizers/builders.ts:292


summaryTemplate

summaryTemplate: (__namedParameters: { context: undefined | string = ""; query: undefined | string = "" }) => string

Type declaration

▸ («destructured»): string

Parameters
NameTypeDefault value
«destructured»Objectundefined
› contextundefined | string""
› queryundefined | string""
Returns

string

Defined in

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

Methods

_getPromptModules

_getPromptModules(): Record<string, any>

Returns

Record<string, any>

Inherited from

PromptMixin._getPromptModules

Defined in

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


_getPrompts

_getPrompts(): Object

Returns

Object

NameType
summaryTemplate(__namedParameters: { context: undefined | string = ""; query: undefined | string = "" }) => string

Overrides

PromptMixin._getPrompts

Defined in

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


_updatePrompts

_updatePrompts(prompts): void

Parameters

NameType
promptsObject
prompts.summaryTemplate(__namedParameters: { context: undefined | string = ""; query: undefined | string = "" }) => string

Returns

void

Overrides

PromptMixin._updatePrompts

Defined in

packages/core/src/synthesizers/builders.ts:312


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/core/src/prompts/Mixin.ts:27


getResponse

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

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

Parameters

NameType
paramsResponseBuilderParamsStreaming

Returns

Promise<AsyncIterable<string>>

Implementation of

ResponseBuilder.getResponse

Defined in

packages/core/src/synthesizers/builders.ts:320

getResponse(params): Promise<string>

Parameters

NameType
paramsResponseBuilderParamsNonStreaming

Returns

Promise<string>

Implementation of

ResponseBuilder.getResponse

Defined in

packages/core/src/synthesizers/builders.ts:323


updatePrompts

updatePrompts(promptsDict): void

Updates the prompts in the mixin and its modules

Parameters

NameType
promptsDictPromptsDict

Returns

void

Implementation of

ResponseBuilder.updatePrompts

Inherited from

PromptMixin.updatePrompts

Defined in

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


validatePrompts

validatePrompts(promptsDict, moduleDict): void

Validates the prompt keys and module keys

Parameters

NameType
promptsDictPromptsDict
moduleDictModuleDict

Returns

void

Implementation of

ResponseBuilder.validatePrompts

Inherited from

PromptMixin.validatePrompts

Defined in

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