add multi prompt chain

This commit is contained in:
Henry
2023-05-25 00:36:09 +01:00
parent f2d8796920
commit 1d42456ba1
7 changed files with 609 additions and 1 deletions
+21
View File
@@ -103,3 +103,24 @@ export class PromptTemplate extends LangchainPromptTemplate {
super(input)
}
}
export interface PromptRetrieverInput {
name: string
description: string
systemMessage: string
}
const fixedTemplate = `Here is a question:
{input}
`
export class PromptRetriever {
name: string
description: string
systemMessage: string
constructor(fields: PromptRetrieverInput) {
this.name = fields.name
this.description = fields.description
this.systemMessage = `${fields.systemMessage}\n${fixedTemplate}`
}
}