Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
lmangani authored Dec 14, 2024
1 parent 9bc76d2 commit fb80824
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,7 @@ app.post("/", async (c) => {
const messages = payload.messages;
messages.unshift({
role: "system",
content: "You are a helpful assistant specialized in DuckDB SQL. You convert user prompts to valid DuckDB SQL queries. You only know and use DuckDB SQL and no other database exists.",
});
messages.unshift({
role: "system",
content: `You exclusively respond with valid DuckDB SQL commands, ready to execute without any comments or context attached.`,
content: "You are a helpful assistant specialized in DuckDB SQL. You convert user prompts to valid DuckDB SQL queries. You respond with SQL only without any commentary.",
});

// Use Copilot's LLM to generate a response to the user's messages, with
Expand Down Expand Up @@ -233,13 +229,11 @@ async function streamToString(stream: ReadableStream | NodeJS.ReadableStream): P
if (typeof stream.on === 'function') {
return new Promise((resolve, reject) => {
const chunks: Buffer[] = [];

stream.on('data', (chunk: Buffer) => chunks.push(Buffer.from(chunk)));
stream.on('error', (err) => reject(err));
stream.on('end', () => resolve(Buffer.concat(chunks).toString('utf-8')));
});
}

throw new Error('Unsupported stream type');
}

Expand Down

0 comments on commit fb80824

Please sign in to comment.