Skip to content
Snippets Groups Projects
Unverified Commit 260d37a3 authored by Thuc Pham's avatar Thuc Pham Committed by GitHub
Browse files

feat(ts): add system prompt for chat engine (#92)

parent 7873bfb0
No related branches found
No related tags found
No related merge requests found
---
"create-llama": patch
---
Add system prompt env variable for TS
......@@ -249,13 +249,6 @@ const getFrameworkEnvs = (
description: "The port to start the backend app.",
value: port?.toString() || "8000",
},
// TODO: Once LlamaIndexTS supports string templates, move this to `getEngineEnvs`
{
name: "SYSTEM_PROMPT",
description: `Custom system prompt.
Example:
SYSTEM_PROMPT="You are a helpful assistant who helps users with their questions."`,
},
];
};
......@@ -267,6 +260,12 @@ const getEngineEnvs = (): EnvVar[] => {
"The number of similar embeddings to return when retrieving documents.",
value: "3",
},
{
name: "SYSTEM_PROMPT",
description: `Custom system prompt.
Example:
SYSTEM_PROMPT="You are a helpful assistant who helps users with their questions."`,
},
];
};
......
......@@ -41,5 +41,6 @@ export async function createChatEngine() {
return new OpenAIAgent({
tools,
systemPrompt: process.env.SYSTEM_PROMPT,
});
}
......@@ -16,5 +16,6 @@ export async function createChatEngine() {
return new ContextChatEngine({
chatModel: Settings.llm,
retriever,
systemPrompt: process.env.SYSTEM_PROMPT,
});
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment