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
-
↳
TreeSummarize
Implements
Constructors
constructor
• new TreeSummarize(serviceContext?
, summaryTemplate?
): TreeSummarize
Parameters
Name | Type |
---|---|
serviceContext? | ServiceContext |
summaryTemplate? | (__namedParameters : { context : undefined | string = ""; query : undefined | string = "" }) => string |
Returns
Overrides
Defined in
packages/core/src/synthesizers/builders.ts:286
Properties
llm
• llm: LLM
<object
, object
>
Defined in
packages/core/src/synthesizers/builders.ts:282
promptHelper
• promptHelper: PromptHelper
Defined in
packages/core/src/synthesizers/builders.ts:283
summaryTemplate
• summaryTemplate: (__namedParameters
: { context
: undefined
| string
= ""; query
: undefined
| string
= "" }) => string
Type declaration
▸ («destructured»
): string
Parameters
Name | Type | Default value |
---|---|---|
«destructured» | Object | undefined |
› context | undefined | string | "" |
› query | undefined | string | "" |
Returns
string
Defined in
packages/core/src/synthesizers/builders.ts:284
Methods
_getPromptModules
▸ _getPromptModules(): Record
<string
, any
>
Returns
Record
<string
, any
>
Inherited from
Defined in
packages/core/src/prompts/Mixin.ts:82
_getPrompts
▸ _getPrompts(): Object
Returns
Object
Name | Type |
---|---|
summaryTemplate | (__namedParameters : { context : undefined | string = ""; query : undefined | string = "" }) => string |
Overrides
Defined in
packages/core/src/synthesizers/builders.ts:297
_updatePrompts
▸ _updatePrompts(prompts
): void
Parameters
Name | Type |
---|---|
prompts | Object |
prompts.summaryTemplate | (__namedParameters : { context : undefined | string = ""; query : undefined | string = "" }) => string |
Returns
void
Overrides
Defined in
packages/core/src/synthesizers/builders.ts:303
getPrompts
▸ getPrompts(): PromptsDict
Returns all prompts from the mixin and its modules
Returns
PromptsDict
Implementation of
Inherited from
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
Name | Type |
---|---|
params | ResponseBuilderParamsStreaming |
Returns
Promise
<AsyncIterable
<string
>>
Implementation of
Defined in
packages/core/src/synthesizers/builders.ts:311
▸ getResponse(params
): Promise
<string
>
Parameters
Name | Type |
---|---|
params | ResponseBuilderParamsNonStreaming |
Returns
Promise
<string
>
Implementation of
Defined in
packages/core/src/synthesizers/builders.ts:314
updatePrompts
▸ updatePrompts(promptsDict
): void
Updates the prompts in the mixin and its modules
Parameters
Name | Type |
---|---|
promptsDict | PromptsDict |
Returns
void
Implementation of
Inherited from
Defined in
packages/core/src/prompts/Mixin.ts:48
validatePrompts
▸ validatePrompts(promptsDict
, moduleDict
): void
Validates the prompt keys and module keys
Parameters
Name | Type |
---|---|
promptsDict | PromptsDict |
moduleDict | ModuleDict |
Returns
void
Implementation of
ResponseBuilder.validatePrompts