Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recognizer does not support feature diarization_config #11474

Open
GordonHuangYong opened this issue Mar 7, 2025 · 0 comments
Open

Recognizer does not support feature diarization_config #11474

GordonHuangYong opened this issue Mar 7, 2025 · 0 comments

Comments

@GordonHuangYong
Copy link

GordonHuangYong commented Mar 7, 2025

Environment details

  1. Specify the API at the beginning of the title. For example, "[vision]: ...").
    General, Core, and Other are also allowed as types

Speech-to-Text V2

  1. OS type and version: mac os

  2. Java version: 19

  3. Version(s):

		<dependency>
			<groupId>com.google.cloud</groupId>
			<artifactId>google-cloud-speech</artifactId>
			<version>4.54.0</version>
		</dependency>

Steps to reproduce

  1. ?
  2. ?

Code example

private void transcribeAsyncSpeakerAndTime(Task task) throws IOException, ExecutionException, InterruptedException {
        try (SpeechClient speechClient = SpeechClient.create()) {
            RecognitionConfig recognitionConfig;
            SpeakerDiarizationConfig speakerDiarizationConfig = SpeakerDiarizationConfig.newBuilder().setMinSpeakerCount(1).setMaxSpeakerCount(6).build();

            RecognitionFeatures recognitionFeatures = RecognitionFeatures.newBuilder()
                    .setEnableAutomaticPunctuation(true)
                    .setEnableWordTimeOffsets(true)
                    .setDiarizationConfig(speakerDiarizationConfig)
                    .build();
             recognitionConfig = RecognitionConfig.newBuilder()
                        .setAutoDecodingConfig(AutoDetectDecodingConfig.getDefaultInstance())
                        .setFeatures(recognitionFeatures)
                        .addAllLanguageCodes(Arrays.asList("cmn-Hans-CN", "en-US"))
                        .setModel("long")
                        .build();

            CreateRecognizerRequest createRecognizerRequest =
                    CreateRecognizerRequest.newBuilder()
                            .setParent(LocationName.of(projectId, location).toString())
                            .setRecognizerId("recognizer-" + UUID.randomUUID())
                            .setRecognizer(Recognizer.newBuilder().setDefaultRecognitionConfig(recognitionConfig).build())
                            .build();

            Recognizer recognizer = speechClient.createRecognizerAsync(createRecognizerRequest).get();

            RecognizeRequest recognizeRequest =
                    RecognizeRequest.newBuilder()
                            .setRecognizer(recognizer.getName())
                            .setUri(task.getGcsUri())
                            .build();
            RecognizeResponse response = speechClient.recognize(recognizeRequest);

Stack trace

ErrorDetails

ErrorDetails{rawErrorMessages=[type_url: \"type.googleapis.com/google.rpc.BadRequest\"\nvalue: \"\\nW\\n\\033features.diarization_config\\0228Recognizer does not support feature: speaker_diarization\"\n]}

Stack trace

java.util.concurrent.ExecutionException: com.google.api.gax.rpc.InvalidArgumentException: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Config contains unsupported fields. See `error_details_ext` extension for details.
	at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:604)
	at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:579)
	at com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:91)
	at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:67)
	at com.google.api.gax.longrunning.OperationFutureImpl.get(OperationFutureImpl.java:125)
	at com.waytronic.speech2text.service.TranscriptionService.transcribeAsyncSpeakerAndTime(TranscriptionService.java:203)
	at com.waytronic.speech2text.service.TranscriptionService.lambda$transcribeAudio$0(TranscriptionService.java:70)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1804)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
	at java.base/java.util.concurrent.ForkJoinTask.doExec$$$capture(ForkJoinTask.java:387)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1311)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1841)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1806)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Caused by: com.google.api.gax.rpc.InvalidArgumentException: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Config contains unsupported fields. See `error_details_ext` extension for details.
	at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:92)
	at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:98)
	at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:66)
	at com.google.api.gax.grpc.GrpcExceptionCallable$ExceptionTransformingFuture.onFailure(GrpcExceptionCallable.java:97)
	at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:84)
	at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1132)
	at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31)
	at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1307)
	at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:1070)
	at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:819)
	at io.grpc.stub.ClientCalls$GrpcFuture.setException(ClientCalls.java:651)
	at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:621)
	at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
	at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
	at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
	at com.google.api.gax.grpc.ChannelPool$ReleasingClientCall$1.onClose(ChannelPool.java:569)
	at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
	at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
	at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
	at com.google.api.gax.grpc.GrpcLoggingInterceptor$1$1.onClose(GrpcLoggingInterceptor.java:98)
	at io.grpc.internal.DelayedClientCall$DelayedListener$3.run(DelayedClientCall.java:489)
	at io.grpc.internal.DelayedClientCall$DelayedListener.delayOrExecute(DelayedClientCall.java:453)
	at io.grpc.internal.DelayedClientCall$DelayedListener.onClose(DelayedClientCall.java:486)
	at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:564)
	at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:72)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:729)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:710)
	at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
	at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1589)
Caused by: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Config contains unsupported fields. See `error_details_ext` extension for details.
	at io.grpc.Status.asRuntimeException(Status.java:532)
	... 21 more

External references such as API reference guides

Any additional information below

Following these steps guarantees the quickest resolution possible.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant