Skip to content

Commit 908d25b

Browse files
committed
Release 0.1.3
1 parent 4e20f6f commit 908d25b

File tree

180 files changed

+4059
-59
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+4059
-59
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ node_modules
99
/index.js
1010
/api
1111
/core
12-
/errors
12+
/errors
13+
/serialization

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fern-api/hume",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
44
"private": false,
55
"repository": "https://github.com/fern-hume/hume-typescript-sdk",
66
"main": "./index.js",

src/Client.ts

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import * as environments from "./environments";
66
import * as core from "./core";
77
import * as Hume from "./api";
88
import urlJoin from "url-join";
9+
import * as serializers from "./serialization";
910
import * as errors from "./errors";
1011

1112
export declare namespace HumeClient {
@@ -72,15 +73,20 @@ export class HumeClient {
7273
"X-Hume-Api-Key": await core.Supplier.get(this._options.apiKey),
7374
"X-Fern-Language": "JavaScript",
7475
"X-Fern-SDK-Name": "@fern-api/hume",
75-
"X-Fern-SDK-Version": "0.1.2",
76+
"X-Fern-SDK-Version": "0.1.3",
7677
},
7778
contentType: "application/json",
7879
queryParameters: _queryParams,
7980
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
8081
maxRetries: requestOptions?.maxRetries,
8182
});
8283
if (_response.ok) {
83-
return _response.body as Hume.JobRequest[];
84+
return await serializers.listJobs.Response.parseOrThrow(_response.body, {
85+
unrecognizedObjectKeys: "passthrough",
86+
allowUnrecognizedUnionMembers: true,
87+
allowUnrecognizedEnumValues: true,
88+
breadcrumbsPrefix: ["response"],
89+
});
8490
}
8591

8692
if (_response.error.reason === "status-code") {
@@ -122,15 +128,20 @@ export class HumeClient {
122128
"X-Hume-Api-Key": await core.Supplier.get(this._options.apiKey),
123129
"X-Fern-Language": "JavaScript",
124130
"X-Fern-SDK-Name": "@fern-api/hume",
125-
"X-Fern-SDK-Version": "0.1.2",
131+
"X-Fern-SDK-Version": "0.1.3",
126132
},
127133
contentType: "application/json",
128-
body: request,
134+
body: await serializers.BaseRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
129135
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
130136
maxRetries: requestOptions?.maxRetries,
131137
});
132138
if (_response.ok) {
133-
return _response.body as Hume.JobId;
139+
return await serializers.JobId.parseOrThrow(_response.body, {
140+
unrecognizedObjectKeys: "passthrough",
141+
allowUnrecognizedUnionMembers: true,
142+
allowUnrecognizedEnumValues: true,
143+
breadcrumbsPrefix: ["response"],
144+
});
134145
}
135146

136147
if (_response.error.reason === "status-code") {
@@ -172,14 +183,19 @@ export class HumeClient {
172183
"X-Hume-Api-Key": await core.Supplier.get(this._options.apiKey),
173184
"X-Fern-Language": "JavaScript",
174185
"X-Fern-SDK-Name": "@fern-api/hume",
175-
"X-Fern-SDK-Version": "0.1.2",
186+
"X-Fern-SDK-Version": "0.1.3",
176187
},
177188
contentType: "application/json",
178189
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
179190
maxRetries: requestOptions?.maxRetries,
180191
});
181192
if (_response.ok) {
182-
return _response.body as Hume.SourceResult[];
193+
return await serializers.getJobPredictions.Response.parseOrThrow(_response.body, {
194+
unrecognizedObjectKeys: "passthrough",
195+
allowUnrecognizedUnionMembers: true,
196+
allowUnrecognizedEnumValues: true,
197+
breadcrumbsPrefix: ["response"],
198+
});
183199
}
184200

185201
if (_response.error.reason === "status-code") {
@@ -218,7 +234,7 @@ export class HumeClient {
218234
"X-Hume-Api-Key": await core.Supplier.get(this._options.apiKey),
219235
"X-Fern-Language": "JavaScript",
220236
"X-Fern-SDK-Name": "@fern-api/hume",
221-
"X-Fern-SDK-Version": "0.1.2",
237+
"X-Fern-SDK-Version": "0.1.3",
222238
},
223239
contentType: "application/json",
224240
responseType: "blob",
@@ -265,14 +281,19 @@ export class HumeClient {
265281
"X-Hume-Api-Key": await core.Supplier.get(this._options.apiKey),
266282
"X-Fern-Language": "JavaScript",
267283
"X-Fern-SDK-Name": "@fern-api/hume",
268-
"X-Fern-SDK-Version": "0.1.2",
284+
"X-Fern-SDK-Version": "0.1.3",
269285
},
270286
contentType: "application/json",
271287
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
272288
maxRetries: requestOptions?.maxRetries,
273289
});
274290
if (_response.ok) {
275-
return _response.body as Hume.JobRequest;
291+
return await serializers.JobRequest.parseOrThrow(_response.body, {
292+
unrecognizedObjectKeys: "passthrough",
293+
allowUnrecognizedUnionMembers: true,
294+
allowUnrecognizedEnumValues: true,
295+
breadcrumbsPrefix: ["response"],
296+
});
276297
}
277298

