Class: CompactAndRefine
CompactAndRefine is a slight variation of Refine that first compacts the text chunks into the smallest possible number of chunks.
Hierarchy
-
↳
CompactAndRefine
Constructors
constructor
• new CompactAndRefine(serviceContext
, textQATemplate?
, refineTemplate?
): CompactAndRefine
Parameters
Name | Type |
---|---|
serviceContext | ServiceContext |
textQATemplate? | (__namedParameters : { context : undefined | string = ""; query : undefined | string = "" }) => string |
refineTemplate? | (__namedParameters : { context : undefined | string = ""; existingAnswer : undefined | string = ""; query : undefined | string = "" }) => string |
Returns
Inherited from
Defined in
packages/core/src/synthesizers/builders.ts:82
Properties
llm
• llm: LLM
Inherited from
Defined in
packages/core/src/synthesizers/builders.ts:77
promptHelper
• promptHelper: PromptHelper
Inherited from
Defined in
packages/core/src/synthesizers/builders.ts:78
refineTemplate
• refineTemplate: (__namedParameters
: { context
: undefined
| string
= ""; existingAnswer
: undefined
| string
= ""; query
: undefined
| string
= "" }) => string
Type declaration
▸ («destructured»
): string
Parameters
Name | Type | Default value |
---|---|---|
«destructured» | Object | undefined |
› context | undefined | string | "" |
› existingAnswer | undefined | string | "" |
› query | undefined | string | "" |
Returns
string
Inherited from
Defined in
packages/core/src/synthesizers/builders.ts:80
textQATemplate
• textQATemplate: (__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
Inherited from
Defined in
packages/core/src/synthesizers/builders.ts:79
Methods
complete
▸ complete(params
): Promise
<string
| AsyncIterable
<string
>>
Parameters
Name | Type |
---|---|
params | Object |
params.parentEvent? | Event |
params.prompt | string |
params.stream | boolean |
Returns
Promise
<string
| AsyncIterable
<string
>>
Inherited from
Defined in
packages/core/src/synthesizers/builders.ts:201
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
>>