Skip to main content

Class: Refine

A response builder that uses the query to ask the LLM generate a better response using multiple text chunks.

Hierarchy

Implements

Constructors

constructor

new Refine(serviceContext, textQATemplate?, refineTemplate?)

Parameters

NameType
serviceContextServiceContext
textQATemplate?(__namedParameters: Object) => string
refineTemplate?(__namedParameters: Object) => string

Defined in

packages/core/src/synthesizers/builders.ts:80

Properties

refineTemplate

refineTemplate: (__namedParameters: Object) => string

Type declaration

▸ («destructured»): string

Parameters
NameType
«destructured»Object
Returns

string

Defined in

packages/core/src/synthesizers/builders.ts:78


serviceContext

serviceContext: ServiceContext

Defined in

packages/core/src/synthesizers/builders.ts:76


textQATemplate

textQATemplate: (__namedParameters: Object) => string

Type declaration

▸ («destructured»): string

Parameters
NameType
«destructured»Object
Returns

string

Defined in

packages/core/src/synthesizers/builders.ts:77

Methods

getResponse

getResponse(query, textChunks, parentEvent?, prevResponse?): Promise<string>

Get the response from a query and a list of text chunks.

Parameters

NameType
querystring
textChunksstring[]
parentEvent?Event
prevResponse?string

Returns

Promise<string>

Implementation of

BaseResponseBuilder.getResponse

Defined in

packages/core/src/synthesizers/builders.ts:90


giveResponseSingle

Private giveResponseSingle(queryStr, textChunk, parentEvent?): Promise<string>

Parameters

NameType
queryStrstring
textChunkstring
parentEvent?Event

Returns

Promise<string>

Defined in

packages/core/src/synthesizers/builders.ts:115


refineResponseSingle

Private refineResponseSingle(response, queryStr, textChunk, parentEvent?): Promise<string>

Parameters

NameType
responsestring
queryStrstring
textChunkstring
parentEvent?Event

Returns

Promise<string>

Defined in

packages/core/src/synthesizers/builders.ts:151