Zum Hauptinhalt springen

Class: CompactAndRefine

CompactAndRefine is a slight variation of Refine that first compacts the text chunks into the smallest possible number of chunks.

Hierarchy

Constructors

constructor

new CompactAndRefine(serviceContext, textQATemplate?, refineTemplate?)

Parameters

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

Inherited from

Refine.constructor

Defined in

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

Properties

llm

llm: LLM

Inherited from

Refine.llm

Defined in

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


promptHelper

promptHelper: PromptHelper

Inherited from

Refine.promptHelper

Defined in

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


refineTemplate

refineTemplate: (__namedParameters: Object) => string

Type declaration

▸ («destructured»): string

Parameters
NameType
«destructured»Object
Returns

string

Inherited from

Refine.refineTemplate

Defined in

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


textQATemplate

textQATemplate: (__namedParameters: Object) => string

Type declaration

▸ («destructured»): string

Parameters
NameType
«destructured»Object
Returns

string

Inherited from

Refine.textQATemplate

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>>

Inherited from

Refine.complete

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>>

Overrides

Refine.getResponse

Defined in

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

getResponse(params): Promise<string>

Parameters

NameType
paramsResponseBuilderParamsNonStreaming

Returns

Promise<string>

Overrides

Refine.getResponse

Defined in

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