UNPKG

on-codemerge

Version:

A WYSIWYG editor for on-codemerge is a user-friendly interface that allows users to edit and view their code in real time, exactly as it will appear in the final product

98 lines (97 loc) 2.83 kB
var m = Object.defineProperty; var n = (a, t, e) => t in a ? m(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e; var i = (a, t, e) => n(a, typeof t != "symbol" ? t + "" : t, e); class u { constructor(t) { i(this, "apiKey"); this.apiKey = t; } // Описание параметров для GitHub Azure getOptionsDescription() { return { model: { type: "list", label: "Model", options: [ "gpt-4o", "gpt-4o-mini", "Llama-3.2-90B-Vision-Instruct", "Ministral-3B", "Phi-3.5-MoE-instruct-128k", "Phi-3.5-mini-instruct-128k", "Phi-3.5-vision-instruct-128k", "Phi-3-medium-instruct-128k", "Phi-3-medium-instruct-4k", "Phi-3-mini-instruct-128k", "Phi-3-mini-instruct-4k", "Phi-3-small-instruct-128k", "Phi-3-small-instruct-8k", "AI21-Jamba-1.5-Large", "AI21-Jamba-1.5-Mini", "Cohere-Command-R", "Cohere-Command-R-08-2024", "Cohere-Command-R+", "Cohere-Command-R+-08-2024", "Llama-3.2-11B-Vision-Instruct", "Llama-3.2-90B-Vision-Instruct", "Llama-3.3-70B-Instruct", "Meta-Llama-3.1-405B-Instruct", "Meta-Llama-3.1-70B-Instruct", "Meta-Llama-3.1-8B-Instruct", "Meta-Llama-3-70B-Instruct", "Meta-Llama-3-8B-Instruct", "Ministral-3B", "Mistral-Large-24.11", "Mistral-Nemo", "Mistral-Large", "Mistral-Large-2407", "Mistral-Small", "JAIS-30b-Chat" ], default: "gpt-4o" }, temperature: { type: "number", label: "Temperature", default: 1 }, maxTokens: { type: "number", label: "Max Tokens", default: 4096 }, topP: { type: "number", label: "Top P", default: 1 } }; } async generateText(t, e) { const r = await fetch("https://models.inference.ai.azure.com/chat/completions", { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${this.apiKey}` }, body: JSON.stringify({ messages: [ { role: "user", content: t } ], model: (e == null ? void 0 : e.model) || "gpt-4o", temperature: (e == null ? void 0 : e.temperature) || 1, max_tokens: (e == null ? void 0 : e.maxTokens) || 4096, top_p: (e == null ? void 0 : e.topP) || 1 }) }); if (!r.ok) throw new Error("Failed to generate text with GitHub Azure"); return (await r.json()).choices[0].message.content; } } export { u as GitHubAzureDriver };