diff --git a/services/openAI.js b/services/openAI.js index bd53631..edc3d2a 100644 --- a/services/openAI.js +++ b/services/openAI.js @@ -2,7 +2,8 @@ const config = require('../config') const { AzureOpenAI } = require('openai'); const moment = require("moment"); const TranscriptionsService = require('../services/transcriptions') - +require('moment/locale/es') +moment.locale('es') const getClient = () => { const assistantsClient = new AzureOpenAI({ @@ -103,14 +104,16 @@ async function askAssistant(message, username) { } ); + //const assistantResponse = await assistantsClient.beta.assistants.create(options); const assistantResponse = await assistantsClient.beta.assistants.retrieve(config.openAI.assistantId) // Run the thread and poll it until it is in a terminal state + moment.locale('es') const runResponse = await assistantsClient.beta.threads.runs.create( assistantThread.id, { assistant_id: assistantResponse.id, - additional_instructions: `Today's date: ${moment().tz('Europe/Madrid').format('MMMM Do YYYY, h:mm:ss a')}` + additional_instructions: `Fecha actual: ${moment().tz('Europe/Madrid').format('MMMM Do YYYY, h:mm:ss a')}` } );