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

46 lines (45 loc) 1.42 kB
/*! 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 s = Object.defineProperty; var i = (a, e, t) => e in a ? s(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t; var n = (a, e, t) => i(a, typeof e != "symbol" ? e + "" : e, t); class m { constructor(e) { n(this, "apiKey"); this.apiKey = e; } // Описание параметров для DeepSeek getOptionsDescription() { return { maxTokens: { type: "number", label: "Max Tokens", default: 100 }, temperature: { type: "number", label: "Temperature", default: 0.7 } }; } async generateText(e, t) { const r = await fetch("https://api.deepseek.com/v1/generate", { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${this.apiKey}` }, body: JSON.stringify({ prompt: e, max_tokens: (t == null ? void 0 : t.maxTokens) || 100, temperature: (t == null ? void 0 : t.temperature) || 0.7 }) }); if (!r.ok) throw new Error("Failed to generate text with DeepSeek"); return (await r.json()).text; } } export { m as DeepSeekDriver };