Skip to main content

Class: ResponseSynthesizer

A ResponseSynthesizer is used to generate a response from a query and a list of nodes.

Extends

Implements

Constructors

new ResponseSynthesizer()

new ResponseSynthesizer(__namedParameters): ResponseSynthesizer

Parameters

__namedParameters = {}

__namedParameters.metadataMode?: MetadataMode = MetadataMode.NONE

__namedParameters.responseBuilder?: ResponseBuilder

__namedParameters.serviceContext?: ServiceContext

Returns

ResponseSynthesizer

Overrides

PromptMixin.constructor

Defined in

packages/llamaindex/src/synthesizers/ResponseSynthesizer.ts:22

Properties

metadataMode

metadataMode: MetadataMode

Defined in

packages/llamaindex/src/synthesizers/ResponseSynthesizer.ts:20


responseBuilder

responseBuilder: ResponseBuilder

Defined in

packages/llamaindex/src/synthesizers/ResponseSynthesizer.ts:19

Methods

_getPromptModules()

_getPromptModules(): object

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

object

Implementation of

BaseSynthesizer._getPromptModules

Overrides

PromptMixin._getPromptModules

Defined in

packages/llamaindex/src/synthesizers/ResponseSynthesizer.ts:38


_getPrompts()

protected _getPrompts(): object

Returns

object

Implementation of

BaseSynthesizer._getPrompts

Overrides

PromptMixin._getPrompts

Defined in

packages/llamaindex/src/synthesizers/ResponseSynthesizer.ts:42


_updatePrompts()

protected _updatePrompts(promptsRecord): void

Parameters

promptsRecord: PromptsRecord

Returns

void

Implementation of

BaseSynthesizer._updatePrompts

Overrides

PromptMixin._updatePrompts

Defined in

packages/llamaindex/src/synthesizers/ResponseSynthesizer.ts:49


getPrompts()

getPrompts(): PromptsRecord

Returns

PromptsRecord

Implementation of

BaseSynthesizer.getPrompts

Inherited from

PromptMixin.getPrompts

Defined in

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


synthesize()

synthesize(query, stream)

synthesize(query, stream): Promise<AsyncIterable<EngineResponse>>

Parameters

query: SynthesizeQuery

stream: true

Returns

Promise<AsyncIterable<EngineResponse>>

Implementation of

BaseSynthesizer.synthesize

Defined in

packages/llamaindex/src/synthesizers/ResponseSynthesizer.ts:53

synthesize(query, stream)

synthesize(query, stream?): Promise<EngineResponse>

Parameters

query: SynthesizeQuery

stream?: false

Returns

Promise<EngineResponse>

Implementation of

BaseSynthesizer.synthesize

Defined in

packages/llamaindex/src/synthesizers/ResponseSynthesizer.ts:57


updatePrompts()

updatePrompts(prompts): void

Parameters

prompts: PromptsRecord

Returns

void

Implementation of

BaseSynthesizer.updatePrompts

Inherited from

PromptMixin.updatePrompts

Defined in

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


validatePrompts()

validatePrompts(promptsDict, moduleDict): void

Parameters

promptsDict: PromptsRecord

moduleDict: ModuleRecord

Returns

void

Implementation of

BaseSynthesizer.validatePrompts

Inherited from

PromptMixin.validatePrompts

Defined in

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