@@ -49,7 +49,7 @@ io.on('connection', async (socket) => {
49
49
// Read system text from file asynchronously
50
50
const systemText = await readSystemTextFromFile ( "systemi.txt" ) ;
51
51
// let systemText = "";
52
- const systemInstruction = { role : "system" , parts : [ { text : systemText } ] } ;
52
+ const systemInstruction = { role : "system" , parts : [ { text : systemText } ] } ;
53
53
54
54
const model = genAI . getGenerativeModel ( { model : "gemini-1.5-pro-latest" , systemInstruction, generationConfig, safetySettings } , { apiVersion } ) ;
55
55
const chat = model . startChat ( { } ) ;
@@ -60,8 +60,8 @@ io.on('connection', async (socket) => {
60
60
const result = await chat . sendMessage ( prompt ) ;
61
61
const response = await result . response ;
62
62
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 ( ) ;
65
65
socket . emit ( 'response' , output ) ;
66
66
} catch ( err ) {
67
67
console . error ( err ) ;
@@ -103,4 +103,4 @@ function printChatNicely(chatHistory) {
103
103
104
104
server . listen ( 3000 , ( ) => {
105
105
console . log ( 'Server listening on port 3000' ) ;
106
- } ) ;
106
+ } ) ;
0 commit comments