Skip to content

Latest commit

Β 

History

History
3360 lines (2348 loc) Β· 51.1 KB

File metadata and controls

3360 lines (2348 loc) Β· 51.1 KB

Reference

EmpathicVoice ControlPlane

client.empathicVoice.controlPlane.send(chat_id, { ...params }) -> void

πŸ“ Description

Send a message to a specific chat.

πŸ”Œ Usage

await client.empathicVoice.controlPlane.send("chat_id", {
    type: "session_settings"
});

βš™οΈ Parameters

chat_id: string

request: Hume.ControlPlanePublishEvent

requestOptions: ControlPlaneClient.RequestOptions

EmpathicVoice ChatGroups

client.empathicVoice.chatGroups.listChatGroups({ ...params }) -> core.Page<Hume.ReturnChatGroup, Hume.ReturnPagedChatGroups>

πŸ“ Description

Fetches a paginated list of Chat Groups.

πŸ”Œ Usage

const pageableResponse = await client.empathicVoice.chatGroups.listChatGroups({
    pageNumber: 0,
    pageSize: 1,
    ascendingOrder: true,
    configId: "your-config-id"
});
for await (const item of pageableResponse) {
    console.log(item);
}

// Or you can manually iterate page-by-page
let page = await client.empathicVoice.chatGroups.listChatGroups({
    pageNumber: 0,
    pageSize: 1,
    ascendingOrder: true,
    configId: "your-config-id"
});
while (page.hasNextPage()) {
    page = page.getNextPage();
}

// You can also access the underlying response
const response = page.response;

βš™οΈ Parameters

request: Hume.empathicVoice.ChatGroupsListChatGroupsRequest

requestOptions: ChatGroupsClient.RequestOptions

client.empathicVoice.chatGroups.getChatGroup(id, { ...params }) -> Hume.ReturnChatGroupPagedChats

πŸ“ Description

Fetches a ChatGroup by ID, including a paginated list of Chats associated with the ChatGroup.

πŸ”Œ Usage

await client.empathicVoice.chatGroups.getChatGroup("your-chat-group-id", {
    pageNumber: 0,
    pageSize: 1,
    ascendingOrder: true
});

βš™οΈ Parameters

id: string β€” Identifier for a Chat Group. Formatted as a UUID.

request: Hume.empathicVoice.ChatGroupsGetChatGroupRequest

requestOptions: ChatGroupsClient.RequestOptions

client.empathicVoice.chatGroups.getAudio(id, { ...params }) -> Hume.ReturnChatGroupPagedAudioReconstructions

πŸ“ Description

Fetches a paginated list of audio for each Chat within the specified Chat Group. For more details, see our guide on audio reconstruction here.

πŸ”Œ Usage

await client.empathicVoice.chatGroups.getAudio("your-chat-group-id", {
    pageNumber: 0,
    pageSize: 10,
    ascendingOrder: true
});

βš™οΈ Parameters

id: string β€” Identifier for a Chat Group. Formatted as a UUID.

request: Hume.empathicVoice.ChatGroupsGetAudioRequest

requestOptions: ChatGroupsClient.RequestOptions

client.empathicVoice.chatGroups.listChatGroupEvents(id, { ...params }) -> core.Page<Hume.ReturnChatEvent, Hume.ReturnChatGroupPagedEvents>

πŸ“ Description

Fetches a paginated list of Chat events associated with a Chat Group.

πŸ”Œ Usage

const pageableResponse = await client.empathicVoice.chatGroups.listChatGroupEvents("your-chat-group-id", {
    pageNumber: 0,
    pageSize: 3,
    ascendingOrder: true
});
for await (const item of pageableResponse) {
    console.log(item);
}

// Or you can manually iterate page-by-page
let page = await client.empathicVoice.chatGroups.listChatGroupEvents("your-chat-group-id", {
    pageNumber: 0,
    pageSize: 3,
    ascendingOrder: true
});
while (page.hasNextPage()) {
    page = page.getNextPage();
}

// You can also access the underlying response
const response = page.response;

βš™οΈ Parameters

id: string β€” Identifier for a Chat Group. Formatted as a UUID.

request: Hume.empathicVoice.ChatGroupsListChatGroupEventsRequest

requestOptions: ChatGroupsClient.RequestOptions

