Skip to content

Commit 7963089

Browse files
authored
Merge pull request #30 from appwrite/fix-system-prompt
fix: system prompt
2 parents 9618f50 + 315c8d4 commit 7963089

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/embeddings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const getOpenAIChat = async (onToken) =>
1919
new OpenAIChat({
2020
modelName: "gpt-4o",
2121
openAIApiKey: process.env._APP_ASSISTANT_OPENAI_API_KEY,
22-
temperature: 0.3,
22+
temperature: 0,
2323
maxTokens: 1000,
2424
streaming: true,
2525
callbacks: [

src/main.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ app.post("/v1/models/assistant/prompt", async (req, res) => {
4545

4646
await chain.call({
4747
input_documents: relevantDocuments,
48-
question: `${SYSTEM_PROMPT}\n\n${prompt}`,
48+
question: `${systemPrompt}\n\n${prompt}`,
4949
});
5050

5151
const sources = new Set(
@@ -75,7 +75,10 @@ app.post("/v1/models/generic/prompt", async (req, res) => {
7575
res.write(token);
7676
});
7777

78-
await chain.call(`${SYSTEM_PROMPT}\n\n${prompt}`);
78+
await chain.invoke([
79+
["system", systemPrompt],
80+
["human", prompt],
81+
])
7982

8083
res.end();
8184
});

0 commit comments

Comments
 (0)