From cf723fbf99ce648cb737403d7d40ad218b1cbbdf Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Thu, 21 Sep 2023 11:20:54 -0300 Subject: [PATCH] fix(whatsapp.gblib): Fix in sending numbers with plus sign. --- packages/gpt.gblib/services/ChatServices.ts | 36 ++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/gpt.gblib/services/ChatServices.ts b/packages/gpt.gblib/services/ChatServices.ts index 92825670..4a27b772 100644 --- a/packages/gpt.gblib/services/ChatServices.ts +++ b/packages/gpt.gblib/services/ChatServices.ts @@ -33,7 +33,7 @@ 'use strict'; import { GBMinInstance } from 'botlib'; -import OpenAI from "openai"; +//import OpenAI from "openai"; import { ChatGPTAPIBrowser, getOpenAIAuth } from 'chatgpt' import { CollectionUtil } from 'pragmatismo-io-framework'; import { DialogKeywords } from '../../basic.gblib/services/DialogKeywords'; @@ -71,15 +71,15 @@ export class ChatServices { // Calls Model. - const openai = new OpenAI({ - apiKey: key - }); - const chatCompletion = await openai.chat.completions.create({ - model: "gpt-3.5-turbo", - messages: [{ role: "user", content: text }], - functions: functions - }); - return chatCompletion.choices[0].message.content; + // const openai = new OpenAI({ + // apiKey: key + // }); + // const chatCompletion = await openai.chat.completions.create({ + // model: "gpt-3.5-turbo", + // messages: [{ role: "user", content: text }], + // functions: functions + // }); + // return chatCompletion.choices[0].message.content; } @@ -104,14 +104,14 @@ export class ChatServices { if (!key) { throw new Error('Open AI Key not configured in .gbot.'); } - const openai = new OpenAI({ - apiKey: key - }); - const chatCompletion = await openai.chat.completions.create({ - model: "gpt-3.5-turbo", - messages: [{ role: "user", content: text }] + // const openai = new OpenAI({ + // apiKey: key + // }); + // const chatCompletion = await openai.chat.completions.create({ + // model: "gpt-3.5-turbo", + // messages: [{ role: "user", content: text }] - }); - return chatCompletion.choices[0].message.content; + // }); + // return chatCompletion.choices[0].message.content; } }