EmpathicVoice Chats

client.empathicVoice.chats.listChats({ ...params }) -> core.Page<Hume.ReturnChat, Hume.ReturnPagedChats>

πŸ“ Description

Fetches a paginated list of Chats.

πŸ”Œ Usage

const pageableResponse = await client.empathicVoice.chats.listChats({
    pageNumber: 0,
    pageSize: 1,
    ascendingOrder: true
});
for await (const item of pageableResponse) {
    console.log(item);
}

// Or you can manually iterate page-by-page
let page = await client.empathicVoice.chats.listChats({
    pageNumber: 0,
    pageSize: 1,
    ascendingOrder: true
});
while (page.hasNextPage()) {
    page = page.getNextPage();
}

// You can also access the underlying response
const response = page.response;

βš™οΈ Parameters

request: Hume.empathicVoice.ChatsListChatsRequest

requestOptions: ChatsClient.RequestOptions

client.empathicVoice.chats.listChatEvents(id, { ...params }) -> core.Page<Hume.ReturnChatEvent, Hume.ReturnChatPagedEvents>

πŸ“ Description

Fetches a paginated list of Chat events.

πŸ”Œ Usage

const pageableResponse = await client.empathicVoice.chats.listChatEvents("your-chat-id", {
    pageNumber: 0,
    pageSize: 3,
    ascendingOrder: true
});
for await (const item of pageableResponse) {
    console.log(item);
}

// Or you can manually iterate page-by-page
let page = await client.empathicVoice.chats.listChatEvents("your-chat-id", {
    pageNumber: 0,
    pageSize: 3,
    ascendingOrder: true
});
while (page.hasNextPage()) {
    page = page.getNextPage();
}

// You can also access the underlying response
const response = page.response;

βš™οΈ Parameters

id: string β€” Identifier for a Chat. Formatted as a UUID.

request: Hume.empathicVoice.ChatsListChatEventsRequest

requestOptions: ChatsClient.RequestOptions

client.empathicVoice.chats.getAudio(id) -> Hume.ReturnChatAudioReconstruction

πŸ“ Description

Fetches the audio of a previous Chat. For more details, see our guide on audio reconstruction here.

πŸ”Œ Usage

await client.empathicVoice.chats.getAudio("your-chat-id");

βš™οΈ Parameters

id: string β€” Identifier for a Chat. Formatted as a UUID.

requestOptions: ChatsClient.RequestOptions

EmpathicVoice Configs

client.empathicVoice.configs.listConfigs({ ...params }) -> core.Page<Hume.ReturnConfig, Hume.ReturnPagedConfigs>

πŸ“ Description

Fetches a paginated list of Configs.

For more details on configuration options and how to configure EVI, see our configuration guide.

πŸ”Œ Usage

const pageableResponse = await client.empathicVoice.configs.listConfigs({
    pageNumber: 0,
    pageSize: 1
});
for await (const item of pageableResponse) {
    console.log(item);
}

// Or you can manually iterate page-by-page
let page = await client.empathicVoice.configs.listConfigs({
    pageNumber: 0,
    pageSize: 1
});
while (page.hasNextPage()) {
    page = page.getNextPage();
}

// You can also access the underlying response
const response = page.response;

βš™οΈ Parameters

request: Hume.empathicVoice.ConfigsListConfigsRequest

requestOptions: ConfigsClient.RequestOptions

client.empathicVoice.configs.createConfig({ ...params }) -> Hume.ReturnConfig

πŸ“ Description

Creates a Config which can be applied to EVI.

For more details on configuration options and how to configure EVI, see our configuration guide.

πŸ”Œ Usage

await client.empathicVoice.configs.createConfig({
    name: "Weather Assistant Config",
    prompt: {
        id: "",
        version: 0
    },
    eviVersion: "3",
    voice: {
        provider: "HUME_AI",
        name: "Ava Song"
    },
    languageModel: {
        modelProvider: "ANTHROPIC",
        modelResource: "claude-3-7-sonnet-latest",
        temperature: 1
    },
    eventMessages: {
        onNewChat: {
            enabled: false,
            text: ""
        },
        onInactivityTimeout: {
            enabled: false,
            text: ""
        },
        onMaxDurationTimeout: {
            enabled: false,
            text: ""
        }
    }
});

