Update lib/@randydev/together/cohere.js
Browse files
lib/@randydev/together/cohere.js
CHANGED
@@ -4,12 +4,13 @@ const cohere = new CohereClient({
|
|
4 |
token: process.env["COHERE_API_KEY"],
|
5 |
});
|
6 |
|
7 |
-
async function CohereAI(message) {
|
8 |
const stream = await cohere.chatStream({
|
9 |
model: "command-r-08-2024",
|
10 |
message: `${message}`,
|
11 |
temperature: 0.3,
|
12 |
chatHistory: [],
|
|
|
13 |
promptTruncation: "AUTO"
|
14 |
});
|
15 |
let answer = "";
|
|
|
4 |
token: process.env["COHERE_API_KEY"],
|
5 |
});
|
6 |
|
7 |
+
async function CohereAI(message, { system_prompt = ""} = {}) {
|
8 |
const stream = await cohere.chatStream({
|
9 |
model: "command-r-08-2024",
|
10 |
message: `${message}`,
|
11 |
temperature: 0.3,
|
12 |
chatHistory: [],
|
13 |
+
preamble: `${system_prompt}`,
|
14 |
promptTruncation: "AUTO"
|
15 |
});
|
16 |
let answer = "";
|