Class: Refine
A response builder that uses the query to ask the LLM generate a better response using multiple text chunks.
Hierarchy
Refine
Implements
BaseResponseBuilder
Constructors
constructor
• new Refine(serviceContext
, textQATemplate?
, refineTemplate?
)
Parameters
Name | Type |
---|---|
serviceContext | ServiceContext |
textQATemplate? | (__namedParameters : Object ) => string |
refineTemplate? | (__namedParameters : Object ) => string |
Defined in
Properties
refineTemplate
• refineTemplate: (__namedParameters
: Object
) => string
Type declaration
▸ («destructured»
): string
Parameters
Name | Type |
---|---|
«destructured» | Object |
Returns
string
Defined in
serviceContext
• serviceContext: ServiceContext
Defined in
textQATemplate
• textQATemplate: (__namedParameters
: Object
) => string
Type declaration
▸ («destructured»
): string
Parameters
Name | Type |
---|---|
«destructured» | Object |
Returns
string
Defined in
Methods
getResponse
▸ getResponse(query
, textChunks
, parentEvent?
, prevResponse?
): Promise
<string
>
Parameters
Name | Type |
---|---|
query | string |
textChunks | string [] |
parentEvent? | Event |
prevResponse? | string |
Returns
Promise
<string
>
Implementation of
BaseResponseBuilder.getResponse
Defined in
giveResponseSingle
▸ Private
giveResponseSingle(queryStr
, textChunk
, parentEvent?
): Promise
<string
>
Parameters
Name | Type |
---|---|
queryStr | string |
textChunk | string |
parentEvent? | Event |
Returns
Promise
<string
>
Defined in
refineResponseSingle
▸ Private
refineResponseSingle(response
, queryStr
, textChunk
, parentEvent?
): Promise
<string
>
Parameters
Name | Type |
---|---|
response | string |
queryStr | string |
textChunk | string |
parentEvent? | Event |
Returns
Promise
<string
>