βš™οΈ Parameters

request: Hume.empathicVoice.PostedConfig

requestOptions: ConfigsClient.RequestOptions

client.empathicVoice.configs.listConfigVersions(id, { ...params }) -> core.Page<Hume.ReturnConfig, Hume.ReturnPagedConfigs>

πŸ“ Description

Fetches a list of a Config's versions.

For more details on configuration options and how to configure EVI, see our configuration guide.

πŸ”Œ Usage

const pageableResponse = await client.empathicVoice.configs.listConfigVersions("your-config-id");
for await (const item of pageableResponse) {
    console.log(item);
}

// Or you can manually iterate page-by-page
let page = await client.empathicVoice.configs.listConfigVersions("your-config-id");
while (page.hasNextPage()) {
    page = page.getNextPage();
}

// You can also access the underlying response
const response = page.response;

βš™οΈ Parameters

id: string β€” Identifier for a Config. Formatted as a UUID.

request: Hume.empathicVoice.ConfigsListConfigVersionsRequest

requestOptions: ConfigsClient.RequestOptions

client.empathicVoice.configs.createConfigVersion(id, { ...params }) -> Hume.ReturnConfig

πŸ“ Description

Updates a Config by creating a new version of the Config.

For more details on configuration options and how to configure EVI, see our configuration guide.

πŸ”Œ Usage

await client.empathicVoice.configs.createConfigVersion("your-config-id", {
    versionDescription: "This is an updated version of the Weather Assistant Config.",
    eviVersion: "3",
    prompt: {
        id: "",
        version: 0
    },
    voice: {
        provider: "HUME_AI",
        name: "Ava Song"
    },
    languageModel: {
        modelProvider: "ANTHROPIC",
        modelResource: "claude-3-7-sonnet-latest",
        temperature: 1
    },
    ellmModel: {
        allowShortResponses: true
    },
    eventMessages: {
        onNewChat: {
            enabled: false,
            text: ""
        },
        onInactivityTimeout: {
            enabled: false,
            text: ""
        },
        onMaxDurationTimeout: {
            enabled: false,
            text: ""
        }
    }
});

βš™οΈ Parameters

id: string β€” Identifier for a Config. Formatted as a UUID.

request: Hume.empathicVoice.PostedConfigVersion

requestOptions: ConfigsClient.RequestOptions

client.empathicVoice.configs.deleteConfig(id) -> void

πŸ“ Description

Deletes a Config and its versions.

For more details on configuration options and how to configure EVI, see our configuration guide.

πŸ”Œ Usage

await client.empathicVoice.configs.deleteConfig("your-config-id");

βš™οΈ Parameters

id: string β€” Identifier for a Config. Formatted as a UUID.

requestOptions: ConfigsClient.RequestOptions

client.empathicVoice.configs.updateConfigName(id, { ...params }) -> string

πŸ“ Description

Updates the name of a Config.

For more details on configuration options and how to configure EVI, see our configuration guide.

πŸ”Œ Usage

await client.empathicVoice.configs.updateConfigName("your-config-id", {
    name: "Updated Weather Assistant Config Name"
});

βš™οΈ Parameters

id: string β€” Identifier for a Config. Formatted as a UUID.

request: Hume.empathicVoice.PostedConfigName

requestOptions: ConfigsClient.RequestOptions

client.empathicVoice.configs.getConfigVersion(id, version) -> Hume.ReturnConfig

πŸ“ Description

Fetches a specified version of a Config.

For more details on configuration options and how to configure EVI, see our configuration guide.

πŸ”Œ Usage

await client.empathicVoice.configs.getConfigVersion("your-config-id", 1);

βš™οΈ Parameters

id: string β€” Identifier for a Config. Formatted as a UUID.

version: number

Version number for a Config.

Configs, Prompts, Custom Voices, and Tools are versioned. This versioning system supports iterative development, allowing you to progressively refine configurations and revert to previous versions if needed.

Version numbers are integer values representing different iterations of the Config. Each update to the Config increments its version number.

requestOptions: ConfigsClient.RequestOptions

client.empathicVoice.configs.deleteConfigVersion(id, version) -> void

πŸ“ Description

Deletes a specified version of a Config.

For more details on configuration options and how to configure EVI, see our configuration guide.

