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
73 lines (72 loc) • 2.25 kB
JavaScript
/*! on-codemerge v1.3.1 @author Pavel Kuzmin @license MIT @homepage https://s00d.github.io/on-codemerge/ @repository git+https://github.com/s00d/on-codemerge.git Copyright (c) 2026 Pavel Kuzmin - Built on 2026-07-02T13:39:17.947Z */
var m = Object.defineProperty;
var i = (t, a, e) => a in t ? m(t, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[a] = e;
var r = (t, a, e) => i(t, typeof a != "symbol" ? a + "" : a, e);
class c {
constructor(a) {
r(this, "apiKey");
this.apiKey = a;
}
getOptionsDescription() {
return {
model: {
type: "list",
label: "Model",
options: [
"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"
],
default: "llama-3.2-90b-vision-instruct"
},
maxTokens: {
type: "number",
label: "Max Tokens",
default: 100
},
temperature: {
type: "number",
label: "Temperature",
default: 0.7
},
topK: {
type: "number",
label: "Top K",
default: 50
},
repetitionPenalty: {
type: "number",
label: "Repetition Penalty",
default: 1
}
};
}
async generateText(a, e) {
const l = await fetch("https://api.llama.ai/v1/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${this.apiKey}`
},
body: JSON.stringify({
model: (e == null ? void 0 : e.model) || "llama-3.2-90b-vision-instruct",
prompt: a,
max_tokens: (e == null ? void 0 : e.maxTokens) || 100,
temperature: (e == null ? void 0 : e.temperature) || 0.7,
top_k: (e == null ? void 0 : e.topK) || 50,
repetition_penalty: (e == null ? void 0 : e.repetitionPenalty) || 1
})
});
if (!l.ok)
throw new Error("Failed to generate text with Llama");
return (await l.json()).choices[0].text;
}
}
export {
c as LlamaDriver
};