From 8a4ccfaec5539e321ac5ba2ad45e371cabcdd4e8 Mon Sep 17 00:00:00 2001 From: Rstacx Date: Tue, 20 Feb 2024 05:37:08 +0000 Subject: [PATCH] added: naomi --- README.md | 14 +++++++++++++- build/cjs/index.cjs | 31 +++++++++++++++++++++++++++++++ build/esm/index.js | 31 +++++++++++++++++++++++++++++++ package.json | 4 ++-- src/index.ts | 30 ++++++++++++++++++++++++++++++ types/index.d.ts | 16 ++++++++++++++++ 6 files changed, 123 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bf64ddc..8384f33 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # rsnchat -This package package for interacting with GPT4-based chat services, OpenChat, Bard, Gemini, LlaMa, Mixtral, Claude, Prodia, Kandinsky, Absolutebeauty, Sdxl, Dalle and AI Icon without restrictions or limits +This package package for interacting with GPT4-based chat services, OpenChat, Bard, Gemini, LlaMa, Mixtral, Claude, Naomi, Prodia, Kandinsky, Absolutebeauty, Sdxl, Dalle and AI Icon without restrictions or limits ## Installation @@ -130,6 +130,18 @@ rsnchat.claude("Hello, what is your name?").then((response) => { }); ``` +## Usage Naomi (ai girlfriend) (premium) + +```javascript +const { RsnChat } = require("rsnchat"); + +const rsnchat = new RsnChat("rsnai_××××××××××××××××××××××"); + +rsnchat.naomi("Hello, what is your name?").then((response) => { + console.log(response.message); +}); +``` + ## Usage Prodia ```javascript diff --git a/build/cjs/index.cjs b/build/cjs/index.cjs index 8518855..961e21f 100644 --- a/build/cjs/index.cjs +++ b/build/cjs/index.cjs @@ -302,6 +302,37 @@ class RsnChat { } }); } + /** + * Generate Text Completion via Naomi + * @param {string} prompt Naomi prompt + * @example + * ```js + * const { RsnChat } = require("rsnchat"); + * + * const rsnchat = new RsnChat("rsnai_××××××××××××××××××××××"); + * + * rsnchat.naomi("Hello, what is your name?").then((response) => { + * console.log(response.message); + * }); + * ``` + * @returns {Promise} + */ + naomi(prompt) { + return __awaiter(this, void 0, void 0, function* () { + try { + const payload = { + prompt: prompt, + }; + const response = yield axios_1.default.post(`${apiUrl}/naomi`, payload, { + headers: this.headers, + }); + return response.data; + } + catch (error) { + throw new Error(`RsnChat Naomi Error: ${error}`); + } + }); + } /** * Generate Text Completion via CodeLLaMa * @param {string} prompt CodeLlaMa prompt diff --git a/build/esm/index.js b/build/esm/index.js index 2a8d335..477b34e 100644 --- a/build/esm/index.js +++ b/build/esm/index.js @@ -296,6 +296,37 @@ class RsnChat { } }); } + /** + * Generate Text Completion via Naomi + * @param {string} prompt Naomi prompt + * @example + * ```js + * const { RsnChat } = require("rsnchat"); + * + * const rsnchat = new RsnChat("rsnai_××××××××××××××××××××××"); + * + * rsnchat.naomi("Hello, what is your name?").then((response) => { + * console.log(response.message); + * }); + * ``` + * @returns {Promise} + */ + naomi(prompt) { + return __awaiter(this, void 0, void 0, function* () { + try { + const payload = { + prompt: prompt, + }; + const response = yield axios.post(`${apiUrl}/naomi`, payload, { + headers: this.headers, + }); + return response.data; + } + catch (error) { + throw new Error(`RsnChat Naomi Error: ${error}`); + } + }); + } /** * Generate Text Completion via CodeLLaMa * @param {string} prompt CodeLlaMa prompt diff --git a/package.json b/package.json index 063b82a..45d05e8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "rsnchat", - "version": "3.0.7", - "description": "A package for interacting with GPT4-based chat services, OpenChat, Bard, Gemini, Bing, LlaMa, CodeLlama, Mixtral, Claude, Prodia, Kandinsky, Absolutebeauty, Sdxl, Dalle and AI Icon", + "version": "3.0.8", + "description": "A package for interacting with GPT4-based chat services, OpenChat, Bard, Gemini, Bing, LlaMa, CodeLlama, Mixtral, Claude, Naomi, Prodia, Kandinsky, Absolutebeauty, Sdxl, Dalle and AI Icon", "type": "module", "types": "./types/index.d.ts", "bin": { diff --git a/src/index.ts b/src/index.ts index 4476980..f57034f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -359,6 +359,36 @@ class RsnChat { throw new Error(`RsnChat Claude Error: ${error}`); } } + + /** + * Generate Text Completion via Naomi + * @param {string} prompt Naomi prompt + * @example + * ```js + * const { RsnChat } = require("rsnchat"); + * + * const rsnchat = new RsnChat("rsnai_××××××××××××××××××××××"); + * + * rsnchat.naomi("Hello, what is your name?").then((response) => { + * console.log(response.message); + * }); + * ``` + * @returns {Promise} + */ + async naomi(prompt: string): Promise { + try { + const payload = { + prompt: prompt, + }; + + const response = await axios.post(`${apiUrl}/naomi`, payload, { + headers: this.headers, + }); + return response.data as TextResult; + } catch (error) { + throw new Error(`RsnChat Naomi Error: ${error}`); + } + } /** * Generate Text Completion via CodeLLaMa diff --git a/types/index.d.ts b/types/index.d.ts index ae13de7..24ddd60 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -155,6 +155,22 @@ declare class RsnChat { * @returns {Promise} */ claude(prompt: string): Promise; + /** + * Generate Text Completion via Naomi + * @param {string} prompt Naomi prompt + * @example + * ```js + * const { RsnChat } = require("rsnchat"); + * + * const rsnchat = new RsnChat("rsnai_××××××××××××××××××××××"); + * + * rsnchat.naomi("Hello, what is your name?").then((response) => { + * console.log(response.message); + * }); + * ``` + * @returns {Promise} + */ + naomi(prompt: string): Promise; /** * Generate Text Completion via CodeLLaMa * @param {string} prompt CodeLlaMa prompt