randydev commited on
Commit
cbc0257
·
verified ·
1 Parent(s): 996be06

Update lib/@randydev/together/cohere.js

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