انتقل إلى المحتوى الرئيسي

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?): Refine

Parameters

NameType
serviceContextServiceContext
textQATemplate?(__namedParameters: { context: undefined | string = ""; query: undefined | string = "" }) => string
refineTemplate?(__namedParameters: { context: undefined | string = ""; existingAnswer: undefined | string = ""; query: undefined | string = "" }) => string

Returns

Refine

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: { context: undefined | string = ""; existingAnswer: undefined | string = ""; query: undefined | string = "" }) => string

Type declaration

▸ («destructured»): string

Parameters
NameTypeDefault value
«destructured»Objectundefined
› contextundefined | string""
› existingAnswerundefined | string""
› queryundefined | string""
Returns

string

Defined in

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


textQATemplate

textQATemplate: (__namedParameters: { context: undefined | string = ""; query: undefined | string = "" }) => string

Type declaration

▸ («destructured»): string

Parameters
NameTypeDefault value
«destructured»Objectundefined
› contextundefined | string""
› queryundefined | string""
Returns

string

Defined in

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

Methods

complete

complete(params): Promise<string | AsyncIterable<string>>

Parameters

NameType
paramsObject
params.parentEvent?Event
params.promptstring
params.streamboolean

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

NameType
paramsResponseBuilderParamsStreaming

Returns

Promise<AsyncIterable<string>>

Implementation of

ResponseBuilder.getResponse

Defined in

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

getResponse(params): Promise<string>

Parameters

NameType
paramsResponseBuilderParamsNonStreaming

Returns

Promise<string>

Implementation of

ResponseBuilder.getResponse

Defined in

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


giveResponseSingle

giveResponseSingle(queryStr, textChunk, stream, parentEvent?): Promise<undefined | string | AsyncIterable<string>>

Parameters

NameType
queryStrstring
textChunkstring
streamboolean
parentEvent?Event

Returns

Promise<undefined | string | AsyncIterable<string>>

Defined in

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


refineResponseSingle

refineResponseSingle(initialReponse, queryStr, textChunk, stream, parentEvent?): Promise<string | AsyncIterable<string>>

Parameters

NameType
initialReponsestring
queryStrstring
textChunkstring
streamboolean
parentEvent?Event

Returns

Promise<string | AsyncIterable<string>>

Defined in

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