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
ਇੱਕ ਕਲਾਇੰਟ ਬਣਾਓ, ਦੋਸਤਾਨਾ ਫੀਲਡਾਂ ਨਾਲ ਇੱਕ ਵਿਆਖਿਆ ਬਣਾਓ, ਅਤੇ ਰੈਂਡਰ ਦੀ ਉਡੀਕ ਕਰੋ।
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 ਨਾਲ ਕਮਿਟ ਕਰੋ, ਜਾਂ ਸਾਦੀ ਭਾਸ਼ਾ ਵਿੱਚ ਹਦਾਇਤ ਭੇਜੋ। ਹਰ ਵੀਡੀਓ ਦਾ ਪਹਿਲਾ ਮੁੜ-ਰੈਂਡਰ ਮੁਫ਼ਤ ਹੈ। ਬਾਅਦ ਦੇ ਮੁੜ-ਰੈਂਡਰ ਭੁਗਤਾਨ ਯੋਜਨਾ ਮਿੰਟਾਂ ਦੀ ਵਰਤੋਂ ਕਰਦੇ ਹਨ।
// 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 | ਰੈਂਡਰ ਪੂਰਾ ਜਾਂ ਅਸਫਲ ਹੋਣ ਤੱਕ ਪੋਲ ਕਰਦਾ ਹੈ। |
--json | stdout ਤੇ ਮਸ਼ੀਨ-ਪੜ੍ਹਨਯੋਗ ਆਉਟਪੁੱਟ। |
--api-url <url> | /api ਅਗੇਤਰ ਸਮੇਤ API ਬੇਸ URL। Env: SKETCHIE_API_URL। |
--api-key <key> | ਤੁਹਾਡੀ API ਕੁੰਜੀ। Env: SKETCHIE_API_KEY। ਆਉਟਪੁੱਟ ਵਿੱਚ ਕਦੇ ਵੀ ਛਾਪੀ ਨਹੀਂ ਜਾਂਦੀ। |