πŸ”Œ Usage

await client.empathicVoice.configs.deleteConfigVersion("your-config-id", 1);

βš™οΈ Parameters

id: string β€” Identifier for a Config. Formatted as a UUID.

version: number

Version number for a Config.

Configs, Prompts, Custom Voices, and Tools are versioned. This versioning system supports iterative development, allowing you to progressively refine configurations and revert to previous versions if needed.

Version numbers are integer values representing different iterations of the Config. Each update to the Config increments its version number.

requestOptions: ConfigsClient.RequestOptions

client.empathicVoice.configs.updateConfigDescription(id, version, { ...params }) -> Hume.ReturnConfig

πŸ“ Description

Updates the description of a Config.

For more details on configuration options and how to configure EVI, see our configuration guide.

πŸ”Œ Usage

await client.empathicVoice.configs.updateConfigDescription("your-config-id", 1, {
    versionDescription: "This is an updated version_description."
});

βš™οΈ Parameters

id: string β€” Identifier for a Config. Formatted as a UUID.

version: number

Version number for a Config.

Configs, Prompts, Custom Voices, and Tools are versioned. This versioning system supports iterative development, allowing you to progressively refine configurations and revert to previous versions if needed.

Version numbers are integer values representing different iterations of the Config. Each update to the Config increments its version number.

request: Hume.empathicVoice.PostedConfigVersionDescription

requestOptions: ConfigsClient.RequestOptions

EmpathicVoice Prompts

client.empathicVoice.prompts.listPrompts({ ...params }) -> core.Page<(Hume.ReturnPrompt | undefined), Hume.ReturnPagedPrompts>

πŸ“ Description

Fetches a paginated list of Prompts.

See our prompting guide for tips on crafting your system prompt.

πŸ”Œ Usage

const pageableResponse = await client.empathicVoice.prompts.listPrompts({
    pageNumber: 0,
    pageSize: 2
});
for await (const item of pageableResponse) {
    console.log(item);
}

// Or you can manually iterate page-by-page
let page = await client.empathicVoice.prompts.listPrompts({
    pageNumber: 0,
    pageSize: 2
});
while (page.hasNextPage()) {
    page = page.getNextPage();
}

// You can also access the underlying response
const response = page.response;

βš™οΈ Parameters

request: Hume.empathicVoice.PromptsListPromptsRequest

requestOptions: PromptsClient.RequestOptions

client.empathicVoice.prompts.createPrompt({ ...params }) -> Hume.ReturnPrompt | undefined

πŸ“ Description

Creates a Prompt that can be added to an EVI configuration.

See our prompting guide for tips on crafting your system prompt.

πŸ”Œ Usage

await client.empathicVoice.prompts.createPrompt({
    name: "Weather Assistant Prompt",
    text: "<role>You are an AI weather assistant providing users with accurate and up-to-date weather information. Respond to user queries concisely and clearly. Use simple language and avoid technical jargon. Provide temperature, precipitation, wind conditions, and any weather alerts. Include helpful tips if severe weather is expected.</role>"
});

βš™οΈ Parameters

request: Hume.empathicVoice.PostedPrompt

requestOptions: PromptsClient.RequestOptions

client.empathicVoice.prompts.listPromptVersions(id, { ...params }) -> Hume.ReturnPagedPrompts

πŸ“ Description

Fetches a list of a Prompt's versions.

See our prompting guide for tips on crafting your system prompt.

πŸ”Œ Usage

await client.empathicVoice.prompts.listPromptVersions("your-prompt-id");

βš™οΈ Parameters

id: string

request: Hume.empathicVoice.PromptsListPromptVersionsRequest

requestOptions: PromptsClient.RequestOptions

client.empathicVoice.prompts.createPromptVersion(id, { ...params }) -> Hume.ReturnPrompt | undefined

πŸ“ Description

Updates a Prompt by creating a new version of the Prompt.

See our prompting guide for tips on crafting your system prompt.

πŸ”Œ Usage

await client.empathicVoice.prompts.createPromptVersion("your-prompt-id", {
    text: "<role>You are an updated version of an AI weather assistant providing users with accurate and up-to-date weather information. Respond to user queries concisely and clearly. Use simple language and avoid technical jargon. Provide temperature, precipitation, wind conditions, and any weather alerts. Include helpful tips if severe weather is expected.</role>",
    versionDescription: "This is an updated version of the Weather Assistant Prompt."
});

