Skip to content
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

Commit 4d962bd

Browse files
committed
lazy load CustomChatPromptTemplate
1 parent 23e33ef commit 4d962bd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/prompt-engineering/prompt.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66

77
import { API } from '../api';
88
import { DatasetItem } from '../evaluation/dataset';
9-
import { CustomChatPromptTemplate } from '../instrumentation/langchain';
109
import {
1110
GenerationType,
1211
IGenerationMessage
@@ -133,6 +132,10 @@ export class Prompt extends PromptFields {
133132
* @returns A custom chat prompt template configured with the prompt's data.
134133
*/
135134
toLangchainChatPromptTemplate() {
135+
const {
136+
CustomChatPromptTemplate
137+
// eslint-disable-next-line @typescript-eslint/no-var-requires
138+
} = require('../instrumentation/langchain');
136139
const lcMessages: [string, string][] = this.templateMessages.map((m) => [
137140
m.role,
138141
m.content as string

0 commit comments

Comments
 (0)