Skip to main content

Class: CompactAndRefine

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

Extends

Constructors

new CompactAndRefine()

new CompactAndRefine(serviceContext?, textQATemplate?, refineTemplate?): CompactAndRefine

Parameters

serviceContext?: ServiceContext

textQATemplate?: TextQAPrompt

refineTemplate?: RefinePrompt

Returns

CompactAndRefine

Inherited from

Refine.constructor

Defined in

packages/llamaindex/src/synthesizers/builders.ts:95

Properties

llm

llm: LLM<object, object>

Inherited from

Refine.llm

Defined in

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


promptHelper

promptHelper: PromptHelper

Inherited from

Refine.promptHelper

Defined in

packages/llamaindex/src/synthesizers/builders.ts:91


refineTemplate

refineTemplate: RefinePrompt

Inherited from

Refine.refineTemplate

Defined in

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


textQATemplate

textQATemplate: TextQAPrompt

Inherited from

Refine.textQATemplate

Defined in

packages/llamaindex/src/synthesizers/builders.ts:92

Methods

_getPromptModules()

protected _getPromptModules(): ModuleRecord

Return a dictionary of sub-modules within the current module that also implement PromptMixin (so that their prompts can also be get/set).

Can be blank if no sub-modules.

Returns

ModuleRecord

Inherited from

Refine._getPromptModules

Defined in

packages/llamaindex/src/synthesizers/builders.ts:108


_getPrompts()

protected _getPrompts(): object

Returns

object

refineTemplate

refineTemplate: RefinePrompt

textQATemplate

textQATemplate: TextQAPrompt

Inherited from

Refine._getPrompts

Defined in

packages/llamaindex/src/synthesizers/builders.ts:112


_updatePrompts()

protected _updatePrompts(prompts): void

Parameters

prompts

prompts.refineTemplate: RefinePrompt

prompts.textQATemplate: TextQAPrompt

Returns

void

Inherited from

Refine._updatePrompts

Defined in

packages/llamaindex/src/synthesizers/builders.ts:122


complete()

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

Parameters

params

params.prompt: string

params.stream: boolean

Returns

Promise<string | AsyncIterable<string, any, any>>

Inherited from

Refine.complete

Defined in

packages/llamaindex/src/synthesizers/builders.ts:232


getPrompts()

getPrompts(): PromptsRecord

Returns

PromptsRecord

Inherited from

Refine.getPrompts

Defined in

packages/core/dist/prompts/index.d.ts:58


getResponse()

getResponse(query, stream)

getResponse(query, stream): Promise<AsyncIterable<string, any, any>>

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

Parameters

query: ResponseBuilderQuery

stream: true

Returns

Promise<AsyncIterable<string, any, any>>

Overrides

Refine.getResponse

Defined in

packages/llamaindex/src/synthesizers/builders.ts:250

getResponse(query, stream)

getResponse(query, stream?): Promise<string>

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

Parameters

query: ResponseBuilderQuery

stream?: false

Returns

Promise<string>

Overrides

Refine.getResponse

Defined in

packages/llamaindex/src/synthesizers/builders.ts:254


updatePrompts()

updatePrompts(prompts): void

Parameters

prompts: PromptsRecord

Returns

void

Inherited from

Refine.updatePrompts

Defined in

packages/core/dist/prompts/index.d.ts:59


validatePrompts()

validatePrompts(promptsDict, moduleDict): void

Parameters

promptsDict: PromptsRecord

moduleDict: ModuleRecord

Returns

void

Inherited from

Refine.validatePrompts

Defined in

packages/core/dist/prompts/index.d.ts:57