Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
NotificationsYou must be signed in to change notification settings

HumeAI/hume-dotnet-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fern shieldnuget shield

The Hume C# library provides convenient access to the Hume APIs from C#.

Requirements

This SDK requires:

Installation

dotnet add package Hume

Reference

A full reference for this library is availablehere.

Usage

Instantiate and use the client with the following:

usingHume.Tts;usingHume;varclient=newHumeClient("API_KEY");awaitclient.Tts.Voices.CreateAsync(newPostedVoice{GenerationId="795c949a-1510-4a80-9646-7d0863b023ab",Name="David Hume"});

Exception Handling

When the API returns a non-success status code (4xx or 5xx response), a subclass of the following errorwill be thrown.

usingHume;try{varresponse=awaitclient.Tts.Voices.CreateAsync(...);}catch(HumeClientApiExceptione){System.Console.WriteLine(e.Body);System.Console.WriteLine(e.StatusCode);}

Pagination

List endpoints are paginated. The SDK provides an async enumerable so that you can simply loop over the items:

usingHume.Tts;usingHume;varclient=newHumeClient("API_KEY");varitems=awaitclient.Tts.Voices.ListAsync(newVoicesListRequest{Provider=Hume.Tts.VoiceProvider.CustomVoice});awaitforeach(variteminitems){// do something with item}

Advanced

Retries

The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as longas the request is deemed retryable and the number of retry attempts has not grown larger than the configuredretry limit (default: 2).

A request is deemed retryable when any of the following HTTP status codes is returned:

  • 408 (Timeout)
  • 429 (Too Many Requests)
  • 5XX (Internal Server Errors)

Use theMaxRetries request option to configure this behavior.

varresponse=awaitclient.Tts.Voices.CreateAsync(    ...,newRequestOptions{MaxRetries:0// Override MaxRetries at the request level});

Timeouts

The SDK defaults to a 30 second timeout. Use theTimeout option to configure this behavior.

varresponse=awaitclient.Tts.Voices.CreateAsync(    ...,newRequestOptions{Timeout: TimeSpan.FromSeconds(3)// Override timeout to 3s});

Contributing

While we value open-source contributions to this SDK, this library is generated programmatically.Additions made directly to this library would have to be moved over to our generation code,otherwise they would be overwritten upon the next generated release. Feel free to open a PR asa proof of concept, but know that we will not be able to merge it as-is. We suggest openingan issue first to discuss with us!

On the other hand, contributions to the README are always very welcome!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp