Class VertexSpeechClient
java.lang.Object
com.google.adk.flows.llmflows.audio.VertexSpeechClient
- All Implemented Interfaces:
SpeechClientInterface
,AutoCloseable
Implementation of SpeechClientInterface using Vertex AI SpeechClient.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a VertexSpeechClient, initializing the underlying Google Cloud SpeechClient. -
Method Summary
-
Constructor Details
-
VertexSpeechClient
Constructs a VertexSpeechClient, initializing the underlying Google Cloud SpeechClient.- Throws:
IOException
- if SpeechClient creation fails.
-
-
Method Details
-
recognize
public com.google.cloud.speech.v1.RecognizeResponse recognize(com.google.cloud.speech.v1.RecognitionConfig config, com.google.cloud.speech.v1.RecognitionAudio audio) Description copied from interface:SpeechClientInterface
Performs synchronous speech recognition.- Specified by:
recognize
in interfaceSpeechClientInterface
- Parameters:
config
- The recognition configuration.audio
- The audio data to transcribe.- Returns:
- The recognition response.
-
close
Description copied from interface:SpeechClientInterface
Closes the client and releases any resources.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSpeechClientInterface
- Throws:
Exception
- if an error occurs during closing.
-