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

+2-1
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

+1-1
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

+31-10
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

+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-
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

+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-
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

+4-4
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

+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-
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

+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-
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

+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-
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

+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-
job_id: string;
7+
jobId: 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-
user_id: string;
9-
job_id: string;
8+
userId: string;
9+
jobId: 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-
identify_speakers?: boolean;
10+
identifySpeakers?: boolean;
1111
sentiment?: Hume.Empty;
1212
toxicity?: Hume.Empty;
1313
}

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-
speaker_confidence?: number;
15+
speakerConfidence?: number;
1616
/** A high-dimensional embedding in emotion space. */
1717
emotions: Hume.EmotionScore[];
1818
/**

src/api/types/ModelsInput.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface ModelsInput {
2323
* Note: This feature is currently only supported for audio data and audio models. For other file types and models this parameter will be ignored.
2424
*
2525
*/
26-
stream_window_ms?: number;
26+
streamWindowMs?: number;
2727
/**
2828
* Whether to reset the streaming sliding window before processing the current payload.
2929
*
@@ -32,13 +32,13 @@ export interface ModelsInput {
3232
* Use reset_stream when one audio file is done being processed and you do not want context to leak across files.
3333
*
3434
*/
35-
reset_stream?: boolean;
35+
resetStream?: boolean;
3636
/**
3737
* Set to `true` to enable the data parameter to be parsed as raw text rather than base64 encoded bytes.
3838
* This parameter is useful if you want to send text to be processed by the language model, but it cannot be used with other file types like audio, image, or video.
3939
*
4040
*/
41-
raw_text?: boolean;
41+
rawText?: boolean;
4242
/**
4343
* Set to `true` to get details about the job.
4444
*
@@ -47,12 +47,12 @@ export interface ModelsInput {
4747
* This parameter is useful to get the unique job ID.
4848
*
4949
*/
50-
job_details?: boolean;
50+
jobDetails?: boolean;
5151
/**
5252
* Pass an arbitrary string as the payload ID and get it back at the top level of the socket response.
5353
*
5454
* This can be useful if you have multiple requests running asynchronously and want to disambiguate responses as they are received.
5555
*
5656
*/
57-
payload_id?: string;
57+
payloadId?: string;
5858
}

src/api/types/ModelsSuccessFacePredictionsItem.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export interface ModelsSuccessFacePredictionsItem {
1313
/** The predicted probability that a detected face was actually a face. */
1414
prob?: number;
1515
/** Identifier for a face. Not that this defaults to `unknown` unless face identification is enabled in the face model configuration. */
16-
face_id?: string;
16+
faceId?: string;
1717
emotions?: Hume.EmotionEmbedding;
1818
facs?: Hume.EmotionEmbedding;
1919
descriptions?: Hume.EmotionEmbedding;

src/api/types/Ner.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
export interface Ner {
66
/** 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. */
7-
identify_speakers?: boolean;
7+
identifySpeakers?: boolean;
88
}

src/api/types/NerPrediction.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ export interface NerPrediction {
99
entity: string;
1010
position: Hume.PositionInterval;
1111
/** Our NER model's relative confidence in the recognized topic or entity. */
12-
entity_confidence: number;
12+
entityConfidence: number;
1313
/** A measure of how often the entity is linked to by other entities. */
1414
support: number;
1515
/** A URL which provides more information about the recognized topic or entity. */
1616
uri: string;
1717
/** The specific word to which the emotion predictions are linked. */
18-
link_word: string;
18+
linkWord: string;
1919
time?: Hume.TimeInterval;
2020
/** Value between `0.0` and `1.0` that indicates our transcription model’s relative confidence in this text. */
2121
confidence?: number;
2222
/** Value between `0.0` and `1.0` that indicates our transcription model’s relative confidence that this text was spoken by this speaker. */
23-
speaker_confidence?: number;
23+
speakerConfidence?: number;
2424
/** A high-dimensional embedding in emotion space. */
2525
emotions: Hume.EmotionScore[];
2626
}

src/api/types/PredictionsOptionalNullBurstPrediction.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ import * as Hume from "..";
66

77
export interface PredictionsOptionalNullBurstPrediction {
88
metadata?: Hume.Null;
9-
grouped_predictions: Hume.GroupedPredictionsBurstPrediction[];
9+
groupedPredictions: Hume.GroupedPredictionsBurstPrediction[];
1010
}

src/api/types/PredictionsOptionalNullFacePrediction.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ import * as Hume from "..";
66

77
export interface PredictionsOptionalNullFacePrediction {
88
metadata?: Hume.Null;
9-
grouped_predictions: Hume.GroupedPredictionsFacePrediction[];
9+
groupedPredictions: Hume.GroupedPredictionsFacePrediction[];
1010
}

src/api/types/PredictionsOptionalNullFacemeshPrediction.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ import * as Hume from "..";
66

77
export interface PredictionsOptionalNullFacemeshPrediction {
88
metadata?: Hume.Null;
9-
grouped_predictions: Hume.GroupedPredictionsFacemeshPrediction[];
9+
groupedPredictions: Hume.GroupedPredictionsFacemeshPrediction[];
1010
}

src/api/types/PredictionsOptionalTranscriptionMetadataLanguagePrediction.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ import * as Hume from "..";
66

77
export interface PredictionsOptionalTranscriptionMetadataLanguagePrediction {
88
metadata?: Hume.TranscriptionMetadata;
9-
grouped_predictions: Hume.GroupedPredictionsLanguagePrediction[];
9+
groupedPredictions: Hume.GroupedPredictionsLanguagePrediction[];
1010
}

src/api/types/PredictionsOptionalTranscriptionMetadataNerPrediction.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ import * as Hume from "..";
66

77
export interface PredictionsOptionalTranscriptionMetadataNerPrediction {
88
metadata?: Hume.TranscriptionMetadata;
9-
grouped_predictions: Hume.GroupedPredictionsNerPrediction[];
9+
groupedPredictions: Hume.GroupedPredictionsNerPrediction[];
1010
}

src/api/types/PredictionsOptionalTranscriptionMetadataProsodyPrediction.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ import * as Hume from "..";
66

77
export interface PredictionsOptionalTranscriptionMetadataProsodyPrediction {
88
metadata?: Hume.TranscriptionMetadata;
9-
grouped_predictions: Hume.GroupedPredictionsProsodyPrediction[];
9+
groupedPredictions: Hume.GroupedPredictionsProsodyPrediction[];
1010
}

src/api/types/Prosody.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ import * as Hume from "..";
1010
export interface Prosody {
1111
granularity?: Hume.Granularity;
1212
/** 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. */
13-
identify_speakers?: boolean;
13+
identifySpeakers?: boolean;
1414
window?: Hume.Window;
1515
}

src/api/types/ProsodyPrediction.ts

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

0 commit comments

Comments
 (0)