Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lluisd committed Nov 16, 2024
2 parents be8b859 + 584efd2 commit 8062a53
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions services/openAI.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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')}`
}
);

Expand Down

0 comments on commit 8062a53

Please sign in to comment.