Class: CompactAndRefine
CompactAndRefine is a slight variation of Refine that first compacts the text chunks into the smallest possible number of chunks.
Extends
Constructors
new CompactAndRefine()
new CompactAndRefine(
serviceContext
?,textQATemplate
?,refineTemplate
?):CompactAndRefine
Parameters
• serviceContext?: ServiceContext
• textQATemplate?
• refineTemplate?
Returns
Inherited from
Source
packages/llamaindex/src/synthesizers/builders.ts:88
Properties
llm
llm:
LLM
<object
,object
>
Inherited from
Source
packages/llamaindex/src/synthesizers/builders.ts:83
promptHelper
promptHelper:
PromptHelper
Inherited from
Source
packages/llamaindex/src/synthesizers/builders.ts:84
refineTemplate()
refineTemplate: (
__namedParameters
) =>string
Parameters
• __namedParameters
• __namedParameters.context: undefined
| string
= ""
• __namedParameters.existingAnswer: undefined
| string
= ""
• __namedParameters.query: undefined
| string
= ""
Returns
string
Inherited from
Source
packages/llamaindex/src/synthesizers/builders.ts:86
textQATemplate()
textQATemplate: (
__namedParameters
) =>string
Parameters
• __namedParameters
• __namedParameters.context: undefined
| string
= ""
• __namedParameters.query: undefined
| string
= ""
Returns
string
Inherited from
Source
packages/llamaindex/src/synthesizers/builders.ts:85
Methods
_getPromptModules()
protected
_getPromptModules():Record
<string
,any
>
Returns
Record
<string
, any
>
Inherited from
Source
packages/llamaindex/src/prompts/Mixin.ts:82
_getPrompts()
protected
_getPrompts():object
Returns
object
refineTemplate()
refineTemplate: (
__namedParameters
) =>string
Parameters
• __namedParameters
• __namedParameters.context: undefined
| string
= ""
• __namedParameters.existingAnswer: undefined
| string
= ""
• __namedParameters.query: undefined
| string
= ""
Returns
string
textQATemplate()
textQATemplate: (
__namedParameters
) =>string
Parameters
• __namedParameters
• __namedParameters.context: undefined
| string
= ""
• __namedParameters.existingAnswer: undefined
| string
= ""
• __namedParameters.query: undefined
| string
= ""
Returns
string
Inherited from
Source
packages/llamaindex/src/synthesizers/builders.ts:101
_updatePrompts()
protected
_updatePrompts(prompts
):void
Parameters
• prompts
• prompts.refineTemplate
• prompts.textQATemplate
Returns
void
Inherited from
Source
packages/llamaindex/src/synthesizers/builders.ts:111
complete()
complete(
params
):Promise
<string
|AsyncIterable
<string
>>