Skip to content

Commit 7434165

Browse files
authored
Update index.js
1 parent 80c95f9 commit 7434165

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ io.on('connection', async (socket) => {
4949
// Read system text from file asynchronously
5050
const systemText = await readSystemTextFromFile("systemi.txt");
5151
// let systemText = "";
52-
const systemInstruction = { role: "system", parts: [{ text: systemText }] };
52+
const systemInstruction = { role: "system", parts: [{ text: systemText }] };
5353

5454
const model = genAI.getGenerativeModel({ model: "gemini-1.5-pro-latest", systemInstruction, generationConfig, safetySettings }, { apiVersion });
5555
const chat = model.startChat({});
@@ -60,8 +60,8 @@ io.on('connection', async (socket) => {
6060
const result = await chat.sendMessage(prompt);
6161
const response = await result.response;
6262
console.log('Response received');
63-
// console.log(util.inspect(response.candidates, {showHidden: false, depth: null, colors: true}))
64-
const output = response.text();
63+
// console.log(util.inspect(response.candidates, {showHidden: false, depth: null, colors: true}))
64+
const output = response.text();
6565
socket.emit('response', output);
6666
} catch (err) {
6767
console.error(err);
@@ -103,4 +103,4 @@ function printChatNicely(chatHistory) {
103103

104104
server.listen(3000, () => {
105105
console.log('Server listening on port 3000');
106-
});
106+
});

0 commit comments

Comments
 (0)