From 584efd27e592c0c4c2c484d54bb438db70e20900 Mon Sep 17 00:00:00 2001 From: Lluis Date: Sat, 16 Nov 2024 17:55:21 +0100 Subject: [PATCH] add current date in spanish --- services/openAI.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/services/openAI.js b/services/openAI.js index 23dab46..022df39 100644 --- a/services/openAI.js +++ b/services/openAI.js @@ -1,7 +1,8 @@ const config = require('../config') -const { AzureOpenAI } = require('openai'); -const moment = require("moment"); - +const { AzureOpenAI } = require('openai') +const moment = require('moment') +require('moment/locale/es') +moment.locale('es') const getClient = () => { const assistantsClient = new AzureOpenAI({ @@ -100,14 +101,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')}` } );