Class: Refine
A response builder that uses the query to ask the LLM generate a better response using multiple text chunks.
Hierarchy
Refine
Implements
Constructors
constructor
• new Refine(serviceContext
, textQATemplate?
, refineTemplate?
)
Parameters
Name | Type |
---|---|
serviceContext | ServiceContext |
textQATemplate? | (__namedParameters : Object ) => string |
refineTemplate? | (__namedParameters : Object ) => string |
Defined in
packages/core/src/synthesizers/builders.ts:82
Properties
llm
• llm: LLM
Defined in
packages/core/src/synthesizers/builders.ts:77
promptHelper
• promptHelper: PromptHelper
Defined in
packages/core/src/synthesizers/builders.ts:78
refineTemplate
• refineTemplate: (__namedParameters
: Object
) => string
Type declaration
▸ («destructured»
): string
Parameters
Name | Type |
---|---|
«destructured» | Object |
Returns
string
Defined in
packages/core/src/synthesizers/builders.ts:80
textQATemplate
• textQATemplate: (__namedParameters
: Object
) => string
Type declaration
▸ («destructured»
): string
Parameters
Name | Type |
---|---|
«destructured» | Object |
Returns
string
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
>>
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
>>
Implementation of
Defined in
packages/core/src/synthesizers/builders.ts:93
▸ getResponse(params
): Promise
<string
>
Parameters
Name | Type |
---|---|
params | ResponseBuilderParamsNonStreaming |
Returns
Promise
<string
>
Implementation of
Defined in
packages/core/src/synthesizers/builders.ts:96
giveResponseSingle
▸ Private
giveResponseSingle(queryStr
, textChunk
, stream
, parentEvent?
): Promise
<undefined
| string
| AsyncIterable
<string
>>
Parameters
Name | Type |
---|---|
queryStr | string |
textChunk | string |
stream | boolean |
parentEvent? | Event |
Returns
Promise
<undefined
| string
| AsyncIterable
<string
>>
Defined in
packages/core/src/synthesizers/builders.ts:134
refineResponseSingle
▸ Private
refineResponseSingle(initialReponse
, queryStr
, textChunk
, stream
, parentEvent?
): Promise
<string
| AsyncIterable
<string
>>
Parameters
Name | Type |
---|---|
initialReponse | string |
queryStr | string |
textChunk | string |
stream | boolean |
parentEvent? | Event |
Returns
Promise
<string
| AsyncIterable
<string
>>