spitch 1.25.0 → 1.26.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.
- package/CHANGELOG.md +48 -0
- package/LICENSE +1 -1
- package/README.md +43 -9
- package/client.d.mts +7 -7
- package/client.d.mts.map +1 -1
- package/client.d.ts +7 -7
- package/client.d.ts.map +1 -1
- package/client.js +9 -4
- package/client.js.map +1 -1
- package/client.mjs +10 -5
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/files.d.mts +34 -89
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +34 -89
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +6 -53
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +6 -53
- package/resources/files.mjs.map +1 -1
- package/resources/index.d.mts +1 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -2
- package/resources/index.mjs.map +1 -1
- package/resources/speech.d.mts +51 -17
- package/resources/speech.d.mts.map +1 -1
- package/resources/speech.d.ts +51 -17
- package/resources/speech.d.ts.map +1 -1
- package/resources/speech.js +5 -3
- package/resources/speech.js.map +1 -1
- package/resources/speech.mjs +5 -3
- package/resources/speech.mjs.map +1 -1
- package/resources/text.d.mts +7 -25
- package/resources/text.d.mts.map +1 -1
- package/resources/text.d.ts +7 -25
- package/resources/text.d.ts.map +1 -1
- package/resources/text.js +3 -2
- package/resources/text.js.map +1 -1
- package/resources/text.mjs +3 -2
- package/resources/text.mjs.map +1 -1
- package/src/client.ts +21 -13
- package/src/internal/parse.ts +6 -0
- package/src/resources/files.ts +36 -96
- package/src/resources/index.ts +7 -2
- package/src/resources/speech.ts +55 -19
- package/src/resources/text.ts +7 -29
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/jobs.d.mts +0 -42
- package/resources/jobs.d.mts.map +0 -1
- package/resources/jobs.d.ts +0 -42
- package/resources/jobs.d.ts.map +0 -1
- package/resources/jobs.js +0 -23
- package/resources/jobs.js.map +0 -1
- package/resources/jobs.mjs +0 -19
- package/resources/jobs.mjs.map +0 -1
- package/src/resources/jobs.ts +0 -68
package/resources/files.mjs
CHANGED
|
@@ -5,84 +5,37 @@ import { multipartFormRequestOptions } from "../internal/uploads.mjs";
|
|
|
5
5
|
import { path } from "../internal/utils/path.mjs";
|
|
6
6
|
export class Files extends APIResource {
|
|
7
7
|
/**
|
|
8
|
-
* Get
|
|
9
|
-
*
|
|
10
|
-
* Args: identity: Authentication identity containing org_id and user_id limit:
|
|
11
|
-
* Maximum number of files to return (max 100) status: Optional filter by file
|
|
12
|
-
* status (processing, ready, etc.) cursor: Optional pagination cursor for getting
|
|
13
|
-
* next page db: Database session
|
|
14
|
-
*
|
|
15
|
-
* Returns: ListFilesResponse: Paginated list of files with metadata
|
|
16
|
-
*
|
|
17
|
-
* Raises: HTTPException: 400 if cursor is invalid
|
|
8
|
+
* Get Files
|
|
18
9
|
*/
|
|
19
10
|
list(query = {}, options) {
|
|
20
11
|
return this._client.getAPIList('/v1/files', (FilesCursor), { query, ...options });
|
|
21
12
|
}
|
|
22
13
|
/**
|
|
23
|
-
* Delete
|
|
24
|
-
*
|
|
25
|
-
* Args: file_id: UUID of the file to delete identity: Authentication identity
|
|
26
|
-
* containing org_id db: Database session s3: S3 session for deleting objects
|
|
27
|
-
*
|
|
28
|
-
* Returns: dict: Success confirmation
|
|
29
|
-
*
|
|
30
|
-
* Raises: HTTPException: 404 if file not found or doesn't belong to org
|
|
14
|
+
* Delete File
|
|
31
15
|
*/
|
|
32
16
|
delete(fileID, options) {
|
|
33
17
|
return this._client.delete(path `/v1/files/${fileID}`, options);
|
|
34
18
|
}
|
|
35
19
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* Args: file_id: UUID of the file to download identity: Authentication identity
|
|
39
|
-
* containing org_id ttl: Time-to-live for the download URL in seconds (60-3600)
|
|
40
|
-
* db: Database session s3: S3 session for generating pre-signed URLs
|
|
41
|
-
*
|
|
42
|
-
* Returns: FileDownloadResponse: Contains file_id, download URL, and expiration
|
|
43
|
-
* time
|
|
44
|
-
*
|
|
45
|
-
* Raises: HTTPException: 404 if file not found, doesn't belong to org, or not
|
|
46
|
-
* ready
|
|
20
|
+
* Download File
|
|
47
21
|
*/
|
|
48
22
|
download(fileID, query = {}, options) {
|
|
49
23
|
return this._client.get(path `/v1/files/${fileID}/url`, { query, ...options });
|
|
50
24
|
}
|
|
51
25
|
/**
|
|
52
|
-
* Get
|
|
53
|
-
*
|
|
54
|
-
* Args: file_id: UUID of the file to retrieve identity: Authentication identity
|
|
55
|
-
* containing org_id db: Database session
|
|
56
|
-
*
|
|
57
|
-
* Returns: FileMetaResponse: File metadata including upload information
|
|
58
|
-
*
|
|
59
|
-
* Raises: HTTPException: 404 if file not found or doesn't belong to org
|
|
60
|
-
* HTTPException: 500 if uploader information is corrupted
|
|
26
|
+
* Get File
|
|
61
27
|
*/
|
|
62
28
|
get(fileID, options) {
|
|
63
29
|
return this._client.get(path `/v1/files/${fileID}`, options);
|
|
64
30
|
}
|
|
65
31
|
/**
|
|
66
|
-
* Upload a file to
|
|
67
|
-
*
|
|
68
|
-
* Args: file: The file to upload from the request identity: Authentication
|
|
69
|
-
* identity containing org_id and user_id db: Database session
|
|
70
|
-
*
|
|
71
|
-
* Returns: FileMetaResponse: Metadata for the uploaded file
|
|
72
|
-
*
|
|
73
|
-
* Raises: HTTPException: 500 if upload fails
|
|
32
|
+
* Upload a file to your storage.
|
|
74
33
|
*/
|
|
75
34
|
upload(body, options) {
|
|
76
35
|
return this._client.post('/v1/files', multipartFormRequestOptions({ body, ...options }, this._client));
|
|
77
36
|
}
|
|
78
37
|
/**
|
|
79
|
-
* Get
|
|
80
|
-
*
|
|
81
|
-
* Args: identity: Authentication identity containing org_id db: Database session
|
|
82
|
-
*
|
|
83
|
-
* Returns: FileUsage: Usage statistics including total/used bytes and file count
|
|
84
|
-
*
|
|
85
|
-
* Raises: HTTPException: 500 if unable to calculate usage
|
|
38
|
+
* Get Usage
|
|
86
39
|
*/
|
|
87
40
|
usage(options) {
|
|
88
41
|
return this._client.get('/v1/files:usage', options);
|
package/resources/files.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.mjs","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,WAAW,EAAuC;OAGpD,EAAE,2BAA2B,EAAE;OAC/B,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC
|
|
1
|
+
{"version":3,"file":"files.mjs","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,WAAW,EAAuC;OAGpD,EAAE,2BAA2B,EAAE;OAC/B,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;OAEG;IACH,IAAI,CACF,QAA2C,EAAE,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAA,WAAiB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxF,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,MAAc,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,aAAa,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAED;;OAEG;IACH,QAAQ,CACN,MAAc,EACd,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,MAAM,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,MAAc,EAAE,OAAwB;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,2BAA2B,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IACzG,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAwB;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;CACF"}
|
package/resources/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { Files, type File, type FileUsage, type FileDeleteResponse, type FileDownloadResponse, type FileListParams, type FileDownloadParams, type FileUploadParams, type FilesFilesCursor, } from "./files.mjs";
|
|
2
|
-
export {
|
|
3
|
-
export { Speech, type Transcription, type SpeechGenerateParams, type SpeechTranscribeParams } from "./speech.mjs";
|
|
2
|
+
export { Speech, type Segment, type Transcription, type SpeechGenerateParams, type SpeechTranscribeParams, } from "./speech.mjs";
|
|
4
3
|
export { Text, type Diacritics, type Translation, type TextToneMarkParams, type TextTranslateParams, } from "./text.mjs";
|
|
5
4
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB;OACM,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB;OACM,EACL,MAAM,EACN,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,GAC5B;OACM,EACL,IAAI,EACJ,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB"}
|
package/resources/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { Files, type File, type FileUsage, type FileDeleteResponse, type FileDownloadResponse, type FileListParams, type FileDownloadParams, type FileUploadParams, type FilesFilesCursor, } from "./files.js";
|
|
2
|
-
export {
|
|
3
|
-
export { Speech, type Transcription, type SpeechGenerateParams, type SpeechTranscribeParams } from "./speech.js";
|
|
2
|
+
export { Speech, type Segment, type Transcription, type SpeechGenerateParams, type SpeechTranscribeParams, } from "./speech.js";
|
|
4
3
|
export { Text, type Diacritics, type Translation, type TextToneMarkParams, type TextTranslateParams, } from "./text.js";
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
package/resources/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB;OACM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB;OACM,EACL,MAAM,EACN,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,GAC5B;OACM,EACL,IAAI,EACJ,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB"}
|
package/resources/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Text = exports.Speech = exports.
|
|
4
|
+
exports.Text = exports.Speech = exports.Files = void 0;
|
|
5
5
|
var files_1 = require("./files.js");
|
|
6
6
|
Object.defineProperty(exports, "Files", { enumerable: true, get: function () { return files_1.Files; } });
|
|
7
|
-
var jobs_1 = require("./jobs.js");
|
|
8
|
-
Object.defineProperty(exports, "Jobs", { enumerable: true, get: function () { return jobs_1.Jobs; } });
|
|
9
7
|
var speech_1 = require("./speech.js");
|
|
10
8
|
Object.defineProperty(exports, "Speech", { enumerable: true, get: function () { return speech_1.Speech; } });
|
|
11
9
|
var text_1 = require("./text.js");
|
package/resources/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,oCAUiB;AATf,8FAAA,KAAK,OAAA;AAUP,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,oCAUiB;AATf,8FAAA,KAAK,OAAA;AAUP,sCAMkB;AALhB,gGAAA,MAAM,OAAA;AAMR,kCAMgB;AALd,4FAAA,IAAI,OAAA"}
|
package/resources/index.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
export { Files, } from "./files.mjs";
|
|
3
|
-
export {
|
|
4
|
-
export { Speech } from "./speech.mjs";
|
|
3
|
+
export { Speech, } from "./speech.mjs";
|
|
5
4
|
export { Text, } from "./text.mjs";
|
|
6
5
|
//# sourceMappingURL=index.mjs.map
|
package/resources/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,KAAK,GASN;OACM,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,KAAK,GASN;OACM,EACL,MAAM,GAKP;OACM,EACL,IAAI,GAKL"}
|
package/resources/speech.d.mts
CHANGED
|
@@ -7,42 +7,76 @@ import { RequestOptions } from "../internal/request-options.mjs";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class Speech extends APIResource {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Convert text to speech. Select a voice and use that to generate audio in any
|
|
11
|
+
* format. Audio is retured in chunks.
|
|
11
12
|
*/
|
|
12
13
|
generate(body: SpeechGenerateParams, options?: RequestOptions): APIPromise<Response>;
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
+
* Convert speech to text. Upload audio file containing speech and get back text
|
|
16
|
+
* that represents the content of the audio file.
|
|
15
17
|
*/
|
|
16
18
|
transcribe(body: SpeechTranscribeParams, options?: RequestOptions): APIPromise<Transcription>;
|
|
17
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* a segment (sentence or word-level) of the transcript. It contains a start and
|
|
22
|
+
* end time.
|
|
23
|
+
*/
|
|
24
|
+
export interface Segment {
|
|
25
|
+
/**
|
|
26
|
+
* the exact time when this segment ended.
|
|
27
|
+
*/
|
|
28
|
+
end: number;
|
|
29
|
+
/**
|
|
30
|
+
* the exact time when this segment started.
|
|
31
|
+
*/
|
|
32
|
+
start: number;
|
|
33
|
+
/**
|
|
34
|
+
* the text that belongs in this timeframe.
|
|
35
|
+
*/
|
|
36
|
+
text: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Response from speech-to-text.
|
|
40
|
+
*/
|
|
18
41
|
export interface Transcription {
|
|
42
|
+
/**
|
|
43
|
+
* for audit purposes.
|
|
44
|
+
*/
|
|
19
45
|
request_id: string;
|
|
20
46
|
text: string;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
47
|
+
/**
|
|
48
|
+
* sentence-level or word-level groupings of your transcript. Each sentence (or
|
|
49
|
+
* word) will fall within a time range.
|
|
50
|
+
*/
|
|
51
|
+
segments?: Array<Segment> | null;
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated sentence-level or word-level groupings of your transcript. Each
|
|
54
|
+
* sentence (or word) will fall within a time range.
|
|
55
|
+
*/
|
|
56
|
+
timestamps?: Array<Segment> | null;
|
|
29
57
|
}
|
|
30
58
|
export interface SpeechGenerateParams {
|
|
31
|
-
language: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
59
|
+
language: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
|
|
32
60
|
text: string;
|
|
33
61
|
voice: 'sade' | 'segun' | 'femi' | 'funmi' | 'amina' | 'aliyu' | 'hasan' | 'zainab' | 'john' | 'jude' | 'lina' | 'lucy' | 'henry' | 'kani' | 'ngozi' | 'amara' | 'obinna' | 'ebuka' | 'hana' | 'selam' | 'tena' | 'tesfaye';
|
|
34
|
-
|
|
35
|
-
|
|
62
|
+
/**
|
|
63
|
+
* the audio format for the returned audio bytes.
|
|
64
|
+
*/
|
|
65
|
+
format?: 'mp3' | 'wav' | 'ogg_opus' | 'webm_opus' | 'mulaw' | 'alaw' | 'flac' | 'pcm_s16le';
|
|
66
|
+
model?: string | null;
|
|
36
67
|
}
|
|
37
68
|
export interface SpeechTranscribeParams {
|
|
38
|
-
language: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
39
|
-
content?: Uploadable | null;
|
|
40
|
-
model?: 'mansa_v1' | 'legacy' |
|
|
69
|
+
language: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
|
|
70
|
+
content?: Uploadable | string | null;
|
|
71
|
+
model?: 'mansa_v1' | 'legacy' | null;
|
|
41
72
|
special_words?: string | null;
|
|
42
73
|
timestamp?: 'sentence' | 'word' | 'none' | null;
|
|
74
|
+
/**
|
|
75
|
+
* @deprecated
|
|
76
|
+
*/
|
|
43
77
|
url?: string | null;
|
|
44
78
|
}
|
|
45
79
|
export declare namespace Speech {
|
|
46
|
-
export { type Transcription as Transcription, type SpeechGenerateParams as SpeechGenerateParams, type SpeechTranscribeParams as SpeechTranscribeParams, };
|
|
80
|
+
export { type Segment as Segment, type Transcription as Transcription, type SpeechGenerateParams as SpeechGenerateParams, type SpeechTranscribeParams as SpeechTranscribeParams, };
|
|
47
81
|
}
|
|
48
82
|
//# sourceMappingURL=speech.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speech.d.mts","sourceRoot":"","sources":["../src/resources/speech.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;OAEnB,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC
|
|
1
|
+
{"version":3,"file":"speech.d.mts","sourceRoot":"","sources":["../src/resources/speech.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;OAEnB,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IASpF;;;OAGG;IACH,UAAU,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;CAM9F;AAED;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAEjC;;;OAGG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;IAEnD,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,EACD,MAAM,GACN,OAAO,GACP,MAAM,GACN,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,QAAQ,GACR,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,GACN,OAAO,GACP,OAAO,GACP,QAAQ,GACR,OAAO,GACP,MAAM,GACN,OAAO,GACP,MAAM,GACN,SAAS,CAAC;IAEd;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,UAAU,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC;IAE5F,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;IAEnD,OAAO,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC;IAErC,KAAK,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,IAAI,CAAC;IAErC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B,SAAS,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAEhD;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
package/resources/speech.d.ts
CHANGED
|
@@ -7,42 +7,76 @@ import { RequestOptions } from "../internal/request-options.js";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class Speech extends APIResource {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Convert text to speech. Select a voice and use that to generate audio in any
|
|
11
|
+
* format. Audio is retured in chunks.
|
|
11
12
|
*/
|
|
12
13
|
generate(body: SpeechGenerateParams, options?: RequestOptions): APIPromise<Response>;
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
+
* Convert speech to text. Upload audio file containing speech and get back text
|
|
16
|
+
* that represents the content of the audio file.
|
|
15
17
|
*/
|
|
16
18
|
transcribe(body: SpeechTranscribeParams, options?: RequestOptions): APIPromise<Transcription>;
|
|
17
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* a segment (sentence or word-level) of the transcript. It contains a start and
|
|
22
|
+
* end time.
|
|
23
|
+
*/
|
|
24
|
+
export interface Segment {
|
|
25
|
+
/**
|
|
26
|
+
* the exact time when this segment ended.
|
|
27
|
+
*/
|
|
28
|
+
end: number;
|
|
29
|
+
/**
|
|
30
|
+
* the exact time when this segment started.
|
|
31
|
+
*/
|
|
32
|
+
start: number;
|
|
33
|
+
/**
|
|
34
|
+
* the text that belongs in this timeframe.
|
|
35
|
+
*/
|
|
36
|
+
text: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Response from speech-to-text.
|
|
40
|
+
*/
|
|
18
41
|
export interface Transcription {
|
|
42
|
+
/**
|
|
43
|
+
* for audit purposes.
|
|
44
|
+
*/
|
|
19
45
|
request_id: string;
|
|
20
46
|
text: string;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
47
|
+
/**
|
|
48
|
+
* sentence-level or word-level groupings of your transcript. Each sentence (or
|
|
49
|
+
* word) will fall within a time range.
|
|
50
|
+
*/
|
|
51
|
+
segments?: Array<Segment> | null;
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated sentence-level or word-level groupings of your transcript. Each
|
|
54
|
+
* sentence (or word) will fall within a time range.
|
|
55
|
+
*/
|
|
56
|
+
timestamps?: Array<Segment> | null;
|
|
29
57
|
}
|
|
30
58
|
export interface SpeechGenerateParams {
|
|
31
|
-
language: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
59
|
+
language: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
|
|
32
60
|
text: string;
|
|
33
61
|
voice: 'sade' | 'segun' | 'femi' | 'funmi' | 'amina' | 'aliyu' | 'hasan' | 'zainab' | 'john' | 'jude' | 'lina' | 'lucy' | 'henry' | 'kani' | 'ngozi' | 'amara' | 'obinna' | 'ebuka' | 'hana' | 'selam' | 'tena' | 'tesfaye';
|
|
34
|
-
|
|
35
|
-
|
|
62
|
+
/**
|
|
63
|
+
* the audio format for the returned audio bytes.
|
|
64
|
+
*/
|
|
65
|
+
format?: 'mp3' | 'wav' | 'ogg_opus' | 'webm_opus' | 'mulaw' | 'alaw' | 'flac' | 'pcm_s16le';
|
|
66
|
+
model?: string | null;
|
|
36
67
|
}
|
|
37
68
|
export interface SpeechTranscribeParams {
|
|
38
|
-
language: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
39
|
-
content?: Uploadable | null;
|
|
40
|
-
model?: 'mansa_v1' | 'legacy' |
|
|
69
|
+
language: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
|
|
70
|
+
content?: Uploadable | string | null;
|
|
71
|
+
model?: 'mansa_v1' | 'legacy' | null;
|
|
41
72
|
special_words?: string | null;
|
|
42
73
|
timestamp?: 'sentence' | 'word' | 'none' | null;
|
|
74
|
+
/**
|
|
75
|
+
* @deprecated
|
|
76
|
+
*/
|
|
43
77
|
url?: string | null;
|
|
44
78
|
}
|
|
45
79
|
export declare namespace Speech {
|
|
46
|
-
export { type Transcription as Transcription, type SpeechGenerateParams as SpeechGenerateParams, type SpeechTranscribeParams as SpeechTranscribeParams, };
|
|
80
|
+
export { type Segment as Segment, type Transcription as Transcription, type SpeechGenerateParams as SpeechGenerateParams, type SpeechTranscribeParams as SpeechTranscribeParams, };
|
|
47
81
|
}
|
|
48
82
|
//# sourceMappingURL=speech.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speech.d.ts","sourceRoot":"","sources":["../src/resources/speech.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;OAEnB,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC
|
|
1
|
+
{"version":3,"file":"speech.d.ts","sourceRoot":"","sources":["../src/resources/speech.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;OAEnB,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IASpF;;;OAGG;IACH,UAAU,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;CAM9F;AAED;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAEjC;;;OAGG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;IAEnD,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,EACD,MAAM,GACN,OAAO,GACP,MAAM,GACN,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,QAAQ,GACR,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,GACN,OAAO,GACP,OAAO,GACP,QAAQ,GACR,OAAO,GACP,MAAM,GACN,OAAO,GACP,MAAM,GACN,SAAS,CAAC;IAEd;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,UAAU,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC;IAE5F,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;IAEnD,OAAO,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC;IAErC,KAAK,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,IAAI,CAAC;IAErC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B,SAAS,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAEhD;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
package/resources/speech.js
CHANGED
|
@@ -10,18 +10,20 @@ const uploads_1 = require("../internal/uploads.js");
|
|
|
10
10
|
*/
|
|
11
11
|
class Speech extends resource_1.APIResource {
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Convert text to speech. Select a voice and use that to generate audio in any
|
|
14
|
+
* format. Audio is retured in chunks.
|
|
14
15
|
*/
|
|
15
16
|
generate(body, options) {
|
|
16
17
|
return this._client.post('/v1/speech', {
|
|
17
18
|
body,
|
|
18
19
|
...options,
|
|
19
|
-
headers: (0, headers_1.buildHeaders)([{ Accept: 'audio
|
|
20
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: 'audio/wav' }, options?.headers]),
|
|
20
21
|
__binaryResponse: true,
|
|
21
22
|
});
|
|
22
23
|
}
|
|
23
24
|
/**
|
|
24
|
-
*
|
|
25
|
+
* Convert speech to text. Upload audio file containing speech and get back text
|
|
26
|
+
* that represents the content of the audio file.
|
|
25
27
|
*/
|
|
26
28
|
transcribe(body, options) {
|
|
27
29
|
return this._client.post('/v1/transcriptions', (0, uploads_1.multipartFormRequestOptions)({ body, ...options }, this._client));
|
package/resources/speech.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speech.js","sourceRoot":"","sources":["../src/resources/speech.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAAmD;AAEnD,oDAAkE;AAElE;;GAEG;AACH,MAAa,MAAO,SAAQ,sBAAW;IACrC
|
|
1
|
+
{"version":3,"file":"speech.js","sourceRoot":"","sources":["../src/resources/speech.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAAmD;AAEnD,oDAAkE;AAElE;;GAEG;AACH,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;OAGG;IACH,QAAQ,CAAC,IAA0B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE;YACrC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAClE,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,UAAU,CAAC,IAA4B,EAAE,OAAwB;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,oBAAoB,EACpB,IAAA,qCAA2B,EAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAChE,CAAC;IACJ,CAAC;CACF;AAxBD,wBAwBC"}
|
package/resources/speech.mjs
CHANGED
|
@@ -7,18 +7,20 @@ import { multipartFormRequestOptions } from "../internal/uploads.mjs";
|
|
|
7
7
|
*/
|
|
8
8
|
export class Speech extends APIResource {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Convert text to speech. Select a voice and use that to generate audio in any
|
|
11
|
+
* format. Audio is retured in chunks.
|
|
11
12
|
*/
|
|
12
13
|
generate(body, options) {
|
|
13
14
|
return this._client.post('/v1/speech', {
|
|
14
15
|
body,
|
|
15
16
|
...options,
|
|
16
|
-
headers: buildHeaders([{ Accept: 'audio
|
|
17
|
+
headers: buildHeaders([{ Accept: 'audio/wav' }, options?.headers]),
|
|
17
18
|
__binaryResponse: true,
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
21
|
-
*
|
|
22
|
+
* Convert speech to text. Upload audio file containing speech and get back text
|
|
23
|
+
* that represents the content of the audio file.
|
|
22
24
|
*/
|
|
23
25
|
transcribe(body, options) {
|
|
24
26
|
return this._client.post('/v1/transcriptions', multipartFormRequestOptions({ body, ...options }, this._client));
|
package/resources/speech.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speech.mjs","sourceRoot":"","sources":["../src/resources/speech.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,YAAY,EAAE;OAEhB,EAAE,2BAA2B,EAAE;AAEtC;;GAEG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC
|
|
1
|
+
{"version":3,"file":"speech.mjs","sourceRoot":"","sources":["../src/resources/speech.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,YAAY,EAAE;OAEhB,EAAE,2BAA2B,EAAE;AAEtC;;GAEG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;OAGG;IACH,QAAQ,CAAC,IAA0B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE;YACrC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAClE,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,UAAU,CAAC,IAA4B,EAAE,OAAwB;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,oBAAoB,EACpB,2BAA2B,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAChE,CAAC;IACJ,CAAC;CACF"}
|
package/resources/text.d.mts
CHANGED
|
@@ -3,49 +3,31 @@ import { APIPromise } from "../core/api-promise.mjs";
|
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
4
|
export declare class Text extends APIResource {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Add appopriate tone marks to text.
|
|
7
7
|
*/
|
|
8
8
|
toneMark(body: TextToneMarkParams, options?: RequestOptions): APIPromise<Diacritics>;
|
|
9
9
|
/**
|
|
10
|
-
* Translate
|
|
10
|
+
* Translate text from one language to another. Select the source and target
|
|
11
|
+
* languages, and get text in new language.
|
|
11
12
|
*/
|
|
12
13
|
translate(body: TextTranslateParams, options?: RequestOptions): APIPromise<Translation>;
|
|
13
14
|
}
|
|
14
|
-
/**
|
|
15
|
-
* Response model for text diacritization requests.
|
|
16
|
-
*
|
|
17
|
-
* Attributes:
|
|
18
|
-
* request_id: Unique identifier for the diacritization request
|
|
19
|
-
* text: Text with added diacritical marks for proper pronunciation
|
|
20
|
-
* language: Language code for the diacritized text
|
|
21
|
-
*/
|
|
22
15
|
export interface Diacritics {
|
|
23
16
|
request_id: string;
|
|
24
17
|
text: string;
|
|
25
18
|
}
|
|
26
|
-
/**
|
|
27
|
-
* Translation result model.
|
|
28
|
-
*
|
|
29
|
-
* Attributes: request_id (UUID): Unique ID for this request. text: translated
|
|
30
|
-
* text. due_date: used when model is `human`. the date you can expect the
|
|
31
|
-
* translation to be delivered
|
|
32
|
-
*/
|
|
33
19
|
export interface Translation {
|
|
34
20
|
request_id: string;
|
|
35
21
|
text: string;
|
|
36
|
-
due_date?: string | null;
|
|
37
22
|
}
|
|
38
23
|
export interface TextToneMarkParams {
|
|
39
|
-
language: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
24
|
+
language: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
|
|
40
25
|
text: string;
|
|
41
26
|
}
|
|
42
27
|
export interface TextTranslateParams {
|
|
43
|
-
source: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
44
|
-
target: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
45
|
-
|
|
46
|
-
instructions?: string | null;
|
|
47
|
-
model?: 'human' | 'auto';
|
|
48
|
-
text?: string | null;
|
|
28
|
+
source: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
|
|
29
|
+
target: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
|
|
30
|
+
text: string;
|
|
49
31
|
}
|
|
50
32
|
export declare namespace Text {
|
|
51
33
|
export { type Diacritics as Diacritics, type Translation as Translation, type TextToneMarkParams as TextToneMarkParams, type TextTranslateParams as TextTranslateParams, };
|
package/resources/text.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.mts","sourceRoot":"","sources":["../src/resources/text.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,IAAK,SAAQ,WAAW;IACnC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC;IAIpF
|
|
1
|
+
{"version":3,"file":"text.d.mts","sourceRoot":"","sources":["../src/resources/text.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,IAAK,SAAQ,WAAW;IACnC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC;IAIpF;;;OAGG;IACH,SAAS,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC;CAGxF;AAED,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;IAEnD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;IAEjD,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;IAEjD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
package/resources/text.d.ts
CHANGED
|
@@ -3,49 +3,31 @@ import { APIPromise } from "../core/api-promise.js";
|
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.js";
|
|
4
4
|
export declare class Text extends APIResource {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Add appopriate tone marks to text.
|
|
7
7
|
*/
|
|
8
8
|
toneMark(body: TextToneMarkParams, options?: RequestOptions): APIPromise<Diacritics>;
|
|
9
9
|
/**
|
|
10
|
-
* Translate
|
|
10
|
+
* Translate text from one language to another. Select the source and target
|
|
11
|
+
* languages, and get text in new language.
|
|
11
12
|
*/
|
|
12
13
|
translate(body: TextTranslateParams, options?: RequestOptions): APIPromise<Translation>;
|
|
13
14
|
}
|
|
14
|
-
/**
|
|
15
|
-
* Response model for text diacritization requests.
|
|
16
|
-
*
|
|
17
|
-
* Attributes:
|
|
18
|
-
* request_id: Unique identifier for the diacritization request
|
|
19
|
-
* text: Text with added diacritical marks for proper pronunciation
|
|
20
|
-
* language: Language code for the diacritized text
|
|
21
|
-
*/
|
|
22
15
|
export interface Diacritics {
|
|
23
16
|
request_id: string;
|
|
24
17
|
text: string;
|
|
25
18
|
}
|
|
26
|
-
/**
|
|
27
|
-
* Translation result model.
|
|
28
|
-
*
|
|
29
|
-
* Attributes: request_id (UUID): Unique ID for this request. text: translated
|
|
30
|
-
* text. due_date: used when model is `human`. the date you can expect the
|
|
31
|
-
* translation to be delivered
|
|
32
|
-
*/
|
|
33
19
|
export interface Translation {
|
|
34
20
|
request_id: string;
|
|
35
21
|
text: string;
|
|
36
|
-
due_date?: string | null;
|
|
37
22
|
}
|
|
38
23
|
export interface TextToneMarkParams {
|
|
39
|
-
language: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
24
|
+
language: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
|
|
40
25
|
text: string;
|
|
41
26
|
}
|
|
42
27
|
export interface TextTranslateParams {
|
|
43
|
-
source: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
44
|
-
target: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
45
|
-
|
|
46
|
-
instructions?: string | null;
|
|
47
|
-
model?: 'human' | 'auto';
|
|
48
|
-
text?: string | null;
|
|
28
|
+
source: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
|
|
29
|
+
target: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
|
|
30
|
+
text: string;
|
|
49
31
|
}
|
|
50
32
|
export declare namespace Text {
|
|
51
33
|
export { type Diacritics as Diacritics, type Translation as Translation, type TextToneMarkParams as TextToneMarkParams, type TextTranslateParams as TextTranslateParams, };
|
package/resources/text.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../src/resources/text.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,IAAK,SAAQ,WAAW;IACnC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC;IAIpF
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../src/resources/text.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,IAAK,SAAQ,WAAW;IACnC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC;IAIpF;;;OAGG;IACH,SAAS,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC;CAGxF;AAED,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;IAEnD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;IAEjD,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;IAEjD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
package/resources/text.js
CHANGED
|
@@ -5,13 +5,14 @@ exports.Text = void 0;
|
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
6
|
class Text extends resource_1.APIResource {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Add appopriate tone marks to text.
|
|
9
9
|
*/
|
|
10
10
|
toneMark(body, options) {
|
|
11
11
|
return this._client.post('/v1/diacritics', { body, ...options });
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Translate
|
|
14
|
+
* Translate text from one language to another. Select the source and target
|
|
15
|
+
* languages, and get text in new language.
|
|
15
16
|
*/
|
|
16
17
|
translate(body, options) {
|
|
17
18
|
return this._client.post('/v1/translate', { body, ...options });
|
package/resources/text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sourceRoot":"","sources":["../src/resources/text.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,IAAK,SAAQ,sBAAW;IACnC;;OAEG;IACH,QAAQ,CAAC,IAAwB,EAAE,OAAwB;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../src/resources/text.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,IAAK,SAAQ,sBAAW;IACnC;;OAEG;IACH,QAAQ,CAAC,IAAwB,EAAE,OAAwB;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,IAAyB,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;CACF;AAfD,oBAeC"}
|
package/resources/text.mjs
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
3
|
export class Text extends APIResource {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Add appopriate tone marks to text.
|
|
6
6
|
*/
|
|
7
7
|
toneMark(body, options) {
|
|
8
8
|
return this._client.post('/v1/diacritics', { body, ...options });
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
* Translate
|
|
11
|
+
* Translate text from one language to another. Select the source and target
|
|
12
|
+
* languages, and get text in new language.
|
|
12
13
|
*/
|
|
13
14
|
translate(body, options) {
|
|
14
15
|
return this._client.post('/v1/translate', { body, ...options });
|
package/resources/text.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.mjs","sourceRoot":"","sources":["../src/resources/text.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,IAAK,SAAQ,WAAW;IACnC;;OAEG;IACH,QAAQ,CAAC,IAAwB,EAAE,OAAwB;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"text.mjs","sourceRoot":"","sources":["../src/resources/text.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,IAAK,SAAQ,WAAW;IACnC;;OAEG;IACH,QAAQ,CAAC,IAAwB,EAAE,OAAwB;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,IAAyB,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;CACF"}
|