Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌿 Fern Regeneration -- March 4, 2024 #12

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,21 @@ jobs:
- name: Compile
run: yarn && yarn build

test:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up node
uses: actions/setup-node@v3

- name: Compile
run: yarn && yarn test

publish:
needs: [ compile ]
needs: [ compile, test ]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest

Expand Down
5 changes: 5 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
};
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "hume",
"version": "0.4.1",
"version": "0.4.2",
"private": false,
"repository": "https://github.com/HumeAI/hume-typescript-sdk",
"main": "./index.js",
"types": "./index.d.ts",
"scripts": {
"format": "prettier --write 'src/**/*.ts'",
"build": "tsc",
"prepack": "cp -rv dist/. ."
"prepack": "cp -rv dist/. .",
"test": "jest"
},
"dependencies": {
"url-join": "4.0.1",
Expand All @@ -24,6 +25,9 @@
"@types/url-join": "4.0.1",
"@types/qs": "6.9.8",
"@types/node-fetch": "2.6.9",
"jest": "^29.7.0",
"@types/jest": "^29.5.5",
"ts-jest": "^29.1.1",
"@types/node": "17.0.33",
"prettier": "2.7.1",
"typescript": "4.6.4"
Expand Down
32 changes: 20 additions & 12 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,14 @@ export class HumeClient {
* Sort and filter jobs.
*
* @example
* await hume.listJobs({
* status: Hume.Status.Queued,
* when: Hume.When.CreatedBefore,
* sortBy: Hume.SortBy.Created,
* direction: Hume.Direction.Asc
* })
* await hume.listJobs()
*/
public async listJobs(
request: Hume.ListJobsRequest = {},
requestOptions?: HumeClient.RequestOptions
): Promise<Hume.JobRequest[]> {
const { limit, status, when, timestampMs, sortBy, direction } = request;
const _queryParams: Record<string, string | string[]> = {};
const _queryParams: Record<string, string | string[] | object | object[]> = {};
if (limit != null) {
_queryParams["limit"] = limit.toString();
}
Expand Down Expand Up @@ -80,7 +75,9 @@ export class HumeClient {
"X-Hume-Api-Key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "hume",
"X-Fern-SDK-Version": "0.4.1",
"X-Fern-SDK-Version": "0.4.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -120,6 +117,9 @@ export class HumeClient {

/**
* Start a new batch job.
*
* @example
* await hume.submitJob()
*/
public async submitJob(
request: Hume.BaseRequest = {},
Expand All @@ -135,7 +135,9 @@ export class HumeClient {
"X-Hume-Api-Key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "hume",
"X-Fern-SDK-Version": "0.4.1",
"X-Fern-SDK-Version": "0.4.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
body: await serializers.BaseRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -193,7 +195,9 @@ export class HumeClient {
"X-Hume-Api-Key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "hume",
"X-Fern-SDK-Version": "0.4.1",
"X-Fern-SDK-Version": "0.4.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -244,7 +248,9 @@ export class HumeClient {
"X-Hume-Api-Key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "hume",
"X-Fern-SDK-Version": "0.4.1",
"X-Fern-SDK-Version": "0.4.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
responseType: "streaming",
Expand Down Expand Up @@ -291,7 +297,9 @@ export class HumeClient {
"X-Hume-Api-Key": await core.Supplier.get(this._options.apiKey),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "hume",
"X-Fern-SDK-Version": "0.4.1",
"X-Fern-SDK-Version": "0.4.2",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down
4 changes: 4 additions & 0 deletions src/api/client/requests/BaseRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

import * as Hume from "../..";

/**
* @example
* {}
*/
export interface BaseRequest {
models?: Hume.Models;
transcription?: Hume.Transcription;
Expand Down
7 changes: 1 addition & 6 deletions src/api/client/requests/ListJobsRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ import * as Hume from "../..";

/**
* @example
* {
* status: Hume.Status.Queued,
* when: Hume.When.CreatedBefore,
* sortBy: Hume.SortBy.Created,
* direction: Hume.Direction.Asc
* }
* {}
*/
export interface ListJobsRequest {
/**
Expand Down
1 change: 1 addition & 0 deletions src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./resources";
export * from "./types";
export * from "./client";
2 changes: 2 additions & 0 deletions src/api/resources/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * as websocket from "./websocket";
export * from "./websocket/types";
1 change: 1 addition & 0 deletions src/api/resources/websocket/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./types";
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Hume from "..";
import * as Hume from "../../..";

/**
* Response for the vocal burst emotion model.
*/
export interface BurstResponse {
predictions?: Hume.ModelsSuccessBurstPredictionsItem[];
predictions?: Hume.WebsocketBurstBurstPredictionsItem[];
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Hume from "..";
import * as Hume from "../../..";

/**
* Response for the facial expression emotion model.
*/
export interface FaceResponse {
predictions?: Hume.ModelsSuccessFacePredictionsItem[];
predictions?: Hume.WebsocketBurstFacePredictionsItem[];
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Hume from "..";
import * as Hume from "../../..";

/**
* Response for the facemesh emotion model.
*/
export interface FacemeshResponse {
predictions?: Hume.ModelsSuccessFacemeshPredictionsItem[];
predictions?: Hume.WebsocketBurstFacemeshPredictionsItem[];
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Hume from "..";
import * as Hume from "../../..";

/**
* Response for the language emotion model.
*/
export interface LanguageResponse {
predictions?: Hume.ModelsSuccessLanguagePredictionsItem[];
predictions?: Hume.WebsocketBurstLanguagePredictionsItem[];
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Hume from "..";
import * as Hume from "../../..";

export interface ModelResponse {
/** Response for the vocal burst emotion model. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Hume from "..";
import * as Hume from "../../..";

/**
* Response for the speech prosody emotion model.
*/
export interface ProsodyResponse {
predictions?: Hume.ModelsSuccessProsodyPredictionsItem[];
predictions?: Hume.WebsocketBurstProsodyPredictionsItem[];
}
7 changes: 7 additions & 0 deletions src/api/resources/websocket/types/SubscribeEvent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as Hume from "../../..";

export type SubscribeEvent = Hume.ModelResponse | Hume.WebsocketError | Hume.WebsocketWarning;
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Hume from "..";
import * as Hume from "../../..";

export interface ModelsSuccessProsodyPredictionsItem {
export interface WebsocketBurstBurstPredictionsItem {
time?: Hume.TimeRange;
emotions?: Hume.EmotionEmbedding;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Hume from "..";
import * as Hume from "../../..";

export interface ModelsSuccessFacePredictionsItem {
export interface WebsocketBurstFacePredictionsItem {
/** Frame number */
frame?: number;
/** Time in seconds when face detection occurred. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Hume from "..";
import * as Hume from "../../..";

export interface ModelsSuccessFacemeshPredictionsItem {
export interface WebsocketBurstFacemeshPredictionsItem {
emotions?: Hume.EmotionEmbedding;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Hume from "..";
import * as Hume from "../../..";

export interface ModelsSuccessLanguagePredictionsItem {
export interface WebsocketBurstLanguagePredictionsItem {
/** A segment of text (like a word or a sentence). */
text?: string;
position?: Hume.TextPosition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Hume from "..";
import * as Hume from "../../..";

export interface ModelsSuccessBurstPredictionsItem {
export interface WebsocketBurstProsodyPredictionsItem {
time?: Hume.TimeRange;
emotions?: Hume.EmotionEmbedding;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

export interface ModelsError {
export interface WebsocketError {
/** Error message text. */
error?: string;
/** Unique identifier for the error. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

export interface ModelsWarning {
export interface WebsocketWarning {
/** Warning message text. */
warning?: string;
/** Unique identifier for the error. */
Expand Down
14 changes: 14 additions & 0 deletions src/api/resources/websocket/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export * from "./WebsocketBurstBurstPredictionsItem";
export * from "./BurstResponse";
export * from "./WebsocketBurstFacePredictionsItem";
export * from "./FaceResponse";
export * from "./WebsocketBurstFacemeshPredictionsItem";
export * from "./FacemeshResponse";
export * from "./WebsocketBurstLanguagePredictionsItem";
export * from "./LanguageResponse";
export * from "./WebsocketBurstProsodyPredictionsItem";
export * from "./ProsodyResponse";
export * from "./ModelResponse";
export * from "./WebsocketError";
export * from "./WebsocketWarning";
export * from "./SubscribeEvent";
23 changes: 0 additions & 23 deletions src/api/types/FaceModelConfig.ts

This file was deleted.

15 changes: 0 additions & 15 deletions src/api/types/LanguageConfig.ts

This file was deleted.

Loading
Loading