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

એક ક્લાયન્ટ બનાવો, મૈત્રીપૂર્ણ ફીલ્ડ સાથે એક સમજૂતી બનાવો, અને રેન્ડરની રાહ જુઓ.

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

સંપાદન અને પુનઃ-રેન્ડર લૂપ

સંપાદનક્ષમતા વેજ: પૂર્ણ થયેલી સમજૂતી તેનું sceneGraph પરત આપે છે. બીજા મફત વિડિયો બનાવટ સ્લોટનો ઉપયોગ કર્યા વિના આવૃત્તિ ઉમેરવા માટે editExplainerGraph સાથે કમિટ કરો, અથવા સાદી ભાષામાં સૂચના મોકલો. દરેક વિડિયોનું પ્રથમ પુનઃ-રેન્ડર મફત છે. પછીના પુનઃ-રેન્ડર ચૂકવેલ યોજનાની મિનિટોનો ઉપયોગ કરે છે.

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. આઉટપુટમાં ક્યારેય છાપવામાં આવતી નથી.