Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
loks0n committed Jan 17, 2025
2 parents 555dba7 + 3f874d0 commit 9c52062
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ app.post("/v1/models/assistant/prompt", async (req, res) => {
const decoder = new TextDecoder();
const text = decoder.decode(req.body);

let { prompt } = JSON.parse(text);
let { prompt, systemPrompt } = JSON.parse(text);
systemPrompt ??= SYSTEM_PROMPT;

const relevantDocuments = await retriever.getRelevantDocuments(prompt);

const chain = await getRagChain((token) => {
Expand Down Expand Up @@ -66,7 +68,8 @@ app.post("/v1/models/generic/prompt", async (req, res) => {
const decoder = new TextDecoder();
const text = decoder.decode(req.body);

let { prompt } = JSON.parse(text);
let { prompt, systemPrompt } = JSON.parse(text);
systemPrompt ??= SYSTEM_PROMPT;

const chain = await getOpenAIChat((token) => {
res.write(token);
Expand Down

0 comments on commit 9c52062

Please # to comment.