@novax-ai/sdk 0.1.0
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.
- package/dist/index.d.ts +15 -0
- package/dist/index.js +26 -0
- package/package.json +25 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class NovaxClient {
|
|
2
|
+
private apiKey;
|
|
3
|
+
private baseUrl;
|
|
4
|
+
constructor({ apiKey }: {
|
|
5
|
+
apiKey: string;
|
|
6
|
+
});
|
|
7
|
+
textToSpeech: {
|
|
8
|
+
synthesize: ({ text, language }: {
|
|
9
|
+
text: string;
|
|
10
|
+
language?: string;
|
|
11
|
+
}) => Promise<{
|
|
12
|
+
blob: Blob;
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
15
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NovaxClient = void 0;
|
|
4
|
+
class NovaxClient {
|
|
5
|
+
constructor({ apiKey }) {
|
|
6
|
+
this.baseUrl = "https://novaxvoice-production.up.railway.app";
|
|
7
|
+
this.textToSpeech = {
|
|
8
|
+
synthesize: async ({ text, language = "kri" }) => {
|
|
9
|
+
const res = await fetch(`${this.baseUrl}/api/krio-tts`, {
|
|
10
|
+
method: "POST",
|
|
11
|
+
headers: {
|
|
12
|
+
"Content-Type": "application/json",
|
|
13
|
+
"Authorization": `Bearer ${this.apiKey}`,
|
|
14
|
+
},
|
|
15
|
+
body: JSON.stringify({ text, language }),
|
|
16
|
+
});
|
|
17
|
+
if (!res.ok)
|
|
18
|
+
throw new Error(await res.text());
|
|
19
|
+
const blob = await res.blob();
|
|
20
|
+
return { blob };
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
this.apiKey = apiKey;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.NovaxClient = NovaxClient;
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@novax-ai/sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Official SDK for the NovaxVoice Krio TTS and STT API",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"krio",
|
|
15
|
+
"tts",
|
|
16
|
+
"stt",
|
|
17
|
+
"sierra leone",
|
|
18
|
+
"speech"
|
|
19
|
+
],
|
|
20
|
+
"author": "NovaxVoice",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"typescript": "^5.0.0"
|
|
24
|
+
}
|
|
25
|
+
}
|