βš™οΈ Parameters

id: string β€” Identifier for a Prompt. Formatted as a UUID.

request: Hume.empathicVoice.PostedPromptVersion

requestOptions: PromptsClient.RequestOptions

client.empathicVoice.prompts.deletePrompt(id) -> void

πŸ“ Description

Deletes a Prompt and its versions.

See our prompting guide for tips on crafting your system prompt.

πŸ”Œ Usage

await client.empathicVoice.prompts.deletePrompt("your-prompt-id");

βš™οΈ Parameters

id: string β€” Identifier for a Prompt. Formatted as a UUID.

requestOptions: PromptsClient.RequestOptions

client.empathicVoice.prompts.updatePromptName(id, { ...params }) -> string

πŸ“ Description

Updates the name of a Prompt.

See our prompting guide for tips on crafting your system prompt.

πŸ”Œ Usage

await client.empathicVoice.prompts.updatePromptName("your-prompt-id", {
    name: "Updated Weather Assistant Prompt Name"
});

βš™οΈ Parameters

id: string β€” Identifier for a Prompt. Formatted as a UUID.

request: Hume.empathicVoice.PostedPromptName

requestOptions: PromptsClient.RequestOptions

client.empathicVoice.prompts.getPromptVersion(id, version) -> Hume.ReturnPrompt | undefined

πŸ“ Description

Fetches a specified version of a Prompt.

See our prompting guide for tips on crafting your system prompt.

πŸ”Œ Usage

await client.empathicVoice.prompts.getPromptVersion("your-prompt-id", 0);

βš™οΈ Parameters

id: string β€” Identifier for a Prompt. Formatted as a UUID.

version: number

Version number for a Prompt.

Prompts, Configs, Custom Voices, and Tools are versioned. This versioning system supports iterative development, allowing you to progressively refine prompts and revert to previous versions if needed.

Version numbers are integer values representing different iterations of the Prompt. Each update to the Prompt increments its version number.

requestOptions: PromptsClient.RequestOptions

client.empathicVoice.prompts.deletePromptVersion(id, version) -> void

πŸ“ Description

Deletes a specified version of a Prompt.

See our prompting guide for tips on crafting your system prompt.

πŸ”Œ Usage

await client.empathicVoice.prompts.deletePromptVersion("your-prompt-id", 1);

βš™οΈ Parameters

id: string β€” Identifier for a Prompt. Formatted as a UUID.

version: number

Version number for a Prompt.

Prompts, Configs, Custom Voices, and Tools are versioned. This versioning system supports iterative development, allowing you to progressively refine prompts and revert to previous versions if needed.

Version numbers are integer values representing different iterations of the Prompt. Each update to the Prompt increments its version number.

requestOptions: PromptsClient.RequestOptions

client.empathicVoice.prompts.updatePromptDescription(id, version, { ...params }) -> Hume.ReturnPrompt | undefined

πŸ“ Description

Updates the description of a Prompt.

See our prompting guide for tips on crafting your system prompt.

πŸ”Œ Usage

await client.empathicVoice.prompts.updatePromptDescription("your-prompt-id", 1, {
    versionDescription: "This is an updated version_description."
});

βš™οΈ Parameters

id: string β€” Identifier for a Prompt. Formatted as a UUID.

version: number

Version number for a Prompt.

Prompts, Configs, Custom Voices, and Tools are versioned. This versioning system supports iterative development, allowing you to progressively refine prompts and revert to previous versions if needed.

Version numbers are integer values representing different iterations of the Prompt. Each update to the Prompt increments its version number.

request: Hume.empathicVoice.PostedPromptVersionDescription

requestOptions: PromptsClient.RequestOptions

EmpathicVoice Tools

client.empathicVoice.tools.listTools({ ...params }) -> core.Page<(Hume.ReturnUserDefinedTool | undefined), Hume.ReturnPagedUserDefinedTools>

πŸ“ Description

Fetches a paginated list of Tools.

Refer to our tool use guide for comprehensive instructions on defining and integrating tools into EVI.

πŸ”Œ Usage