278299
if (_response.error.reason === "status-code") {

src/api/types/Completed.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
export interface Completed {
66
/** When this job was created (Unix timestamp in milliseconds). */
7-
created_timestamp_ms: number;
7+
createdTimestampMs: number;
88
/** When this job started (Unix timestamp in milliseconds). */
9-
started_timestamp_ms: number;
9+
startedTimestampMs: number;
1010
/** When this job ended (Unix timestamp in milliseconds). */
11-
ended_timestamp_ms: number;
11+
endedTimestampMs: number;
1212
/** The number of predictions that were generated by this job. */
13-
num_predictions: number;
13+
numPredictions: number;
1414
/** The number of errors that occurred while running this job. */
15-
num_errors: number;
15+
numErrors: number;
1616
}

src/api/types/Face.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import * as Hume from "..";
66

77
export interface Face {
88
/** Number of frames per second to process. Other frames will be omitted from the response. Set to `0` to process every frame. */
9-
fps_pred?: number;
9+
fpsPred?: number;
1010
/** Face detection probability threshold. Faces detected with a probability less than this threshold will be omitted from the response. */
11-
prob_threshold?: number;
11+
probThreshold?: number;
1212
/** Whether to return identifiers for faces across frames. If `true`, unique identifiers will be assigned to face bounding boxes to differentiate different faces. If `false`, all faces will be tagged with an `unknown` ID. */
13-
identify_faces?: boolean;
13+
identifyFaces?: boolean;
1414
/** Minimum bounding box side length in pixels to treat as a face. Faces detected with a bounding box side length in pixels less than this threshold will be omitted from the response. */
15-
min_face_size?: number;
15+
minFaceSize?: number;
1616
facs?: Hume.Empty;
1717
descriptions?: Hume.Empty;
1818
/** Whether to extract and save the detected faces in the artifacts zip created by each job. */
19-
save_faces?: boolean;
19+
saveFaces?: boolean;
2020
}

src/api/types/FaceModelConfig.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ export interface FaceModelConfig {
1717
* Whether to return identifiers for faces across frames. If true, unique identifiers will be assigned to face bounding boxes to differentiate different faces. If false, all faces will be tagged with an "unknown" ID.
1818
*
1919
*/
20-
identify_faces?: boolean;
20+
identifyFaces?: boolean;
2121
/**
2222
* Number of frames per second to process. Other frames will be omitted from the response.
2323
*
2424
*/
25-
fps_pred?: number;
25+
fpsPred?: number;
2626
/**
2727
* Face detection probability threshold. Faces detected with a probability less than this threshold will be omitted from the response.
2828
*
2929
*/
30-
prob_threshold?: number;
30+
probThreshold?: number;
3131
/**
3232
* Minimum bounding box side length in pixels to treat as a face. Faces detected with a bounding box side length in pixels less than this threshold will be omitted from the response.
3333
*
3434
*/
35-
min_face_size?: number;
35+
minFaceSize?: number;
3636
}

src/api/types/Failed.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
export interface Failed {
66
/** When this job was created (Unix timestamp in milliseconds). */
7-
created_timestamp_ms: number;
7+
createdTimestampMs: number;
88
/** When this job started (Unix timestamp in milliseconds). */
9-
started_timestamp_ms: number;
9+
startedTimestampMs: number;
1010
/** When this job ended (Unix timestamp in milliseconds). */
11-
ended_timestamp_ms: number;
11+
endedTimestampMs: number;
1212
/** An error message. */
1313
message: string;
1414
}

src/api/types/File_.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface File_ {
66
/** The name of the file. */
77
filename?: string;
88
/** The content type of the file. */
9-
content_type?: string;
9+
contentType?: string;
1010
/** The MD5 checksum of the file. */
11-
md5sum: string;
11+
md5Sum: string;
1212
}

src/api/types/InProgress.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
export interface InProgress {
66
/** When this job was created (Unix timestamp in milliseconds). */
7-
created_timestamp_ms: number;
7+
createdTimestampMs: number;
88
/** When this job started (Unix timestamp in milliseconds). */
9-
started_timestamp_ms: number;
9+
startedTimestampMs: number;
1010
}

src/api/types/JobId.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
export interface JobId {
66
/** The ID of the started job. */
7-
job_id: string;
7+
jobId: string;
88
}

0 commit comments

Comments
 (0)