CLI ಮತ್ತು SDK
@sketchie/sdk TypeScript ಕ್ಲೈಂಟ್ ಮತ್ತು sketchie ಕಮಾಂಡ್ ಲೈನ್ ಅದೇ HTTP API ಮೇಲೆ ತೆಳುವಾದ, ಟೈಪ್ ಮಾಡಿದ ಸುತ್ತುಗಳಾಗಿವೆ. ಎರಡೂ 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. ಔಟ್ಪುಟ್ನಲ್ಲಿ ಎಂದಿಗೂ ಮುದ್ರಿಸಲಾಗುವುದಿಲ್ಲ. |