const pageableResponse = await client.empathicVoice.tools.listTools({
    pageNumber: 0,
    pageSize: 2
});
for await (const item of pageableResponse) {
    console.log(item);
}

// Or you can manually iterate page-by-page
let page = await client.empathicVoice.tools.listTools({
    pageNumber: 0,
    pageSize: 2
});
while (page.hasNextPage()) {
    page = page.getNextPage();
}

// You can also access the underlying response
const response = page.response;

βš™οΈ Parameters

request: Hume.empathicVoice.ToolsListToolsRequest

requestOptions: ToolsClient.RequestOptions

client.empathicVoice.tools.createTool({ ...params }) -> Hume.ReturnUserDefinedTool | undefined

πŸ“ Description

Creates a Tool that can be added to an EVI configuration.

Refer to our tool use guide for comprehensive instructions on defining and integrating tools into EVI.

πŸ”Œ Usage

await client.empathicVoice.tools.createTool({
    name: "get_current_weather",
    parameters: "{ \"type\": \"object\", \"properties\": { \"location\": { \"type\": \"string\", \"description\": \"The city and state, e.g. San Francisco, CA\" }, \"format\": { \"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"], \"description\": \"The temperature unit to use. Infer this from the users location.\" } }, \"required\": [\"location\", \"format\"] }",
    versionDescription: "Fetches current weather and uses celsius or fahrenheit based on location of user.",
    description: "This tool is for getting the current weather.",
    fallbackContent: "Unable to fetch current weather."
});

βš™οΈ Parameters

request: Hume.empathicVoice.PostedUserDefinedTool

requestOptions: ToolsClient.RequestOptions

client.empathicVoice.tools.listToolVersions(id, { ...params }) -> core.Page<(Hume.ReturnUserDefinedTool | undefined), Hume.ReturnPagedUserDefinedTools>

πŸ“ Description

Fetches a list of a Tool's versions.

Refer to our tool use guide for comprehensive instructions on defining and integrating tools into EVI.

πŸ”Œ Usage

const pageableResponse = await client.empathicVoice.tools.listToolVersions("your-tool-id");
for await (const item of pageableResponse) {
    console.log(item);
}

// Or you can manually iterate page-by-page
let page = await client.empathicVoice.tools.listToolVersions("your-tool-id");
while (page.hasNextPage()) {
    page = page.getNextPage();
}

// You can also access the underlying response
const response = page.response;

βš™οΈ Parameters

id: string

request: Hume.empathicVoice.ToolsListToolVersionsRequest

requestOptions: ToolsClient.RequestOptions

client.empathicVoice.tools.createToolVersion(id, { ...params }) -> Hume.ReturnUserDefinedTool | undefined

πŸ“ Description

Updates a Tool by creating a new version of the Tool.

Refer to our tool use guide for comprehensive instructions on defining and integrating tools into EVI.

πŸ”Œ Usage

await client.empathicVoice.tools.createToolVersion("your-tool-id", {
    parameters: "{ \"type\": \"object\", \"properties\": { \"location\": { \"type\": \"string\", \"description\": \"The city and state, e.g. San Francisco, CA\" }, \"format\": { \"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\", \"kelvin\"], \"description\": \"The temperature unit to use. Infer this from the users location.\" } }, \"required\": [\"location\", \"format\"] }",
    versionDescription: "Fetches current weather and uses celsius, fahrenheit, or kelvin based on location of user.",
    fallbackContent: "Unable to fetch current weather.",
    description: "This tool is for getting the current weather."
});

βš™οΈ Parameters

id: string β€” Identifier for a Tool. Formatted as a UUID.

request: Hume.empathicVoice.PostedUserDefinedToolVersion

requestOptions: ToolsClient.RequestOptions

client.empathicVoice.tools.deleteTool(id) -> void

πŸ“ Description

Deletes a Tool and its versions.

Refer to our tool use guide for comprehensive instructions on defining and integrating tools into EVI.

πŸ”Œ Usage

await client.empathicVoice.tools.deleteTool("your-tool-id");

βš™οΈ Parameters

id: string β€” Identifier for a Tool. Formatted as a UUID.

requestOptions: ToolsClient.RequestOptions

client.empathicVoice.tools.updateToolName(id, { ...params }) -> string

πŸ“ Description

Updates the name of a Tool.

