diff --git a/src/Providers/ChatCompletion/ChatBotRu.js b/src/Providers/ChatCompletion/ChatBotRu.js deleted file mode 100644 index e7a6aeb..0000000 --- a/src/Providers/ChatCompletion/ChatBotRu.js +++ /dev/null @@ -1,54 +0,0 @@ -// not working -"use strict"; -import Provider from "./provider.js"; -import baseHeaders from "../../Utils/baseHeaders.js"; -import startStreaming from "../../Utils/stream.js"; - -class ChatBotRuProvider extends Provider { - async chatCompletion(messages, options, onData) { - try { - const models = { - "gpt-4o": "gpt-4o-2024-05-13", - "gpt-4": "gpt-4-32k", - "gpt-4-turbo": "gpt-4-32k-0613", - }; - - const model = models[options.model] || models["gpt-4o"]; - - const response = await fetch( - "https://gpt-chatbotru-chat-main.ru/api/openai/v1/chat/completions", - { - headers: baseHeaders( - "https://gpt-chatbotru-chat-main.ru/api/openai/v1/chat/completions" - ), - body: JSON.stringify({ - messages: messages, - stream: options.stream || false, - model: model, - temperature: options.temperature || 0.5, - presence_penalty: options.presence_penalty || 0, - frequency_penalty: options.frequency_penalty || 0, - top_p: options.top_p || 1, - }), - method: "POST", - } - ); - - if (!response.ok) { - throw new Error(`Network response was not ok: ${response.status}`); - } - - if (options.stream === true) { - await startStreaming(response, onData); - } else { - const responseData = await response.text(); - console.log(responseData); - } - } catch (error) { - console.error("Error:", error); - throw error; - } - } -} - -export default ChatBotRuProvider; diff --git a/src/providers.js b/src/providers.js index e3f2675..169dc66 100644 --- a/src/providers.js +++ b/src/providers.js @@ -5,7 +5,6 @@ import NextwayProvider from "./Providers/ChatCompletion/Nextway.js"; import ChromeProvider from "./Providers/ChatCompletion/Chrome.js"; import OllamaProvider from "./Providers/ChatCompletion/Ollama.js"; import AlibabaProvider from "./Providers/ChatCompletion/Alibaba.js"; -import ChatBotRuProvider from "./Providers/ChatCompletion/ChatBotRu.js"; import DALLE2Provider from "./Providers/ImageGeneration/DALLE.js"; import StableDiffusionProvider from "./Providers/ImageGeneration/StableDiffusion.js"; @@ -17,9 +16,8 @@ const PROVIDERS = { Chrome: ChromeProvider, Ollama: OllamaProvider, Alibaba: AlibabaProvider, - ChatBotRu: ChatBotRuProvider, DALLE2: DALLE2Provider, - StableDiffusion: StableDiffusionProvider + StableDiffusion: StableDiffusionProvider, }; class GPT4js {