Skip to content

Commit c34e769

Browse files
committed
Release 0.1.2
1 parent da116f0 commit c34e769

File tree

189 files changed

+85
-4097
lines changed

Some content is hidden

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

189 files changed

+85
-4097
lines changed

.gitignore

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

package.json

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

src/Client.ts

+10-31
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ 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";
109
import * as errors from "./errors";
1110

1211
export declare namespace HumeClient {
@@ -73,20 +72,15 @@ export class HumeClient {
7372
"X-Hume-Api-Key": await core.Supplier.get(this._options.apiKey),
7473
"X-Fern-Language": "JavaScript",
7574
"X-Fern-SDK-Name": "@fern-api/hume",
76-
"X-Fern-SDK-Version": "0.1.1",
75+
"X-Fern-SDK-Version": "0.1.2",
7776
},
7877
contentType: "application/json",
7978
queryParameters: _queryParams,
8079
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
8180
maxRetries: requestOptions?.maxRetries,
8281
});
8382
if (_response.ok) {
84-
return await serializers.listJobs.Response.parseOrThrow(_response.body, {
85-
unrecognizedObjectKeys: "passthrough",
86-
allowUnrecognizedUnionMembers: true,
87-
allowUnrecognizedEnumValues: true,
88-
breadcrumbsPrefix: ["response"],
89-
});
83+
return _response.body as Hume.JobRequest[];
9084
}
9185

9286
if (_response.error.reason === "status-code") {
@@ -128,20 +122,15 @@ export class HumeClient {
128122
"X-Hume-Api-Key": await core.Supplier.get(this._options.apiKey),
129123
"X-Fern-Language": "JavaScript",
130124
"X-Fern-SDK-Name": "@fern-api/hume",
131-
"X-Fern-SDK-Version": "0.1.1",
125+
"X-Fern-SDK-Version": "0.1.2",
132126
},
133127
contentType: "application/json",
134-
body: await serializers.BaseRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
128+
body: request,
135129
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
136130
maxRetries: requestOptions?.maxRetries,
137131
});
138132
if (_response.ok) {
139-
return await serializers.JobId.parseOrThrow(_response.body, {
140-
unrecognizedObjectKeys: "passthrough",
141-
allowUnrecognizedUnionMembers: true,
142-
allowUnrecognizedEnumValues: true,
143-
breadcrumbsPrefix: ["response"],
144-
});
133+
return _response.body as Hume.JobId;
145134
}
146135

147136
if (_response.error.reason === "status-code") {
@@ -183,19 +172,14 @@ export class HumeClient {
183172
"X-Hume-Api-Key": await core.Supplier.get(this._options.apiKey),
184173
"X-Fern-Language": "JavaScript",
185174
"X-Fern-SDK-Name": "@fern-api/hume",
186-
"X-Fern-SDK-Version": "0.1.1",
175+
"X-Fern-SDK-Version": "0.1.2",
187176
},
188177
contentType: "application/json",
189178
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
190179
maxRetries: requestOptions?.maxRetries,
191180
});
192181
if (_response.ok) {
193-
return await serializers.getJobPredictions.Response.parseOrThrow(_response.body, {
194-
unrecognizedObjectKeys: "passthrough",
195-
allowUnrecognizedUnionMembers: true,
196-
allowUnrecognizedEnumValues: true,
197-
breadcrumbsPrefix: ["response"],
198-
});
182+
return _response.body as Hume.SourceResult[];
199183
}
200184

201185
if (_response.error.reason === "status-code") {
@@ -234,7 +218,7 @@ export class HumeClient {
234218
"X-Hume-Api-Key": await core.Supplier.get(this._options.apiKey),
235219
"X-Fern-Language": "JavaScript",
236220
"X-Fern-SDK-Name": "@fern-api/hume",
237-
"X-Fern-SDK-Version": "0.1.1",
221+
"X-Fern-SDK-Version": "0.1.2",
238222
},
239223
contentType: "application/json",
240224
responseType: "blob",
@@ -281,19 +265,14 @@ export class HumeClient {
281265
"X-Hume-Api-Key": await core.Supplier.get(this._options.apiKey),
282266
"X-Fern-Language": "JavaScript",
283267
"X-Fern-SDK-Name": "@fern-api/hume",
284-
"X-Fern-SDK-Version": "0.1.1",
268+
"X-Fern-SDK-Version": "0.1.2",
285269
},
286270
contentType: "application/json",
287271
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
288272
maxRetries: requestOptions?.maxRetries,
289273
});
290274
if (_response.ok) {
291-
return await serializers.JobRequest.parseOrThrow(_response.body, {
292-
unrecognizedObjectKeys: "passthrough",
293-
allowUnrecognizedUnionMembers: true,
294-
allowUnrecognizedEnumValues: true,
295-
breadcrumbsPrefix: ["response"],
296-
});
275+
return _response.body as Hume.JobRequest;
297276
}
298277

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