Refer to our tool use guide for comprehensive instructions on defining and integrating tools into EVI.

πŸ”Œ Usage

await client.empathicVoice.tools.updateToolName("your-tool-id", {
    name: "get_current_temperature"
});

βš™οΈ Parameters

id: string β€” Identifier for a Tool. Formatted as a UUID.

request: Hume.empathicVoice.PostedUserDefinedToolName

requestOptions: ToolsClient.RequestOptions

client.empathicVoice.tools.getToolVersion(id, version) -> Hume.ReturnUserDefinedTool | undefined

πŸ“ Description

Fetches a specified version of a Tool.

Refer to our tool use guide for comprehensive instructions on defining and integrating tools into EVI.

πŸ”Œ Usage

await client.empathicVoice.tools.getToolVersion("your-tool-id", 1);

βš™οΈ Parameters

id: string β€” Identifier for a Tool. Formatted as a UUID.

version: number

Version number for a Tool.

Tools, Configs, Custom Voices, and Prompts are versioned. This versioning system supports iterative development, allowing you to progressively refine tools and revert to previous versions if needed.

Version numbers are integer values representing different iterations of the Tool. Each update to the Tool increments its version number.

requestOptions: ToolsClient.RequestOptions

client.empathicVoice.tools.deleteToolVersion(id, version) -> void

πŸ“ Description

Deletes a specified version of a Tool.

Refer to our tool use guide for comprehensive instructions on defining and integrating tools into EVI.

πŸ”Œ Usage

await client.empathicVoice.tools.deleteToolVersion("your-tool-id", 1);

βš™οΈ Parameters

id: string β€” Identifier for a Tool. Formatted as a UUID.

version: number

Version number for a Tool.

Tools, Configs, Custom Voices, and Prompts are versioned. This versioning system supports iterative development, allowing you to progressively refine tools and revert to previous versions if needed.

Version numbers are integer values representing different iterations of the Tool. Each update to the Tool increments its version number.

requestOptions: ToolsClient.RequestOptions

client.empathicVoice.tools.updateToolDescription(id, version, { ...params }) -> Hume.ReturnUserDefinedTool | undefined

πŸ“ Description

Updates the description of a specified Tool version.

Refer to our tool use guide for comprehensive instructions on defining and integrating tools into EVI.

πŸ”Œ Usage

await client.empathicVoice.tools.updateToolDescription("your-tool-id", 1, {
    versionDescription: "Fetches current temperature, precipitation, wind speed, AQI, and other weather conditions. Uses Celsius, Fahrenheit, or kelvin depending on user's region."
});

βš™οΈ Parameters

id: string β€” Identifier for a Tool. Formatted as a UUID.

version: number

Version number for a Tool.

Tools, Configs, Custom Voices, and Prompts are versioned. This versioning system supports iterative development, allowing you to progressively refine tools and revert to previous versions if needed.

Version numbers are integer values representing different iterations of the Tool. Each update to the Tool increments its version number.

request: Hume.empathicVoice.PostedUserDefinedToolVersionDescription

requestOptions: ToolsClient.RequestOptions

Tts

client.tts.synthesizeJson({ ...params }) -> Hume.ReturnTts

πŸ“ Description

Synthesizes one or more input texts into speech using the specified voice. If no voice is provided, a novel voice will be generated dynamically. Optionally, additional context can be included to influence the speech's style and prosody.

The response includes the base64-encoded audio and metadata in JSON format.

πŸ”Œ Usage

await client.tts.synthesizeJson({
    context: {
        utterances: [{
                text: "How can people see beauty so differently?",
                description: "A curious student with a clear and respectful tone, seeking clarification on Hume's ideas with a straightforward question."
            }]
    },
    format: {
        type: "mp3"
    },
    numGenerations: 1,
    utterances: [{
            text: "Beauty is no quality in things themselves: It exists merely in the mind which contemplates them.",
            description: "Middle-aged masculine voice with a clear, rhythmic Scots lilt, rounded vowels, and a warm, steady tone with an articulate, academic quality."
        }]
});

βš™οΈ Parameters

request: Hume.PostedTts

requestOptions: TtsClient.RequestOptions

client.tts.synthesizeFile({ ...params }) -> core.BinaryResponse

πŸ“ Description

