Skip to main content

Class: abstract BasePromptTemplate<TemplatesVar, Vars>

Extended by

Type Parameters

TemplatesVar extends readonly string[] = string[]

Vars extends readonly string[] = string[]

Constructors

new BasePromptTemplate()

protected new BasePromptTemplate<TemplatesVar, Vars>(options): BasePromptTemplate<TemplatesVar, Vars>

Parameters

options: BasePromptTemplateOptions<TemplatesVar, Vars>

Returns

BasePromptTemplate<TemplatesVar, Vars>

Defined in

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

Properties

functionMappings

functionMappings: Partial<Record<string & object | TemplatesVar[number], MappingFn<string[]>>>

Defined in

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


metadata

metadata: Metadata

Defined in

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


options

options: Partial<Record<string & object | TemplatesVar[number], string>>

Defined in

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


outputParser

outputParser: undefined | BaseOutputParser<any>

Defined in

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


templateVarMappings

templateVarMappings: Partial<Record<string & object | Vars[number], string & object | TemplatesVar[number]>>

Defined in

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


templateVars

templateVars: Set<string>

Defined in

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

Accessors

template

get abstract template(): string

Returns

string

Defined in

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

Methods

format()

abstract format(options?): string

Parameters

options?: Partial<Record<string & object | TemplatesVar[number], string>>

Returns

string

Defined in

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


formatMessages()

abstract formatMessages(options?): ChatMessage[]

Parameters

options?: Partial<Record<string & object | TemplatesVar[number], string>>

Returns

ChatMessage[]

Defined in

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


mapAllVars()

protected mapAllVars(options): Record<string, string>

Parameters

options: Record<string & object | TemplatesVar[number], string>

Returns

Record<string, string>

Defined in

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


mapFunctionVars()

protected mapFunctionVars(options): Record<TemplatesVar[number], string>

Parameters

options: Record<string & object | TemplatesVar[number], string>

Returns

Record<TemplatesVar[number], string>

Defined in

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


mapTemplateVars()

protected mapTemplateVars(options): object

Parameters

options: Record<string & object | TemplatesVar[number], string>

Returns

object

Defined in

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


partialFormat()

abstract partialFormat(options): BasePromptTemplate<TemplatesVar, Vars>

Parameters

options: Partial<Record<string & object | TemplatesVar[number], string>>

Returns

BasePromptTemplate<TemplatesVar, Vars>

Defined in

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