CLI እና SDK
@sketchie/sdk TypeScript ደንበኛ እና sketchie ትዕዛዝ መስመር በተመሳሳይ HTTP API ላይ ቀጭን፣ የተተየቡ wrapper ናቸው። ሁለቱም ቁልፍዎን ከ SKETCHIE_API_KEY ያነባሉ እና በነባሪ ወደ https://sketchie.ai/api ይሄዳሉ።
SDK እና CLI እንደ Sketchie መሳሪያ ስብስብ አካል ተልከዋል። መዝገብዎ አሁንም ጥቅሉን ካልፈታ፣ bun ተጠቅመው ከ Sketchie ማከማቻ ማስኬድ ይችላሉ። ጥሬው HTTP API ዛሬ ከማንኛውም ቋንቋ ይሰራል።
TypeScript SDK
ደንበኛ ይፍጠሩ፣ ወዳጃዊ መስኮች ጋር ማብራሪያ ይፍጠሩ፣ እና ለ render ይጠብቁ።
import { SketchieClient } from '@sketchie/sdk';
const client = new SketchieClient({
apiKey: process.env.SKETCHIE_API_KEY, // Bearer sk_...
// baseUrl defaults to https://sketchie.ai/api
});
// Friendly fields: input (the topic) and length ("M:SS", a multiple of 30).
const created = await client.createExplainer({
input: 'Explain how DNS resolves a domain name',
length: '0:30',
aspect: '16:9',
});
// Poll until the render finishes (or fails).
const done = await client.waitForExplainer(created.id, {
onUpdate: (e) => console.log(e.status),
});
console.log(done.videoUrl); // the rendered MP4
console.log(done.sceneGraph); // the editable scene graph የማርትዕ እና እንደገና-render loop
የማርትዕ ችሎታ wedge: የተጠናቀቀ ማብራሪያ የራሱን sceneGraph ይመልሳል። ሌላ ነፃ ቪዲዮ መፍጠሪያ ቦታ ሳይጠቀሙ ስሪት ለመጨመር በ editExplainerGraph ኮሚት ያድርጉ፣ ወይም በቀላል ቋንቋ መመሪያ ይላኩ። የእያንዳንዱ ቪዲዮ የመጀመሪያ እንደገና-render ነፃ ነው። ቀጣይ እንደገና-render ዎች የክፍያ እቅድ ደቂቃዎችን ይጠቀማሉ።
// After a video is ready you get back its editable sceneGraph.
// Edit it, then append a new version to the existing explainer.
const edited = editScenes(done.sceneGraph!); // your UI edits the graph
const rerender = await client.editExplainerGraph(done.id, edited);
await client.waitForVersion(done.id, rerender.id);
// Or apply a plain-language instruction (a targeted re-render):
const version = await client.editExplainer(done.id, 'make scene 2 shorter');
await client.waitForVersion(done.id, version.id); ድምፆችን መዘርዘር
const voices = await client.listVoices();
// [{ id: 'sketchie:sulafat', name: 'Nora', isDefault: true, preview_url, ... }] ሌሎች ዘዴዎች: getExplainer, listExplainers, revertExplainer, duplicateExplainer, እና deleteExplainer።
ትዕዛዝ መስመር
# Discover voices
sketchie voices
# Generate (returns the queued record immediately)
sketchie generate "Explain how DNS resolves a domain name" --length 0:30 --aspect 16:9
# Generate and wait for the finished render
sketchie generate "Explain how DNS resolves" --length 1:00 --wait
# Status of an existing explainer
sketchie status <id>
# Conversational edit (a targeted re-render)
sketchie edit <id> "make the title scene shorter" --wait
# List your explainers
sketchie list --limit 20 ባንዲራዎች እና አካባቢ
| ባንዲራ | ትርጉም |
|---|---|
--length <M:SS|sec> | የታለመ ርዝመት፣ ለምሳሌ 0:30, 1:00, ወይም ሰከንዶች። አዎንታዊ የ30 ብዜት። ለራስ-ሰር ይተውት። |
--aspect <ratio> | 16:9 (ነባሪ)፣ 9:16፣ ወይም 1:1። |
--voice <ref> | የድምፅ ref (sketchie voices ይመልከቱ)። አማራጭ; ነባሪ Nora። |
--limit <n> | ለ list ከፍተኛ ረድፎች፣ 1 እስከ 100 (ነባሪ 50)። |
--wait | render እስኪጠናቀቅ ወይም እስኪከሽፍ ድረስ ይጠይቃል። |
--json | በ stdout ላይ በማሽን ሊነበብ የሚችል ውጤት። |
--api-url <url> | የ/api ቅድመ ቅጥያን ጨምሮ API መሠረታዊ URL። Env: SKETCHIE_API_URL። |
--api-key <key> | የእርስዎ API ቁልፍ። Env: SKETCHIE_API_KEY። በውጤቱ ላይ ፈጽሞ አይታተምም። |