Synthesizes one or more input texts into speech using the specified voice. If no voice is provided, a novel voice will be generated dynamically. Optionally, additional context can be included to influence the speech's style and prosody.

The response contains the generated audio file in the requested format.

πŸ”Œ Usage

await client.tts.synthesizeFile({
    context: {
        generationId: ""
    },
    format: {
        type: "mp3"
    },
    numGenerations: 1,
    utterances: [{
            text: "Beauty is no quality in things themselves: It exists merely in the mind which contemplates them.",
            description: "Middle-aged masculine voice with a clear, rhythmic Scots lilt, rounded vowels, and a warm, steady tone with an articulate, academic quality."
        }]
});

βš™οΈ Parameters

request: Hume.PostedTts

requestOptions: TtsClient.RequestOptions

client.tts.synthesizeFileStreaming({ ...params }) -> core.BinaryResponse

πŸ“ Description

Streams synthesized speech using the specified voice. If no voice is provided, a novel voice will be generated dynamically. Optionally, additional context can be included to influence the speech's style and prosody.

πŸ”Œ Usage

await client.tts.synthesizeFileStreaming({
    utterances: [{
            text: "Beauty is no quality in things themselves: It exists merely in the mind which contemplates them.",
            voice: {
                name: "Male English Actor",
                provider: "HUME_AI"
            }
        }]
});

βš™οΈ Parameters

request: Hume.PostedTts

requestOptions: TtsClient.RequestOptions

client.tts.synthesizeJsonStreaming({ ...params }) -> core.Stream<Hume.TtsOutput>

πŸ“ Description

Streams synthesized speech using the specified voice. If no voice is provided, a novel voice will be generated dynamically. Optionally, additional context can be included to influence the speech's style and prosody.

The response is a stream of JSON objects including audio encoded in base64.

πŸ”Œ Usage

const response = await client.tts.synthesizeJsonStreaming({
    utterances: [{
            text: "Beauty is no quality in things themselves: It exists merely in the mind which contemplates them.",
            voice: {
                name: "Male English Actor",
                provider: "HUME_AI"
            }
        }]
});
for await (const item of response) {
    console.log(item);
}

βš™οΈ Parameters

request: Hume.PostedTts

requestOptions: TtsClient.RequestOptions

client.tts.convertVoiceJson({ ...params }) -> core.Stream<Hume.TtsOutput>

πŸ”Œ Usage

const response = await client.tts.convertVoiceJson({});
for await (const item of response) {
    console.log(item);
}

βš™οΈ Parameters

request: Hume.tts.ConvertVoiceJsonRequest

requestOptions: TtsClient.RequestOptions

Tts Voices

client.tts.voices.list({ ...params }) -> core.Page<Hume.ReturnVoice, Hume.ReturnPagedVoices>

πŸ“ Description

Lists voices you have saved in your account, or voices from the Voice Library.

πŸ”Œ Usage

const pageableResponse = await client.tts.voices.list({
    provider: "CUSTOM_VOICE"
});
for await (const item of pageableResponse) {
    console.log(item);
}

// Or you can manually iterate page-by-page
let page = await client.tts.voices.list({
    provider: "CUSTOM_VOICE"
});
while (page.hasNextPage()) {
    page = page.getNextPage();
}

// You can also access the underlying response
const response = page.response;

βš™οΈ Parameters

request: Hume.tts.VoicesListRequest

requestOptions: VoicesClient.RequestOptions

client.tts.voices.create({ ...params }) -> Hume.ReturnVoice

πŸ“ Description

Saves a new custom voice to your account using the specified TTS generation ID.

Once saved, this voice can be reused in subsequent TTS requests, ensuring consistent speech style and prosody. For more details on voice creation, see the Voices Guide.

πŸ”Œ Usage

await client.tts.voices.create({
    generationId: "",
    name: "David Hume"
});

βš™οΈ Parameters

request: Hume.tts.PostedVoice

requestOptions: VoicesClient.RequestOptions

client.tts.voices.delete({ ...params }) -> void

πŸ“ Description

Deletes a previously generated custom voice.

πŸ”Œ Usage

await client.tts.voices.delete({
    name: "David Hume"
});

βš™οΈ Parameters

request: Hume.tts.VoicesDeleteRequest

requestOptions: VoicesClient.RequestOptions