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 -- April 26, 2024 #20

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
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"node-fetch": "2.7.0",
"qs": "6.11.2",
"ws": "^8.14.2",
"uuid": "9.0.1"
"@types/ws": "^8.5.9",
"uuid": "9.0.1",
"@types/uuid": "9.0.7"
},
"devDependencies": {
"@types/url-join": "4.0.1",
Expand All @@ -28,8 +30,6 @@
"ts-jest": "^29.1.1",
"@types/node": "17.0.33",
"prettier": "2.7.1",
"typescript": "4.6.4",
"@types/ws": "^8.5.9",
"@types/uuid": "9.0.7"
"typescript": "4.6.4"
}
}
14 changes: 7 additions & 7 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import * as environments from "./environments";
import * as core from "./core";
import { CustomModels } from "./api/resources/customModels/client/Client";
import { EmpathicVoice } from "./api/resources/empathicVoice/client/Client";
import { CustomModels } from "./api/resources/customModels/client/Client";
import { ExpressionMeasurement } from "./api/resources/expressionMeasurement/client/Client";

export declare namespace HumeClient {
Expand All @@ -25,18 +25,18 @@ export declare namespace HumeClient {
export class HumeClient {
constructor(protected readonly _options: HumeClient.Options = {}) {}

protected _customModels: CustomModels | undefined;

public get customModels(): CustomModels {
return (this._customModels ??= new CustomModels(this._options));
}

protected _empathicVoice: EmpathicVoice | undefined;

public get empathicVoice(): EmpathicVoice {
return (this._empathicVoice ??= new EmpathicVoice(this._options));
}

protected _customModels: CustomModels | undefined;

public get customModels(): CustomModels {
return (this._customModels ??= new CustomModels(this._options));
}

protected _expressionMeasurement: ExpressionMeasurement | undefined;

public get expressionMeasurement(): ExpressionMeasurement {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ import * as Hume from "../../../../..";
export type PublishEvent =
| Hume.empathicVoice.AudioInput
| Hume.empathicVoice.SessionSettings
| Hume.empathicVoice.TextInput
| Hume.empathicVoice.TtsInput;
| Hume.empathicVoice.UserInput
| Hume.empathicVoice.AssistantInput;
4 changes: 4 additions & 0 deletions src/api/resources/empathicVoice/types/AssistantEnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
* This file was auto-generated by Fern from our API Definition.
*/

/**
* When provided, the output is an assistant end message.
*/
export interface AssistantEnd {
customSessionId?: string;
type: "assistant_end";
}
13 changes: 13 additions & 0 deletions src/api/resources/empathicVoice/types/AssistantInput.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

/**
* When provided, the input is spoken by EVI.
*/
export interface AssistantInput {
customSessionId?: string;
/** Text to be synthesized. */
text: string;
type: "assistant_input";
}
8 changes: 6 additions & 2 deletions src/api/resources/empathicVoice/types/AssistantMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@

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

/**
* When provided, the output is an assistant message.
*/
export interface AssistantMessage {
/** Indicates if this message was constructed from a TtsInput message. */
fromTts: boolean;
customSessionId?: string;
/** Indicates if this message was constructed from a text input message. */
fromText: boolean;
/** ID of the assistant message. */
id?: string;
/** Transcript of the message. */
Expand Down
4 changes: 4 additions & 0 deletions src/api/resources/empathicVoice/types/AudioInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
* This file was auto-generated by Fern from our API Definition.
*/

/**
* When provided, the input is audio.
*/
export interface AudioInput {
customSessionId?: string;
/** Base64 encoded audio input. */
data: string;
type: "audio_input";
Expand Down
6 changes: 5 additions & 1 deletion src/api/resources/empathicVoice/types/AudioOutput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
* This file was auto-generated by Fern from our API Definition.
*/

/**
* When provided, the output is audio.
*/
export interface AudioOutput {
/** Base64 encoded Linear16 PCM output. */
customSessionId?: string;
/** Base64 encoded audio output. */
data: string;
/** ID of the audio output. */
id: string;
Expand Down
4 changes: 4 additions & 0 deletions src/api/resources/empathicVoice/types/Error_.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
* This file was auto-generated by Fern from our API Definition.
*/

/**
* When provided, the output is an error message.
*/
export interface Error_ {
/** Error code. */
code: string;
customSessionId?: string;
/** Error message. */
message: string;
/** Error slug. */
Expand Down
7 changes: 6 additions & 1 deletion src/api/resources/empathicVoice/types/SessionSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@

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

/**
* Settings for this chat session.
*/
export interface SessionSettings {
customSessionId?: string;
audio?: Hume.empathicVoice.AudioConfiguration;
languageModelApiKey?: string;
type?: "session_settings";
systemPrompt?: string;
type: "session_settings";
}
4 changes: 1 addition & 3 deletions src/api/resources/empathicVoice/types/TextInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@
*/

export interface TextInput {
/** Text to insert into the conversation. */
text: string;
type: "user_input";
type?: "text_input";
}
4 changes: 1 addition & 3 deletions src/api/resources/empathicVoice/types/TtsInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@
*/

export interface TtsInput {
/** Text to be synthesized. */
text: string;
type: "assistant_input";
type?: "tts";
}
13 changes: 13 additions & 0 deletions src/api/resources/empathicVoice/types/UserInput.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

/**
* User text to insert into the conversation.
*/
export interface UserInput {
customSessionId?: string;
/** User text to insert into the conversation. */
text: string;
type: "user_input";
}
4 changes: 4 additions & 0 deletions src/api/resources/empathicVoice/types/UserInterruption.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
* This file was auto-generated by Fern from our API Definition.
*/

/**
* When provided, the output is an interruption.
*/
export interface UserInterruption {
customSessionId?: string;
time: number;
type: "user_interruption";
}
6 changes: 4 additions & 2 deletions src/api/resources/empathicVoice/types/UserMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@

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

/**
* When provided, the output is a user message.
*/
export interface UserMessage {
customSessionId?: string;
/** Indicates if this message was constructed from a text input message. */
fromText: boolean;
/** Transcript of the message. */
message: Hume.empathicVoice.ChatMessage;
/** Inference model results. */
models: Hume.empathicVoice.Inference;
/** Segments of the user message. */
serializedSegments: Record<string, unknown>[];
/** Start and End time of user message. */
time: Hume.empathicVoice.MillisecondInterval;
type: "user_message";
Expand Down
6 changes: 4 additions & 2 deletions src/api/resources/empathicVoice/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export * from "./ReturnChatWithPagedEvents";
export * from "./ReturnActiveChatCount";
export * from "./ReturnActiveChatCountPerTag";
export * from "./AssistantEnd";
export * from "./AssistantInput";
export * from "./AssistantMessage";
export * from "./AudioConfiguration";
export * from "./AudioInput";
Expand All @@ -34,8 +35,9 @@ export * from "./MillisecondInterval";
export * from "./ProsodyInference";
export * from "./Role";
export * from "./SessionSettings";
export * from "./TextInput";
export * from "./TtsInput";
export * from "./UserInput";
export * from "./UserInterruption";
export * from "./UserMessage";
export * from "./TtsInput";
export * from "./TextInput";
export * from "./FunctionCallResponseInput";
2 changes: 1 addition & 1 deletion src/api/resources/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * as customModels from "./customModels";
export * as empathicVoice from "./empathicVoice";
export * as customModels from "./customModels";
export * as expressionMeasurement from "./expressionMeasurement";
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import * as Hume from "../../../../../../api";
import * as core from "../../../../../../core";
import { AudioInput } from "../../../types/AudioInput";
import { SessionSettings } from "../../../types/SessionSettings";
import { TextInput } from "../../../types/TextInput";
import { TtsInput } from "../../../types/TtsInput";
import { UserInput } from "../../../types/UserInput";
import { AssistantInput } from "../../../types/AssistantInput";

export const PublishEvent: core.serialization.Schema<
serializers.empathicVoice.PublishEvent.Raw,
Hume.empathicVoice.PublishEvent
> = core.serialization.undiscriminatedUnion([AudioInput, SessionSettings, TextInput, TtsInput]);
> = core.serialization.undiscriminatedUnion([AudioInput, SessionSettings, UserInput, AssistantInput]);

export declare namespace PublishEvent {
type Raw = AudioInput.Raw | SessionSettings.Raw | TextInput.Raw | TtsInput.Raw;
type Raw = AudioInput.Raw | SessionSettings.Raw | UserInput.Raw | AssistantInput.Raw;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ export const AssistantEnd: core.serialization.ObjectSchema<
serializers.empathicVoice.AssistantEnd.Raw,
Hume.empathicVoice.AssistantEnd
> = core.serialization.object({
customSessionId: core.serialization.property("custom_session_id", core.serialization.string().optional()),
type: core.serialization.stringLiteral("assistant_end"),
});

export declare namespace AssistantEnd {
interface Raw {
custom_session_id?: string | null;
type: "assistant_end";
}
}
24 changes: 24 additions & 0 deletions src/serialization/resources/empathicVoice/types/AssistantInput.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as serializers from "../../..";
import * as Hume from "../../../../api";
import * as core from "../../../../core";

export const AssistantInput: core.serialization.ObjectSchema<
serializers.empathicVoice.AssistantInput.Raw,
Hume.empathicVoice.AssistantInput
> = core.serialization.object({
customSessionId: core.serialization.property("custom_session_id", core.serialization.string().optional()),
text: core.serialization.string(),
type: core.serialization.stringLiteral("assistant_input"),
});

export declare namespace AssistantInput {
interface Raw {
custom_session_id?: string | null;
text: string;
type: "assistant_input";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export const AssistantMessage: core.serialization.ObjectSchema<
serializers.empathicVoice.AssistantMessage.Raw,
Hume.empathicVoice.AssistantMessage
> = core.serialization.object({
fromTts: core.serialization.property("from_tts", core.serialization.boolean()),
customSessionId: core.serialization.property("custom_session_id", core.serialization.string().optional()),
fromText: core.serialization.property("from_text", core.serialization.boolean()),
id: core.serialization.string().optional(),
message: ChatMessage,
models: Inference,
Expand All @@ -21,7 +22,8 @@ export const AssistantMessage: core.serialization.ObjectSchema<

export declare namespace AssistantMessage {
interface Raw {
from_tts: boolean;
custom_session_id?: string | null;
from_text: boolean;
id?: string | null;
message: ChatMessage.Raw;
models: Inference.Raw;
Expand Down
2 changes: 2 additions & 0 deletions src/serialization/resources/empathicVoice/types/AudioInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ export const AudioInput: core.serialization.ObjectSchema<
serializers.empathicVoice.AudioInput.Raw,
Hume.empathicVoice.AudioInput
> = core.serialization.object({
customSessionId: core.serialization.property("custom_session_id", core.serialization.string().optional()),
data: core.serialization.string(),
type: core.serialization.stringLiteral("audio_input"),
});

export declare namespace AudioInput {
interface Raw {
custom_session_id?: string | null;
data: string;
type: "audio_input";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ export const AudioOutput: core.serialization.ObjectSchema<
serializers.empathicVoice.AudioOutput.Raw,
Hume.empathicVoice.AudioOutput
> = core.serialization.object({
customSessionId: core.serialization.property("custom_session_id", core.serialization.string().optional()),
data: core.serialization.string(),
id: core.serialization.string(),
type: core.serialization.stringLiteral("audio_output"),
});

export declare namespace AudioOutput {
interface Raw {
custom_session_id?: string | null;
data: string;
id: string;
type: "audio_output";
Expand Down
2 changes: 2 additions & 0 deletions src/serialization/resources/empathicVoice/types/Error_.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import * as core from "../../../../core";
export const Error_: core.serialization.ObjectSchema<serializers.empathicVoice.Error_.Raw, Hume.empathicVoice.Error_> =
core.serialization.object({
code: core.serialization.string(),
customSessionId: core.serialization.property("custom_session_id", core.serialization.string().optional()),
message: core.serialization.string(),
slug: core.serialization.string(),
type: core.serialization.stringLiteral("error"),
Expand All @@ -17,6 +18,7 @@ export const Error_: core.serialization.ObjectSchema<serializers.empathicVoice.E
export declare namespace Error_ {
interface Raw {
code: string;
custom_session_id?: string | null;
message: string;
slug: string;
type: "error";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ export const SessionSettings: core.serialization.ObjectSchema<
serializers.empathicVoice.SessionSettings.Raw,
Hume.empathicVoice.SessionSettings
> = core.serialization.object({
customSessionId: core.serialization.property("custom_session_id", core.serialization.string().optional()),
audio: AudioConfiguration.optional(),
languageModelApiKey: core.serialization.property("language_model_api_key", core.serialization.string().optional()),
type: core.serialization.stringLiteral("session_settings").optional(),
systemPrompt: core.serialization.property("system_prompt", core.serialization.string().optional()),
type: core.serialization.stringLiteral("session_settings"),
});

export declare namespace SessionSettings {
interface Raw {
custom_session_id?: string | null;
audio?: AudioConfiguration.Raw | null;
language_model_api_key?: string | null;
type?: "session_settings" | null;
system_prompt?: string | null;
type: "session_settings";
}
}
Loading
Loading