quantum-ai-sdk 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/account.d.ts +22 -0
  2. package/dist/account.js +47 -0
  3. package/dist/agent.d.ts +12 -0
  4. package/dist/agent.js +114 -0
  5. package/dist/audio.d.ts +82 -0
  6. package/dist/audio.js +140 -0
  7. package/dist/auth.d.ts +7 -0
  8. package/dist/auth.js +8 -0
  9. package/dist/batch.d.ts +22 -0
  10. package/dist/batch.js +32 -0
  11. package/dist/chat.d.ts +27 -0
  12. package/dist/chat.js +122 -0
  13. package/dist/client.d.ts +251 -0
  14. package/dist/client.js +479 -0
  15. package/dist/compute.d.ts +37 -0
  16. package/dist/compute.js +56 -0
  17. package/dist/contact.d.ts +12 -0
  18. package/dist/contact.js +26 -0
  19. package/dist/credits.d.ts +27 -0
  20. package/dist/credits.js +40 -0
  21. package/dist/documents.d.ts +17 -0
  22. package/dist/documents.js +42 -0
  23. package/dist/embeddings.d.ts +7 -0
  24. package/dist/embeddings.js +14 -0
  25. package/dist/errors.d.ts +29 -0
  26. package/dist/errors.js +70 -0
  27. package/dist/image.d.ts +12 -0
  28. package/dist/image.js +28 -0
  29. package/dist/index.d.ts +17 -0
  30. package/dist/index.js +33 -0
  31. package/dist/jobs.d.ts +28 -0
  32. package/dist/jobs.js +56 -0
  33. package/dist/keys.d.ts +17 -0
  34. package/dist/keys.js +24 -0
  35. package/dist/models.d.ts +12 -0
  36. package/dist/models.js +16 -0
  37. package/dist/rag.d.ts +22 -0
  38. package/dist/rag.js +44 -0
  39. package/dist/realtime.d.ts +121 -0
  40. package/dist/realtime.js +259 -0
  41. package/dist/session.d.ts +7 -0
  42. package/dist/session.js +17 -0
  43. package/dist/types.d.ts +1008 -0
  44. package/dist/types.js +5 -0
  45. package/dist/video.d.ts +46 -0
  46. package/dist/video.js +74 -0
  47. package/dist/voices.d.ts +27 -0
  48. package/dist/voices.js +55 -0
  49. package/package.json +3 -3
