From 6fd4196aebc84c206b0ce3da89e30b1d4313ab08 Mon Sep 17 00:00:00 2001 From: "KOUSHIK.OG" <154724597+iscordian@users.noreply.github.com> Date: Tue, 23 Jan 2024 14:05:03 +0530 Subject: [PATCH] Update rsnchat.js --- build/rsnchat.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/build/rsnchat.js b/build/rsnchat.js index 6032255..bc17553 100644 --- a/build/rsnchat.js +++ b/build/rsnchat.js @@ -5,6 +5,7 @@ const OpenChat_ApiUrl = "https://ai.rnilaweera.ovh/api/v1/user/openchat"; const Bard_ApiUrl = "https://ai.rnilaweera.ovh/api/v1/user/bard"; const Gemini_ApiUrl = "https://ai.rnilaweera.ovh/api/v1/user/gemini"; const LlamaApiUrl = "https://ai.rnilaweera.ovh/api/v1/user/llama"; +const CodeLlamaApiUrl = "https://ai.rnilaweera.ovh/api/v1/user/codellama"; const MixtralApiUrl = "https://ai.rnilaweera.ovh/api/v1/user/mixtral"; const ProdiaApiUrl = "https://ai.rnilaweera.ovh/api/v1/user/prodia"; @@ -135,6 +136,25 @@ class RsnChat { throw new Error(`RsnChat Mixtral Error: ${error}`); } } + + async codellama(prompt) { + try { + const payload = { + prompt: prompt, + }; + + const authHeader = `Bearer ${this.apiKey}`; + + const headers = { + Authorization: authHeader, + }; + + const response = await axios.post(CodeLlamaApiUrl, payload, { headers }); + return response.data; + } catch (error) { + throw new Error(`RsnChat CodeLlaMa Error: ${error}`); + } + } async prodia(prompt, negative_prompt, model) { try {