Class Speech
java.lang.Object
bg.codexio.ai.openai.api.sdk.voice.speech.Speech
Entrypoint for
Speech API.
The interaction starts by configuring the HTTP connection
either by providing a preconfigured
Further configuration happens on multiple bypassable stages, whatever is important for specific needs.
The interaction starts by configuring the HTTP connection
either by providing a preconfigured
SpeechHttpExecutor http
client, HttpExecutorContext, SdkAuth or leave it to
defaults(). Further configuration happens on multiple bypassable stages, whatever is important for specific needs.
-
Method Summary
Modifier and TypeMethodDescriptionstatic HttpBuilder<AIModelStage> authenticate(HttpExecutorContext context) static HttpBuilder<AIModelStage> authenticate(SdkAuth auth) Authenticates against OpenAI API with an implementation ofSdkAuth.static HttpBuilder<AIModelStage> defaults()Authenticates against OpenAPI with the first success fromFromEnvironmentandFromJson
authentication methods.static SynchronousPromptStagesimply()Authenticates against OpenAPI with the first success fromFromEnvironmentandFromJson
authentication methods.static SynchronousPromptStageAuthenticates against OpenAI API with an implementation ofSdkAuthand preconfigures simpleTTS1HDModelfor prompting.static AIModelStagethroughHttp(SpeechHttpExecutor executor)
-
Method Details
-
throughHttp
- Parameters:
executor- ConfiguredSpeechHttpExecutorwith manually setHttpExecutorContext,OkHttpClientand/orObjectMapper.- Returns:
AIModelStageto configure the necessaryModelType
-
authenticate
Authenticates against OpenAI API with manually supplied
ApiCredentialsandHttpTimeouts. Mostly used if credentials
are fetched from external source.- Parameters:
context-HttpExecutorContext- Returns:
HttpBuilder<AIModelStage>so timeouts can be reconfigured and possiblyObjectMapperis supplied.
-
authenticate
Authenticates against OpenAI API with an implementation ofSdkAuth.- Parameters:
auth- of typeSdkAuth
Allows you to choose from one of the default authentication methods
Options:FromDeveloper,FromJson,FromEnvironment- Returns:
HttpBuilder<AIModelStage>so timeouts can be reconfigured and possiblyObjectMapperis supplied.
-
simply
Authenticates against OpenAI API with an implementation ofSdkAuthand preconfigures simpleTTS1HDModelfor prompting.- Parameters:
auth- of typeSdkAuth
Allows you to choose from one of the default authentication methods
Options:FromDeveloper,FromJson,FromEnvironment- Returns:
SynchronousPromptStage
-
simply
Authenticates against OpenAPI with the first success fromFromEnvironmentandFromJson
authentication methods. Preconfigures simpleTTS1HDModelfor prompting.- Returns:
SynchronousPromptStage
-
defaults
Authenticates against OpenAPI with the first success fromFromEnvironmentandFromJson
authentication methods. All other configurations can be manually customized- Returns:
HttpBuilder<AIModelStage>so timeouts can be reconfigured and possiblyObjectMapperis supplied.
-