CLI සහ SDK

@sketchie/sdk TypeScript සේවාලාභියා සහ sketchie විධාන රේඛාව එකම HTTP API මතට තුනී, වර්ග කළ ඔතුම් වේ. දෙකම SKETCHIE_API_KEY වෙතින් ඔබේ යතුර කියවා පෙරනිමියෙන් https://sketchie.ai/api වෙත යයි.

SDK සහ CLI Sketchie මෙවලම් කට්ටලයේ කොටසක් ලෙස නිකුත් වේ. ඔබේ රෙජිස්ට්‍රිය තවම පැකේජය විසඳා නොමැති නම්, ඔබට bun සමඟ Sketchie ගබඩාවෙන් ඒවා ධාවනය කළ හැක. අමු HTTP API අද ඕනෑම භාෂාවකින් ක්‍රියා කරයි.

TypeScript SDK

සේවාලාභියෙකු සාදන්න, හිතවත් ක්ෂේත්‍ර සමඟ විස්තරයක් සාදන්න, සහ රෙන්ඩරය සඳහා රැඳී සිටින්න.

sketchie.ts
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

සංස්කරණ සහ නැවත-රෙන්ඩර ලූපය

සංස්කරණීයතා wedge: නිමකළ විස්තරයක් එහි sceneGraph ආපසු දෙයි. තවත් නොමිලේ වීඩියෝ නිර්මාණ ස්ලොට් එකක් භාවිතා නොකර අනුවාදයක් එකතු කිරීමට editExplainerGraph සමඟ commit කරන්න, නැතහොත් සරල භාෂාවෙන් උපදෙසක් යවන්න. සෑම වීඩියෝවකම පළමු නැවත-රෙන්ඩරය නොමිලේ. පසුකාලීන නැවත-රෙන්ඩර ගෙවුම් සැලැස්මේ මිනිත්තු භාවිතා කරයි.

edit.ts
// 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);

හඬවල් ලැයිස්තුගත කිරීම

voices.ts
const voices = await client.listVoices();
// [{ id: 'sketchie:sulafat', name: 'Nora', isDefault: true, preview_url, ... }]

වෙනත් ක්‍රම: getExplainer, listExplainers, revertExplainer, duplicateExplainer, සහ deleteExplainer.

විධාන රේඛාව

Terminal
# 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 රෙන්ඩරය අවසන් වන තෙක් හෝ අසාර්ථක වන තෙක් විමසයි.
--json stdout මත යන්ත්‍ර-කියවිය හැකි ප්‍රතිදානය.
--api-url <url> /api උපසර්ගය ඇතුළුව API මූලික URL. Env: SKETCHIE_API_URL.
--api-key <key> ඔබේ API යතුර. Env: SKETCHIE_API_KEY. ප්‍රතිදානයේ කිසිදා මුද්‍රණය නොවේ.