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
Modifier and TypeMethodDescriptionvoid
close()
Closes the client and releases any resources.com.google.cloud.speech.v1.RecognizeResponse
recognize
(com.google.cloud.speech.v1.RecognitionConfig config, com.google.cloud.speech.v1.RecognitionAudio audio) Performs synchronous speech recognition on the given audio input.
-
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) Performs synchronous speech recognition on the given audio input.- Specified by:
recognize
in interfaceSpeechClientInterface
- Parameters:
config
- Recognition configuration (e.g., language, encoding).audio
- Audio data to recognize.- Returns:
- The recognition result.
-
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.
-