package/dist/types.js ADDED
@@ -0,0 +1,5 @@
1
+ // ── Constants ──────────────────────────────────────────────────────
2
+ /** Default production Quantum AI API endpoint. */
3
+ export const DEFAULT_BASE_URL = "https://api.quantumencoding.ai";
4
+ /** Number of ticks in one US dollar (10 billion). */
5
+ export const TICKS_PER_USD = 10000000000n;
@@ -0,0 +1,46 @@
1
+ import type { QuantumClient } from "./client.js";
2
+ import type { AsyncJobResponse, AvatarsResponse, DigitalTwinRequest, HeyGenTemplatesResponse, HeyGenVoicesResponse, PhotoAvatarRequest, VideoRequest, VideoResponse, VideoStudioRequest, VideoTranslateRequest } from "./types.js";
3
+ /**
4
+ * Generate a video from a text prompt.
5
+ *
6
+ * Video generation is slow (30s-5min). For production use, consider submitting
7
+ * via the Jobs API instead.
8
+ *
9
+ * @internal — called by QuantumClient.generateVideo()
10
+ */
11
+ export declare function generateVideo(client: QuantumClient, req: VideoRequest): Promise<VideoResponse>;
12
+ /**
13
+ * Create a talking-head video via HeyGen Studio. Returns an async job.
14
+ * @internal — called by QuantumClient.videoStudio()
15
+ */
16
+ export declare function videoStudio(client: QuantumClient, req: VideoStudioRequest): Promise<AsyncJobResponse>;
17
+ /**
18
+ * Submit a video translation job via HeyGen. Returns an async job.
19
+ * @internal — called by QuantumClient.videoTranslate()
20
+ */
21
+ export declare function videoTranslate(client: QuantumClient, req: VideoTranslateRequest): Promise<AsyncJobResponse>;
22
+ /**
23
+ * Create a photo avatar via HeyGen. Returns an async job.
24
+ * @internal — called by QuantumClient.videoPhotoAvatar()
25
+ */
26
+ export declare function videoPhotoAvatar(client: QuantumClient, req: PhotoAvatarRequest): Promise<AsyncJobResponse>;
27
+ /**
28
+ * Create a digital twin via HeyGen. Returns an async job.
29
+ * @internal — called by QuantumClient.videoDigitalTwin()
30
+ */
31
+ export declare function videoDigitalTwin(client: QuantumClient, req: DigitalTwinRequest): Promise<AsyncJobResponse>;
32
+ /**
33
+ * List available HeyGen avatars.
34
+ * @internal — called by QuantumClient.videoAvatars()
35
+ */
36
+ export declare function videoAvatars(client: QuantumClient): Promise<AvatarsResponse>;
37
+ /**
38
+ * List available HeyGen templates.
39
+ * @internal — called by QuantumClient.videoTemplates()
40
+ */
41
+ export declare function videoTemplates(client: QuantumClient): Promise<HeyGenTemplatesResponse>;
42
+ /**
43
+ * List available HeyGen voices.
44
+ * @internal — called by QuantumClient.videoHeygenVoices()
45
+ */
46
+ export declare function videoHeygenVoices(client: QuantumClient): Promise<HeyGenVoicesResponse>;
package/dist/video.js ADDED
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Generate a video from a text prompt.
3
+ *
4
+ * Video generation is slow (30s-5min). For production use, consider submitting
5
+ * via the Jobs API instead.
6
+ *
7
+ * @internal — called by QuantumClient.generateVideo()
8
+ */
9
+ export async function generateVideo(client, req) {
10
+ const { data, meta } = await client._doJSON("POST", "/qai/v1/video/generate", req);
11
+ if (!data.cost_ticks) {
12
+ data.cost_ticks = meta.costTicks;
13
+ }
14
+ if (!data.request_id) {
15
+ data.request_id = meta.requestId;
16
+ }
17
+ return data;
18
+ }
19
+ /**
20
+ * Create a talking-head video via HeyGen Studio. Returns an async job.
21
+ * @internal — called by QuantumClient.videoStudio()
22
+ */
23
+ export async function videoStudio(client, req) {
24
+ const { data } = await client._doJSON("POST", "/qai/v1/video/studio", req);
25
+ return data;
26
+ }
27
+ /**
28
+ * Submit a video translation job via HeyGen. Returns an async job.
29
+ * @internal — called by QuantumClient.videoTranslate()
30
+ */
31
+ export async function videoTranslate(client, req) {
32
+ const { data } = await client._doJSON("POST", "/qai/v1/video/translate", req);
33
+ return data;
34
+ }
35
+ /**
36
+ * Create a photo avatar via HeyGen. Returns an async job.
37
+ * @internal — called by QuantumClient.videoPhotoAvatar()
38
+ */
39
+ export async function videoPhotoAvatar(client, req) {
40
+ const { data } = await client._doJSON("POST", "/qai/v1/video/photo-avatar", req);
41
+ return data;
42
+ }
43
+ /**
44
+ * Create a digital twin via HeyGen. Returns an async job.
45
+ * @internal — called by QuantumClient.videoDigitalTwin()
46
+ */
47
+ export async function videoDigitalTwin(client, req) {
48
+ const { data } = await client._doJSON("POST", "/qai/v1/video/digital-twin", req);
49
+ return data;
50
+ }
51
+ /**
52
+ * List available HeyGen avatars.
53
+ * @internal — called by QuantumClient.videoAvatars()
54
+ */
55
+ export async function videoAvatars(client) {
56
+ const { data } = await client._doJSON("GET", "/qai/v1/video/avatars", undefined);
57
+ return data;
58
+ }
59
+ /**
60
+ * List available HeyGen templates.
61
+ * @internal — called by QuantumClient.videoTemplates()
62
+ */
63
+ export async function videoTemplates(client) {
64
+ const { data } = await client._doJSON("GET", "/qai/v1/video/templates", undefined);
65
+ return data;
66
+ }
67
+ /**
68
+ * List available HeyGen voices.
69
+ * @internal — called by QuantumClient.videoHeygenVoices()
70
+ */
71
+ export async function videoHeygenVoices(client) {
72
+ const { data } = await client._doJSON("GET", "/qai/v1/video/heygen-voices", undefined);
73
+ return data;
74
+ }
@@ -0,0 +1,27 @@
1
+ import type { QuantumClient } from "./client.js";
2
+ import type { AddVoiceFromLibraryRequest, AddVoiceFromLibraryResponse, CloneVoiceRequest, CloneVoiceResponse, SharedVoicesResponse, StatusResponse, VoiceLibraryQuery, VoicesResponse } from "./types.js";
3
+ /**
4
+ * List all available voices (ElevenLabs).
5
+ * @internal -- called by QuantumClient.listVoices()
6
+ */
7
+ export declare function listVoices(client: QuantumClient): Promise<VoicesResponse>;
8
+ /**
9
+ * Create an instant voice clone from audio samples.
10
+ * @internal -- called by QuantumClient.cloneVoice()
11
+ */
12
+ export declare function cloneVoice(client: QuantumClient, req: CloneVoiceRequest): Promise<CloneVoiceResponse>;
13
+ /**
14
+ * Delete a cloned voice.
15
+ * @internal -- called by QuantumClient.deleteVoice()
16
+ */
17
+ export declare function deleteVoice(client: QuantumClient, id: string): Promise<StatusResponse>;
18
+ /**
19
+ * Browse the shared voice library with optional filters.
20
+ * @internal -- called by QuantumClient.voiceLibrary()
21
+ */
22
+ export declare function voiceLibrary(client: QuantumClient, query?: VoiceLibraryQuery): Promise<SharedVoicesResponse>;
23
+ /**
24
+ * Add a shared voice from the library to the user's account.
25
+ * @internal -- called by QuantumClient.addVoiceFromLibrary()
26
+ */
27
+ export declare function addVoiceFromLibrary(client: QuantumClient, req: AddVoiceFromLibraryRequest): Promise<AddVoiceFromLibraryResponse>;
package/dist/voices.js ADDED
@@ -0,0 +1,55 @@
1
+ /**
2
+ * List all available voices (ElevenLabs).
3
+ * @internal -- called by QuantumClient.listVoices()
4
+ */
5
+ export async function listVoices(client) {
6
+ const { data } = await client._doJSON("GET", "/qai/v1/voices", undefined);
7
+ return data;
8
+ }
9
+ /**
10
+ * Create an instant voice clone from audio samples.
11
+ * @internal -- called by QuantumClient.cloneVoice()
12
+ */
13
+ export async function cloneVoice(client, req) {
14
+ const { data } = await client._doJSON("POST", "/qai/v1/voices/clone", req);
15
+ return data;
16
+ }
17
+ /**
18
+ * Delete a cloned voice.
19
+ * @internal -- called by QuantumClient.deleteVoice()
20
+ */
21
+ export async function deleteVoice(client, id) {
22
+ const { data } = await client._doJSON("DELETE", `/qai/v1/voices/${id}`, undefined);
23
+ return data;
24
+ }
25
+ /**
26
+ * Browse the shared voice library with optional filters.
27
+ * @internal -- called by QuantumClient.voiceLibrary()
28
+ */
29
+ export async function voiceLibrary(client, query) {
30
+ const params = new URLSearchParams();
31
+ if (query?.query)
32
+ params.set("query", query.query);
33
+ if (query?.page_size)
34
+ params.set("page_size", String(query.page_size));
35
+ if (query?.cursor)
36
+ params.set("cursor", query.cursor);
37
+ if (query?.gender)
38
+ params.set("gender", query.gender);
39
+ if (query?.language)
40
+ params.set("language", query.language);
41
+ if (query?.use_case)
42
+ params.set("use_case", query.use_case);
43
+ const qs = params.toString();
44
+ const path = qs ? `/qai/v1/voices/library?${qs}` : "/qai/v1/voices/library";
45
+ const { data } = await client._doJSON("GET", path, undefined);
46
+ return data;
47
+ }
48
+ /**
49
+ * Add a shared voice from the library to the user's account.
50
+ * @internal -- called by QuantumClient.addVoiceFromLibrary()
51
+ */
52
+ export async function addVoiceFromLibrary(client, req) {
53
+ const { data } = await client._doJSON("POST", "/qai/v1/voices/library/add", req);
54
+ return data;
55
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quantum-ai-sdk",
3
- "version": "0.2.0",
4
- "description": "Cosmic Duck SDK \u2014 100+ AI endpoints across 10 providers",
3
+ "version": "0.2.1",
4
+ "description": "Cosmic Duck SDK 100+ AI endpoints across 10 providers",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "type": "module",
@@ -32,4 +32,4 @@
32
32
  "type": "git",
33
33
  "url": "https://github.com/quantum-encoding/quantum-sdk-ts"
34
34
  }
35
- }
35
+ }