src/api/types/ModelsSuccessBurst.ts renamed to src/api/types/BurstResponse.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ import * as Hume from "..";
77
/**
88
* Response for the vocal burst emotion model.
99
*/
10-
export interface ModelsSuccessBurst {
10+
export interface BurstResponse {
1111
predictions?: Hume.ModelsSuccessBurstPredictionsItem[];
1212
}

src/api/types/Completed.ts

+5-5
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-
createdTimestampMs: number;
7+
created_timestamp_ms: number;
88
/** When this job started (Unix timestamp in milliseconds). */
9-
startedTimestampMs: number;
9+
started_timestamp_ms: number;
1010
/** When this job ended (Unix timestamp in milliseconds). */
11-
endedTimestampMs: number;
11+
ended_timestamp_ms: number;
1212
/** The number of predictions that were generated by this job. */
13-
numPredictions: number;
13+
num_predictions: number;
1414
/** The number of errors that occurred while running this job. */
15-
numErrors: number;
15+
num_errors: number;
1616
}

src/api/types/Face.ts

+5-5
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-
fpsPred?: number;
9+
fps_pred?: number;
1010
/** Face detection probability threshold. Faces detected with a probability less than this threshold will be omitted from the response. */
11-
probThreshold?: number;
11+
prob_threshold?: 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-
identifyFaces?: boolean;
13+
identify_faces?: 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-
minFaceSize?: number;
15+
min_face_size?: 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-
saveFaces?: boolean;
19+
save_faces?: boolean;
2020
}

src/api/types/ModelsInputModelsFace.ts renamed to src/api/types/FaceModelConfig.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Note: Using the `reset_stream` parameter does not have any effect on face identification. A single face identifier cache is maintained over a full session whether `reset_stream` is used or not.
99
*
1010
*/
11-
export interface ModelsInputModelsFace {
11+
export interface FaceModelConfig {
1212
/** Configuration for FACS predictions. If missing or null, no FACS predictions will be generated. */
1313
facs?: Record<string, unknown>;
1414
/** Configuration for Descriptions predictions. If missing or null, no Descriptions predictions will be generated. */
@@ -17,20 +17,20 @@ export interface ModelsInputModelsFace {
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-
identifyFaces?: boolean;
20+
identify_faces?: boolean;
2121
/**
2222
* Number of frames per second to process. Other frames will be omitted from the response.
2323
*
2424
*/
25-
fpsPred?: number;
25+
fps_pred?: 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-
probThreshold?: number;
30+
prob_threshold?: 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-
minFaceSize?: number;
35+
min_face_size?: number;
3636
}

src/api/types/ModelsSuccessFace.ts renamed to src/api/types/FaceResponse.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ import * as Hume from "..";
77
/**
88
* Response for the facial expression emotion model.
99
*/
10-
export interface ModelsSuccessFace {
10+
export interface FaceResponse {
1111
predictions?: Hume.ModelsSuccessFacePredictionsItem[];
1212
}

src/api/types/ModelsSuccessFacemesh.ts renamed to src/api/types/FacemeshResponse.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ import * as Hume from "..";
77
/**
88
* Response for the facemesh emotion model.
99
*/
10-
export interface ModelsSuccessFacemesh {
10+
export interface FacemeshResponse {
1111
predictions?: Hume.ModelsSuccessFacemeshPredictionsItem[];
1212
}

src/api/types/Failed.ts

+3-3
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-
createdTimestampMs: number;
7+
created_timestamp_ms: number;
88
/** When this job started (Unix timestamp in milliseconds). */
9-
startedTimestampMs: number;
9+
started_timestamp_ms: number;
1010
/** When this job ended (Unix timestamp in milliseconds). */
11-
endedTimestampMs: number;
11+
ended_timestamp_ms: number;
1212
/** An error message. */
1313
message: string;
1414
}

src/api/types/File_.ts

+2-2
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-
contentType?: string;
9+
content_type?: string;
1010
/** The MD5 checksum of the file. */
11-
md5Sum: string;
11+
md5sum: string;
1212
}

src/api/types/InProgress.ts

+2-2
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-
createdTimestampMs: number;
7+
created_timestamp_ms: number;
88
/** When this job started (Unix timestamp in milliseconds). */
9-
startedTimestampMs: number;
9+
started_timestamp_ms: number;
1010
}

src/api/types/JobId.ts

+1-1
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-
jobId: string;
7+
job_id: string;
88
}

