diff --git a/langchain-core/src/prompts/chat.ts b/langchain-core/src/prompts/chat.ts index ed864856f671..3308325a1b77 100644 --- a/langchain-core/src/prompts/chat.ts +++ b/langchain-core/src/prompts/chat.ts @@ -336,13 +336,13 @@ export class ChatMessagePromptTemplate< return new ChatMessage(await this.prompt.format(values), this.role); } - static fromTemplate( - template: string, - role: string, - options?: { templateFormat?: TemplateFormat } - ) { + static fromTemplate< + // eslint-disable-next-line @typescript-eslint/ban-types + RunInput extends InputValues = Symbol, + T extends string = string + >(template: T, role: string, options?: { templateFormat?: TemplateFormat }) { return new this( - PromptTemplate.fromTemplate(template, { + PromptTemplate.fromTemplate(template, { templateFormat: options?.templateFormat, }), role