PromptTemplate
Defined in: .build/typescript/packages/core/src/prompts/base.ts:159
Extends
Section titled “Extends”BasePromptTemplate<TemplatesVar,Vars>
Type Parameters
Section titled “Type Parameters”TemplatesVar
Section titled “TemplatesVar”TemplatesVar extends readonly string[] = string[]
Vars extends readonly string[] = string[]
Template
Section titled “Template”Template extends StringTemplate<TemplatesVar> = StringTemplate<TemplatesVar>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PromptTemplate<
TemplatesVar,Vars,Template>(options):PromptTemplate<TemplatesVar,Vars,Template>
Defined in: .build/typescript/packages/core/src/prompts/base.ts:168
Parameters
Section titled “Parameters”options
Section titled “options”PromptTemplateOptions<TemplatesVar, Vars, Template>
Returns
Section titled “Returns”PromptTemplate<TemplatesVar, Vars, Template>
Overrides
Section titled “Overrides”BasePromptTemplate.constructor
Properties
Section titled “Properties”metadata
Section titled “metadata”metadata:
Metadata={}
Defined in: .build/typescript/packages/core/src/prompts/base.ts:34
Inherited from
Section titled “Inherited from”templateVars
Section titled “templateVars”templateVars:
Set<string>
Defined in: .build/typescript/packages/core/src/prompts/base.ts:39
Set of template variables used in the prompt template. Used for type hints only.
To get the list of template variables used in the prompt at run-time, use the vars method.
Inherited from
Section titled “Inherited from”BasePromptTemplate.templateVars
options
Section titled “options”options:
Partial<Record<TemplatesVar[number] |string&object,string>> ={}
Defined in: .build/typescript/packages/core/src/prompts/base.ts:40
Inherited from
Section titled “Inherited from”outputParser
Section titled “outputParser”outputParser:
undefined|BaseOutputParser<any>
Defined in: .build/typescript/packages/core/src/prompts/base.ts:41
Inherited from
Section titled “Inherited from”BasePromptTemplate.outputParser
templateVarMappings
Section titled “templateVarMappings”templateVarMappings:
Partial<Record<Vars[number] |string&object,TemplatesVar[number] |string&object>> ={}
Defined in: .build/typescript/packages/core/src/prompts/base.ts:42
Inherited from
Section titled “Inherited from”BasePromptTemplate.templateVarMappings
functionMappings
Section titled “functionMappings”functionMappings:
Partial<Record<TemplatesVar[number] |string&object,MappingFn>> ={}
Defined in: .build/typescript/packages/core/src/prompts/base.ts:45
Inherited from
Section titled “Inherited from”BasePromptTemplate.functionMappings
promptType
Section titled “promptType”promptType:
"custom"|"pandas"|"summary"|"insert"|"tree_select"|"tree_select_multiple"|"text_qa"|"refine"|"keyword_extract"|"query_keyword_extract"|"schema_extract"|"text_to_sql"|"text_to_graph_query"|"table_context"|"knowledge_triplet_extract"|"simple_input"|"json_path"|"single_select"|"multi_select"|"vector_store_query"|"sub_question"|"sql_response_synthesis"|"sql_response_synthesis_v2"|"conversation"|"decompose"|"choice_select"|"rankgpt_rerank"
Defined in: .build/typescript/packages/core/src/prompts/base.ts:166
Accessors
Section titled “Accessors”template
Section titled “template”Get Signature
Section titled “Get Signature”get template():
Template
Defined in: .build/typescript/packages/core/src/prompts/base.ts:227
Returns
Section titled “Returns”Template
Overrides
Section titled “Overrides”Methods
Section titled “Methods”mapTemplateVars()
Section titled “mapTemplateVars()”
protectedmapTemplateVars(options):object
Defined in: .build/typescript/packages/core/src/prompts/base.ts:77
Parameters
Section titled “Parameters”options
Section titled “options”Record<TemplatesVar[number] | string & object, string>
Returns
Section titled “Returns”object
Inherited from
Section titled “Inherited from”BasePromptTemplate.mapTemplateVars
mapFunctionVars()
Section titled “mapFunctionVars()”
protectedmapFunctionVars(options):Record<TemplatesVar[number],string>
Defined in: .build/typescript/packages/core/src/prompts/base.ts:86
Parameters
Section titled “Parameters”options
Section titled “options”Record<TemplatesVar[number] | string & object, string>
Returns
Section titled “Returns”Record<TemplatesVar[number], string>
Inherited from
Section titled “Inherited from”BasePromptTemplate.mapFunctionVars
mapAllVars()
Section titled “mapAllVars()”
protectedmapAllVars(options):Record<string,string>
Defined in: .build/typescript/packages/core/src/prompts/base.ts:104
Parameters
Section titled “Parameters”options
Section titled “options”Record<TemplatesVar[number] | string & object, string>
Returns
Section titled “Returns”Record<string, string>
Inherited from
Section titled “Inherited from”partialFormat()
Section titled “partialFormat()”partialFormat(
options):PromptTemplate<TemplatesVar,Vars,Template>
Defined in: .build/typescript/packages/core/src/prompts/base.ts:175
Parameters
Section titled “Parameters”options
Section titled “options”Partial<Record<TemplatesVar[number] | string & object, string>>
Returns
Section titled “Returns”PromptTemplate<TemplatesVar, Vars, Template>
Overrides
Section titled “Overrides”BasePromptTemplate.partialFormat
format()
Section titled “format()”format(
options?):string
Defined in: .build/typescript/packages/core/src/prompts/base.ts:197
Parameters
Section titled “Parameters”options?
Section titled “options?”Partial<Record<string & object | TemplatesVar[number], string>>
Returns
Section titled “Returns”string
Overrides
Section titled “Overrides”formatMessages()
Section titled “formatMessages()”formatMessages(
options?):ChatMessage[]
Defined in: .build/typescript/packages/core/src/prompts/base.ts:215
Parameters
Section titled “Parameters”options?
Section titled “options?”Partial<Record<string & object | TemplatesVar[number], string>>
Returns
Section titled “Returns”Overrides
Section titled “Overrides”BasePromptTemplate.formatMessages
vars()
Section titled “vars()”vars():
string[]
Defined in: .build/typescript/packages/core/src/prompts/base.ts:234
Returns all the template variables used in the prompt template.
Returns
Section titled “Returns”string[]