src/api/types/JobRequest.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import * as Hume from "..";
66

77
export interface JobRequest {
8-
userId: string;
9-
jobId: string;
8+
user_id: string;
9+
job_id: string;
1010
request: Hume.Request;
1111
state: Hume.State;
1212
}

src/api/types/Language.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as Hume from "..";
77
export interface Language {
88
granularity?: Hume.Granularity;
99
/** Whether to return identifiers for speakers over time. If `true`, unique identifiers will be assigned to spoken words to differentiate different speakers. If `false`, all speakers will be tagged with an `unknown` ID. */
10-
identifySpeakers?: boolean;
10+
identify_speakers?: boolean;
1111
sentiment?: Hume.Empty;
1212
toxicity?: Hume.Empty;
1313
}

src/api/types/ModelsInputModelsLanguage.ts renamed to src/api/types/LanguageConfig.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* Configuration for the language emotion model.
77
*/
8-
export interface ModelsInputModelsLanguage {
8+
export interface LanguageConfig {
99
/** Configuration for sentiment predictions. If missing or null, no sentiment predictions will be generated. */
1010
sentiment?: Record<string, unknown>;
1111
/** Configuration for toxicity predictions. If missing or null, no toxicity predictions will be generated. */

src/api/types/LanguagePrediction.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export interface LanguagePrediction {
1212
/** Value between `0.0` and `1.0` that indicates our transcription model’s relative confidence in this text. */
1313
confidence?: number;
1414
/** Value between `0.0` and `1.0` that indicates our transcription model’s relative confidence that this text was spoken by this speaker. */
15-
speakerConfidence?: number;
15+
speaker_confidence?: number;
1616
/** A high-dimensional embedding in emotion space. */
1717
emotions: Hume.EmotionScore[];
1818
/**

src/api/types/ModelsSuccessLanguage.ts renamed to src/api/types/LanguageResponse.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ import * as Hume from "..";
77
/**
88
* Response for the language emotion model.
99
*/
10-
export interface ModelsSuccessLanguage {
10+
export interface LanguageResponse {
1111
predictions?: Hume.ModelsSuccessLanguagePredictionsItem[];
1212
}

src/api/types/ModelsInputModels.ts renamed to src/api/types/ModelConfig.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as Hume from "..";
88
* Configuration used to specify which models should be used and with what settings.
99
*
1010
*/
11-
export interface ModelsInputModels {
11+
export interface ModelConfig {
1212
/**
1313
* Configuration for the vocal burst emotion model.
1414
*
@@ -24,7 +24,7 @@ export interface ModelsInputModels {
2424
* Note: Using the `reset_stream` parameter does not have any effect on face identification. A single face identifier cache is maintained over a full session whether `reset_stream` is used or not.
2525
*
2626
*/
27-
face?: Hume.ModelsInputModelsFace;
27+
face?: Hume.FaceModelConfig;
2828
/**
2929
* Configuration for the facemesh emotion model.
3030
*
@@ -35,7 +35,7 @@ export interface ModelsInputModels {
3535
*/
3636
facemesh?: Record<string, unknown>;
3737
/** Configuration for the language emotion model. */
38-
language?: Hume.ModelsInputModelsLanguage;
38+
language?: Hume.LanguageConfig;
3939
/**
4040
* Configuration for the speech prosody emotion model.
4141
*

src/api/types/ModelsSuccess.ts renamed to src/api/types/ModelResponse.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
import * as Hume from "..";
66

7-
export interface ModelsSuccess {
7+
export interface ModelResponse {
88
/** Response for the vocal burst emotion model. */
9-
burst?: Hume.ModelsSuccessBurst;
9+
burst?: Hume.BurstResponse;
1010
/** Response for the facial expression emotion model. */
11-
face?: Hume.ModelsSuccessFace;
11+
face?: Hume.FaceResponse;
1212
/** Response for the facemesh emotion model. */
13-
facemesh?: Hume.ModelsSuccessFacemesh;
13+
facemesh?: Hume.FacemeshResponse;
1414
/** Response for the language emotion model. */
15-
language?: Hume.ModelsSuccessLanguage;
15+
language?: Hume.LanguageResponse;
1616
/** Response for the speech prosody emotion model. */
17-
prosody?: Hume.ModelsSuccessProsody;
17+
prosody?: Hume.ProsodyResponse;
1818
}

0 commit comments

Comments
 (0)