This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit dfb5d274578917536265cf39209ab90d1f9ad6ef Author: Claus Ibsen <[email protected]> AuthorDate: Fri Nov 27 16:27:56 2026 +0100 CAMEL-23832: camel-google-speech-to-text - improve the component and option descriptions Rewrites the component description, 7 option descriptions and 2 header descriptions. The encoding text now lists the AudioEncoding names (with ENCODING_UNSPECIFIED, and the note that MP3 is documented only for v1p1beta1), pojoRequest says which options it bypasses, and serviceAccountKey and client say how the SpeechClient is created, autowired and closed. Documentation only, no behavior change. The component JSON, the catalog copy, the doc page header and the DSL are regenerated. camel-google-speech-to-text is marked as done in tasks/component-descriptions.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../catalog/components/google-speech-to-text.json | 20 +++--- .../docs/google-speech-to-text-component.adoc | 2 +- .../google/speechtotext/google-speech-to-text.json | 20 +++--- .../main/docs/google-speech-to-text-component.adoc | 2 +- .../GoogleCloudSpeechToTextConfiguration.java | 68 +++++++----------- .../GoogleCloudSpeechToTextConstants.java | 6 +- .../GoogleCloudSpeechToTextEndpoint.java | 2 +- .../component/ComponentsBuilderFactory.java | 2 +- .../GoogleSpeechToTextComponentBuilderFactory.java | 4 +- .../builder/endpoint/EndpointHeaderBuilders.java | 2 +- .../builder/endpoint/StaticEndpointBuilders.java | 14 ++-- ...gleCloudSpeechToTextEndpointBuilderFactory.java | 84 ++++++++++++++++------ tasks/component-descriptions.md | 2 +- 13 files changed, 129 insertions(+), 99 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/google-speech-to-text.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/google-speech-to-text.json index 0f5706024e2c..90d000d5ddcd 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/google-speech-to-text.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/google-speech-to-text.json @@ -3,7 +3,7 @@ "kind": "component", "name": "google-speech-to-text", "title": "Google Cloud Speech To Text", - "description": "Transcribe audio to text using Google Cloud Speech-to-Text API", + "description": "Transcribe audio to text with the Google Cloud Speech-to-Text API.", "deprecated": false, "firstVersion": "4.19.0", "label": "cloud,ai", @@ -28,21 +28,21 @@ "autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] }, "headers": { - "CamelGoogleCloudSpeechToTextOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextOperations", "enum": [ "recognize" ], "deprecated": false, "autowired": false, "secret": false, "description": "The operation to perform", "constantName": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConstants#OPERATION" }, - "CamelGoogleCloudSpeechToTextResponseObject": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "com.google.cloud.speech.v1.RecognizeResponse", "deprecated": false, "autowired": false, "secret": false, "description": "The response object resulting from the Google Cloud Speech-to-Text API invocation", "constantName": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConstants#RESPONSE_OBJECT" } + "CamelGoogleCloudSpeechToTextOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextOperations", "enum": [ "recognize" ], "deprecated": false, "autowired": false, "secret": false, "description": "The operation to perform, which overrides the operation of the endpoint URI. The only operation is recognize. Not used when pojoRequest=true.", "con [...] + "CamelGoogleCloudSpeechToTextResponseObject": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "com.google.cloud.speech.v1.RecognizeResponse", "deprecated": false, "autowired": false, "secret": false, "description": "The RecognizeResponse returned by the service, with all the results and alternatives. The message body holds only the best alternative of each result.", "constantName": "org.apache.camel.component.google. [...] }, "bodyTypes": { "producerIn": { "carriers": [ "bytes", "stream", "file" ], "byOption": [ { "option": "pojoRequest", "value": "true", "carriers": [ "pojo" ], "javaType": "com.google.cloud.speech.v1.RecognizeRequest" } ], "description": "The audio to transcribe, sent inline in the encoding and sample rate of the encoding and sampleRateHertz options (LINEAR16 by default). A stream or a file is read into bytes and a String is sent as its bytes, a Map, a POJO or no body fails. With pojoRequest=true a Rec [...] "producerOut": { "carriers": [ "text" ], "javaType": "java.lang.String", "description": "The transcript: the best alternative of each result, one line per result, or an empty String when nothing is recognized, also with pojoRequest=true. The RecognizeResponse is in the CamelGoogleCloudSpeechToTextResponseObject header" } }, "properties": { - "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The operation name" }, - "serviceAccountKey": { "index": 1, "kind": "parameter", "displayName": "Service Account Key", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "Service account key to authenticate an application as a service a [...] - "encoding": { "index": 2, "kind": "parameter", "displayName": "Encoding", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "LINEAR16", "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The encoding of the audio data. Supported values: LIN [...] - "languageCode": { "index": 3, "kind": "parameter", "displayName": "Language Code", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "en-US", "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The language of the audio data as a BCP-47 lang [...] - "pojoRequest": { "index": 4, "kind": "parameter", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "Specifies if the request is a pojo request" }, - "sampleRateHertz": { "index": 5, "kind": "parameter", "displayName": "Sample Rate Hertz", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The sample rate in Hertz of the audio data. Valid values range [...] + "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The operation to perform. The only operation is recognize, which sends the audio in one s [...] + "serviceAccountKey": { "index": 1, "kind": "parameter", "displayName": "Service Account Key", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The service account key file (JSON) used to create the SpeechClie [...] + "encoding": { "index": 2, "kind": "parameter", "displayName": "Encoding", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "LINEAR16", "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The encoding of the audio in the message body, as a n [...] + "languageCode": { "index": 3, "kind": "parameter", "displayName": "Language Code", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "en-US", "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The language of the speech in the audio, as a B [...] + "pojoRequest": { "index": 4, "kind": "parameter", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "Whether the message body is a RecognizeRequest of the Google Cloud [...] + "sampleRateHertz": { "index": 5, "kind": "parameter", "displayName": "Sample Rate Hertz", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The sample rate in Hertz of the audio in the message body, from [...] "lazyStartProducer": { "index": 6, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...] - "client": { "index": 7, "kind": "parameter", "displayName": "Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.google.cloud.speech.v1.SpeechClient", "deprecated": false, "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The client to use during service invocation." } + "client": { "index": 7, "kind": "parameter", "displayName": "Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.google.cloud.speech.v1.SpeechClient", "deprecated": false, "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The SpeechClient to use for the calls. When not set, a single S [...] } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/google-speech-to-text-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/google-speech-to-text-component.adoc index eb66c2f719b8..d5cff0329059 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/google-speech-to-text-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/google-speech-to-text-component.adoc @@ -2,7 +2,7 @@ :doctitle: Google Cloud Speech To Text :shortname: google-speech-to-text :artifactid: camel-google-speech-to-text -:description: Transcribe audio to text using Google Cloud Speech-to-Text API +:description: Transcribe audio to text with the Google Cloud Speech-to-Text API. :since: 4.19 :supportlevel: Stable :tabs-sync-option: diff --git a/components/camel-google/camel-google-speech-to-text/src/generated/resources/META-INF/org/apache/camel/component/google/speechtotext/google-speech-to-text.json b/components/camel-google/camel-google-speech-to-text/src/generated/resources/META-INF/org/apache/camel/component/google/speechtotext/google-speech-to-text.json index 0f5706024e2c..90d000d5ddcd 100644 --- a/components/camel-google/camel-google-speech-to-text/src/generated/resources/META-INF/org/apache/camel/component/google/speechtotext/google-speech-to-text.json +++ b/components/camel-google/camel-google-speech-to-text/src/generated/resources/META-INF/org/apache/camel/component/google/speechtotext/google-speech-to-text.json @@ -3,7 +3,7 @@ "kind": "component", "name": "google-speech-to-text", "title": "Google Cloud Speech To Text", - "description": "Transcribe audio to text using Google Cloud Speech-to-Text API", + "description": "Transcribe audio to text with the Google Cloud Speech-to-Text API.", "deprecated": false, "firstVersion": "4.19.0", "label": "cloud,ai", @@ -28,21 +28,21 @@ "autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] }, "headers": { - "CamelGoogleCloudSpeechToTextOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextOperations", "enum": [ "recognize" ], "deprecated": false, "autowired": false, "secret": false, "description": "The operation to perform", "constantName": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConstants#OPERATION" }, - "CamelGoogleCloudSpeechToTextResponseObject": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "com.google.cloud.speech.v1.RecognizeResponse", "deprecated": false, "autowired": false, "secret": false, "description": "The response object resulting from the Google Cloud Speech-to-Text API invocation", "constantName": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConstants#RESPONSE_OBJECT" } + "CamelGoogleCloudSpeechToTextOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextOperations", "enum": [ "recognize" ], "deprecated": false, "autowired": false, "secret": false, "description": "The operation to perform, which overrides the operation of the endpoint URI. The only operation is recognize. Not used when pojoRequest=true.", "con [...] + "CamelGoogleCloudSpeechToTextResponseObject": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "com.google.cloud.speech.v1.RecognizeResponse", "deprecated": false, "autowired": false, "secret": false, "description": "The RecognizeResponse returned by the service, with all the results and alternatives. The message body holds only the best alternative of each result.", "constantName": "org.apache.camel.component.google. [...] }, "bodyTypes": { "producerIn": { "carriers": [ "bytes", "stream", "file" ], "byOption": [ { "option": "pojoRequest", "value": "true", "carriers": [ "pojo" ], "javaType": "com.google.cloud.speech.v1.RecognizeRequest" } ], "description": "The audio to transcribe, sent inline in the encoding and sample rate of the encoding and sampleRateHertz options (LINEAR16 by default). A stream or a file is read into bytes and a String is sent as its bytes, a Map, a POJO or no body fails. With pojoRequest=true a Rec [...] "producerOut": { "carriers": [ "text" ], "javaType": "java.lang.String", "description": "The transcript: the best alternative of each result, one line per result, or an empty String when nothing is recognized, also with pojoRequest=true. The RecognizeResponse is in the CamelGoogleCloudSpeechToTextResponseObject header" } }, "properties": { - "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The operation name" }, - "serviceAccountKey": { "index": 1, "kind": "parameter", "displayName": "Service Account Key", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "Service account key to authenticate an application as a service a [...] - "encoding": { "index": 2, "kind": "parameter", "displayName": "Encoding", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "LINEAR16", "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The encoding of the audio data. Supported values: LIN [...] - "languageCode": { "index": 3, "kind": "parameter", "displayName": "Language Code", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "en-US", "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The language of the audio data as a BCP-47 lang [...] - "pojoRequest": { "index": 4, "kind": "parameter", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "Specifies if the request is a pojo request" }, - "sampleRateHertz": { "index": 5, "kind": "parameter", "displayName": "Sample Rate Hertz", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The sample rate in Hertz of the audio data. Valid values range [...] + "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "common", "label": "common", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The operation to perform. The only operation is recognize, which sends the audio in one s [...] + "serviceAccountKey": { "index": 1, "kind": "parameter", "displayName": "Service Account Key", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The service account key file (JSON) used to create the SpeechClie [...] + "encoding": { "index": 2, "kind": "parameter", "displayName": "Encoding", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "LINEAR16", "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The encoding of the audio in the message body, as a n [...] + "languageCode": { "index": 3, "kind": "parameter", "displayName": "Language Code", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "en-US", "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The language of the speech in the audio, as a B [...] + "pojoRequest": { "index": 4, "kind": "parameter", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "Whether the message body is a RecognizeRequest of the Google Cloud [...] + "sampleRateHertz": { "index": 5, "kind": "parameter", "displayName": "Sample Rate Hertz", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The sample rate in Hertz of the audio in the message body, from [...] "lazyStartProducer": { "index": 6, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...] - "client": { "index": 7, "kind": "parameter", "displayName": "Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.google.cloud.speech.v1.SpeechClient", "deprecated": false, "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The client to use during service invocation." } + "client": { "index": 7, "kind": "parameter", "displayName": "Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "com.google.cloud.speech.v1.SpeechClient", "deprecated": false, "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextConfiguration", "configurationField": "configuration", "description": "The SpeechClient to use for the calls. When not set, a single S [...] } } diff --git a/components/camel-google/camel-google-speech-to-text/src/main/docs/google-speech-to-text-component.adoc b/components/camel-google/camel-google-speech-to-text/src/main/docs/google-speech-to-text-component.adoc index eb66c2f719b8..d5cff0329059 100644 --- a/components/camel-google/camel-google-speech-to-text/src/main/docs/google-speech-to-text-component.adoc +++ b/components/camel-google/camel-google-speech-to-text/src/main/docs/google-speech-to-text-component.adoc @@ -2,7 +2,7 @@ :doctitle: Google Cloud Speech To Text :shortname: google-speech-to-text :artifactid: camel-google-speech-to-text -:description: Transcribe audio to text using Google Cloud Speech-to-Text API +:description: Transcribe audio to text with the Google Cloud Speech-to-Text API. :since: 4.19 :supportlevel: Stable :tabs-sync-option: diff --git a/components/camel-google/camel-google-speech-to-text/src/main/java/org/apache/camel/component/google/speechtotext/GoogleCloudSpeechToTextConfiguration.java b/components/camel-google/camel-google-speech-to-text/src/main/java/org/apache/camel/component/google/speechtotext/GoogleCloudSpeechToTextConfiguration.java index 79f9134fef0b..fa094e025875 100644 --- a/components/camel-google/camel-google-speech-to-text/src/main/java/org/apache/camel/component/google/speechtotext/GoogleCloudSpeechToTextConfiguration.java +++ b/components/camel-google/camel-google-speech-to-text/src/main/java/org/apache/camel/component/google/speechtotext/GoogleCloudSpeechToTextConfiguration.java @@ -27,29 +27,48 @@ import org.apache.camel.spi.UriPath; @UriParams public class GoogleCloudSpeechToTextConfiguration implements Cloneable, GoogleCommonConfiguration { - @UriPath(label = "common", description = "The operation name") + @UriPath(label = "common", + description = "The operation to perform. The only operation is recognize, which sends the audio in one synchronous" + + " call, so it suits short audio (the service accepts up to one minute). The" + + " CamelGoogleCloudSpeechToTextOperation header overrides it, and with pojoRequest=true it is ignored.") @Metadata(required = true) private String operation; - @UriParam(label = "common", description = "Service account key to authenticate an application as a service account") + @UriParam(label = "common", + description = "The service account key file (JSON) used to create the SpeechClient. It is loaded as a resource with" + + " the classpath:, file:, http: or https: prefix, and a value without a prefix is read from the" + + " classpath. When not set, the Application Default Credentials are used, for example from the" + + " GOOGLE_APPLICATION_CREDENTIALS environment variable. Not used when the client option is set.") private String serviceAccountKey; @UriParam(defaultValue = "LINEAR16", label = "producer", - description = "The encoding of the audio data. Supported values: LINEAR16, FLAC, MULAW, AMR, AMR_WB, OGG_OPUS, SPEEX_WITH_HEADER_BYTE, WEBM_OPUS, MP3") + description = "The encoding of the audio in the message body, as a name of the RecognitionConfig.AudioEncoding" + + " enum: ENCODING_UNSPECIFIED, LINEAR16, FLAC, MULAW, AMR, AMR_WB, OGG_OPUS," + + " SPEEX_WITH_HEADER_BYTE, MP3 or WEBM_OPUS. Use ENCODING_UNSPECIFIED to let the service read the" + + " encoding from the header of a FLAC or WAV file. Google documents MP3 as available only in the" + + " v1p1beta1 API, while this component calls the v1 API.") private String encoding = "LINEAR16"; @UriParam(label = "producer", - description = "The sample rate in Hertz of the audio data. Valid values range from 8000 to 48000") + description = "The sample rate in Hertz of the audio in the message body, from 8000 to 48000. When not set, no" + + " rate is sent, which works for FLAC and WAV files that carry it in their header. The service" + + " requires it for the other encodings.") private Integer sampleRateHertz; @UriParam(defaultValue = "en-US", label = "producer", - description = "The language of the audio data as a BCP-47 language tag (e.g., en-US, fr-FR)") + description = "The language of the speech in the audio, as a BCP-47 language tag such as en-US or fr-FR.") private String languageCode = "en-US"; - @UriParam(defaultValue = "false", description = "Specifies if the request is a pojo request") + @UriParam(defaultValue = "false", + description = "Whether the message body is a RecognizeRequest of the Google Cloud SDK, which is sent as it is." + + " The request then carries the audio and its RecognitionConfig, so the operation, encoding," + + " sampleRateHertz and languageCode options and the operation header are not used.") private boolean pojoRequest; - @UriParam(label = "advanced") + @UriParam(label = "advanced", + description = "The SpeechClient to use for the calls. When not set, a single SpeechClient in the registry is" + + " used, otherwise the endpoint creates one with the serviceAccountKey or the Application" + + " Default Credentials and closes it when it stops. A client that is set or autowired is not closed by the endpoint.") @Metadata(autowired = true) private SpeechClient client; @@ -57,11 +76,6 @@ public class GoogleCloudSpeechToTextConfiguration implements Cloneable, GoogleCo return operation; } - /** - * Set the operation name - * - * @param operation - */ public void setOperation(String operation) { this.operation = operation; } @@ -71,11 +85,6 @@ public class GoogleCloudSpeechToTextConfiguration implements Cloneable, GoogleCo return serviceAccountKey; } - /** - * Service account key - * - * @param serviceAccountKey - */ public void setServiceAccountKey(String serviceAccountKey) { this.serviceAccountKey = serviceAccountKey; } @@ -84,11 +93,6 @@ public class GoogleCloudSpeechToTextConfiguration implements Cloneable, GoogleCo return encoding; } - /** - * The encoding of the audio data. - * - * @param encoding - */ public void setEncoding(String encoding) { this.encoding = encoding; } @@ -97,11 +101,6 @@ public class GoogleCloudSpeechToTextConfiguration implements Cloneable, GoogleCo return sampleRateHertz; } - /** - * The sample rate in Hertz of the audio data. - * - * @param sampleRateHertz - */ public void setSampleRateHertz(Integer sampleRateHertz) { this.sampleRateHertz = sampleRateHertz; } @@ -110,11 +109,6 @@ public class GoogleCloudSpeechToTextConfiguration implements Cloneable, GoogleCo return languageCode; } - /** - * The language of the audio data as a BCP-47 language tag. - * - * @param languageCode - */ public void setLanguageCode(String languageCode) { this.languageCode = languageCode; } @@ -123,11 +117,6 @@ public class GoogleCloudSpeechToTextConfiguration implements Cloneable, GoogleCo return client; } - /** - * The client to use during service invocation. - * - * @param client - */ public void setClient(SpeechClient client) { this.client = client; } @@ -136,11 +125,6 @@ public class GoogleCloudSpeechToTextConfiguration implements Cloneable, GoogleCo return pojoRequest; } - /** - * Configure the input type. If true the message will be POJO type. - * - * @param pojoRequest - */ public void setPojoRequest(boolean pojoRequest) { this.pojoRequest = pojoRequest; } diff --git a/components/camel-google/camel-google-speech-to-text/src/main/java/org/apache/camel/component/google/speechtotext/GoogleCloudSpeechToTextConstants.java b/components/camel-google/camel-google-speech-to-text/src/main/java/org/apache/camel/component/google/speechtotext/GoogleCloudSpeechToTextConstants.java index d851c44f55c5..29cc776bca31 100644 --- a/components/camel-google/camel-google-speech-to-text/src/main/java/org/apache/camel/component/google/speechtotext/GoogleCloudSpeechToTextConstants.java +++ b/components/camel-google/camel-google-speech-to-text/src/main/java/org/apache/camel/component/google/speechtotext/GoogleCloudSpeechToTextConstants.java @@ -19,10 +19,12 @@ package org.apache.camel.component.google.speechtotext; import org.apache.camel.spi.Metadata; public interface GoogleCloudSpeechToTextConstants { - @Metadata(description = "The operation to perform", + @Metadata(description = "The operation to perform, which overrides the operation of the endpoint URI. The only" + + " operation is recognize. Not used when pojoRequest=true.", javaType = "org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextOperations") String OPERATION = "CamelGoogleCloudSpeechToTextOperation"; - @Metadata(description = "The response object resulting from the Google Cloud Speech-to-Text API invocation", + @Metadata(description = "The RecognizeResponse returned by the service, with all the results and alternatives. The" + + " message body holds only the best alternative of each result.", javaType = "com.google.cloud.speech.v1.RecognizeResponse") String RESPONSE_OBJECT = "CamelGoogleCloudSpeechToTextResponseObject"; } diff --git a/components/camel-google/camel-google-speech-to-text/src/main/java/org/apache/camel/component/google/speechtotext/GoogleCloudSpeechToTextEndpoint.java b/components/camel-google/camel-google-speech-to-text/src/main/java/org/apache/camel/component/google/speechtotext/GoogleCloudSpeechToTextEndpoint.java index e0b35c965c3c..4d4ac67a4a6f 100644 --- a/components/camel-google/camel-google-speech-to-text/src/main/java/org/apache/camel/component/google/speechtotext/GoogleCloudSpeechToTextEndpoint.java +++ b/components/camel-google/camel-google-speech-to-text/src/main/java/org/apache/camel/component/google/speechtotext/GoogleCloudSpeechToTextEndpoint.java @@ -31,7 +31,7 @@ import org.apache.camel.support.DefaultEndpoint; import org.apache.camel.util.ObjectHelper; /** - * Transcribe audio to text using Google Cloud Speech-to-Text API + * Transcribe audio to text with the Google Cloud Speech-to-Text API. */ @UriEndpoint(firstVersion = "4.19.0", scheme = "google-speech-to-text", title = "Google Cloud Speech To Text", syntax = "google-speech-to-text:operation", category = { diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java index 094474ffbf40..9c7fc4b43ca4 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java @@ -2177,7 +2177,7 @@ public interface ComponentsBuilderFactory { } /** * Google Cloud Speech To Text (camel-google-speech-to-text) - * Transcribe audio to text using Google Cloud Speech-to-Text API + * Transcribe audio to text with the Google Cloud Speech-to-Text API. * * Category: cloud,ai * Since: 4.19 diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/GoogleSpeechToTextComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/GoogleSpeechToTextComponentBuilderFactory.java index b3c3ea14d029..565cd39d79f6 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/GoogleSpeechToTextComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/GoogleSpeechToTextComponentBuilderFactory.java @@ -24,7 +24,7 @@ import org.apache.camel.builder.component.ComponentBuilder; import org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextComponent; /** - * Transcribe audio to text using Google Cloud Speech-to-Text API + * Transcribe audio to text with the Google Cloud Speech-to-Text API. * * Generated by camel build tools - do NOT edit this file! */ @@ -33,7 +33,7 @@ public interface GoogleSpeechToTextComponentBuilderFactory { /** * Google Cloud Speech To Text (camel-google-speech-to-text) - * Transcribe audio to text using Google Cloud Speech-to-Text API + * Transcribe audio to text with the Google Cloud Speech-to-Text API. * * Category: cloud,ai * Since: 4.19 diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java index 065ab01bad51..a8e44c60f62c 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java @@ -1727,7 +1727,7 @@ public class EndpointHeaderBuilders { } /** * Google Cloud Speech To Text (camel-google-speech-to-text) - * Transcribe audio to text using Google Cloud Speech-to-Text API + * Transcribe audio to text with the Google Cloud Speech-to-Text API. * * Category: cloud,ai * Since: 4.19 diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java index 5e71012cac7a..265cbd303bd2 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java @@ -7301,7 +7301,7 @@ public class StaticEndpointBuilders { } /** * Google Cloud Speech To Text (camel-google-speech-to-text) - * Transcribe audio to text using Google Cloud Speech-to-Text API + * Transcribe audio to text with the Google Cloud Speech-to-Text API. * * Category: cloud,ai * Since: 4.19 @@ -7310,7 +7310,10 @@ public class StaticEndpointBuilders { * Syntax: <code>google-speech-to-text:operation</code> * * Path parameter: operation (required) - * The operation name + * The operation to perform. The only operation is recognize, which sends + * the audio in one synchronous call, so it suits short audio (the service + * accepts up to one minute). The CamelGoogleCloudSpeechToTextOperation + * header overrides it, and with pojoRequest=true it is ignored. * * @param path operation * @return the dsl builder @@ -7320,7 +7323,7 @@ public class StaticEndpointBuilders { } /** * Google Cloud Speech To Text (camel-google-speech-to-text) - * Transcribe audio to text using Google Cloud Speech-to-Text API + * Transcribe audio to text with the Google Cloud Speech-to-Text API. * * Category: cloud,ai * Since: 4.19 @@ -7329,7 +7332,10 @@ public class StaticEndpointBuilders { * Syntax: <code>google-speech-to-text:operation</code> * * Path parameter: operation (required) - * The operation name + * The operation to perform. The only operation is recognize, which sends + * the audio in one synchronous call, so it suits short audio (the service + * accepts up to one minute). The CamelGoogleCloudSpeechToTextOperation + * header overrides it, and with pojoRequest=true it is ignored. * * @param componentName to use a custom component name for the endpoint * instead of the default name diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GoogleCloudSpeechToTextEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GoogleCloudSpeechToTextEndpointBuilderFactory.java index 1aedd504e0f8..8e7e7f2e5069 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GoogleCloudSpeechToTextEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/GoogleCloudSpeechToTextEndpointBuilderFactory.java @@ -27,7 +27,7 @@ import org.apache.camel.builder.EndpointProducerBuilder; import org.apache.camel.builder.endpoint.AbstractEndpointBuilder; /** - * Transcribe audio to text using Google Cloud Speech-to-Text API + * Transcribe audio to text with the Google Cloud Speech-to-Text API. * * Generated by camel build tools - do NOT edit this file! */ @@ -45,8 +45,12 @@ public interface GoogleCloudSpeechToTextEndpointBuilderFactory { } /** - * Service account key to authenticate an application as a service - * account. + * The service account key file (JSON) used to create the SpeechClient. + * It is loaded as a resource with the classpath:, file:, http: or + * https: prefix, and a value without a prefix is read from the + * classpath. When not set, the Application Default Credentials are + * used, for example from the GOOGLE_APPLICATION_CREDENTIALS environment + * variable. Not used when the client option is set. * * The option is a: <code>java.lang.String</code> type. * @@ -60,8 +64,13 @@ public interface GoogleCloudSpeechToTextEndpointBuilderFactory { return this; } /** - * The encoding of the audio data. Supported values: LINEAR16, FLAC, - * MULAW, AMR, AMR_WB, OGG_OPUS, SPEEX_WITH_HEADER_BYTE, WEBM_OPUS, MP3. + * The encoding of the audio in the message body, as a name of the + * RecognitionConfig.AudioEncoding enum: ENCODING_UNSPECIFIED, LINEAR16, + * FLAC, MULAW, AMR, AMR_WB, OGG_OPUS, SPEEX_WITH_HEADER_BYTE, MP3 or + * WEBM_OPUS. Use ENCODING_UNSPECIFIED to let the service read the + * encoding from the header of a FLAC or WAV file. Google documents MP3 + * as available only in the v1p1beta1 API, while this component calls + * the v1 API. * * The option is a: <code>java.lang.String</code> type. * @@ -76,8 +85,8 @@ public interface GoogleCloudSpeechToTextEndpointBuilderFactory { return this; } /** - * The language of the audio data as a BCP-47 language tag (e.g., en-US, - * fr-FR). + * The language of the speech in the audio, as a BCP-47 language tag + * such as en-US or fr-FR. * * The option is a: <code>java.lang.String</code> type. * @@ -92,7 +101,10 @@ public interface GoogleCloudSpeechToTextEndpointBuilderFactory { return this; } /** - * Specifies if the request is a pojo request. + * Whether the message body is a RecognizeRequest of the Google Cloud + * SDK, which is sent as it is. The request then carries the audio and + * its RecognitionConfig, so the operation, encoding, sampleRateHertz + * and languageCode options and the operation header are not used. * * The option is a: <code>boolean</code> type. * @@ -107,7 +119,10 @@ public interface GoogleCloudSpeechToTextEndpointBuilderFactory { return this; } /** - * Specifies if the request is a pojo request. + * Whether the message body is a RecognizeRequest of the Google Cloud + * SDK, which is sent as it is. The request then carries the audio and + * its RecognitionConfig, so the operation, encoding, sampleRateHertz + * and languageCode options and the operation header are not used. * * The option will be converted to a <code>boolean</code> type. * @@ -122,8 +137,10 @@ public interface GoogleCloudSpeechToTextEndpointBuilderFactory { return this; } /** - * The sample rate in Hertz of the audio data. Valid values range from - * 8000 to 48000. + * The sample rate in Hertz of the audio in the message body, from 8000 + * to 48000. When not set, no rate is sent, which works for FLAC and WAV + * files that carry it in their header. The service requires it for the + * other encodings. * * The option is a: <code>java.lang.Integer</code> type. * @@ -137,8 +154,10 @@ public interface GoogleCloudSpeechToTextEndpointBuilderFactory { return this; } /** - * The sample rate in Hertz of the audio data. Valid values range from - * 8000 to 48000. + * The sample rate in Hertz of the audio in the message body, from 8000 + * to 48000. When not set, no rate is sent, which works for FLAC and WAV + * files that carry it in their header. The service requires it for the + * other encodings. * * The option will be converted to a <code>java.lang.Integer</code> * type. @@ -211,7 +230,11 @@ public interface GoogleCloudSpeechToTextEndpointBuilderFactory { return this; } /** - * The client to use during service invocation. + * The SpeechClient to use for the calls. When not set, a single + * SpeechClient in the registry is used, otherwise the endpoint creates + * one with the serviceAccountKey or the Application Default Credentials + * and closes it when it stops. A client that is set or autowired is not + * closed by the endpoint. * * The option is a: <code>com.google.cloud.speech.v1.SpeechClient</code> * type. @@ -226,7 +249,11 @@ public interface GoogleCloudSpeechToTextEndpointBuilderFactory { return this; } /** - * The client to use during service invocation. + * The SpeechClient to use for the calls. When not set, a single + * SpeechClient in the registry is used, otherwise the endpoint creates + * one with the serviceAccountKey or the Application Default Credentials + * and closes it when it stops. A client that is set or autowired is not + * closed by the endpoint. * * The option will be converted to a * <code>com.google.cloud.speech.v1.SpeechClient</code> type. @@ -245,7 +272,7 @@ public interface GoogleCloudSpeechToTextEndpointBuilderFactory { public interface GoogleCloudSpeechToTextBuilders { /** * Google Cloud Speech To Text (camel-google-speech-to-text) - * Transcribe audio to text using Google Cloud Speech-to-Text API + * Transcribe audio to text with the Google Cloud Speech-to-Text API. * * Category: cloud,ai * Since: 4.19 @@ -258,7 +285,7 @@ public interface GoogleCloudSpeechToTextEndpointBuilderFactory { } /** * Google Cloud Speech To Text (camel-google-speech-to-text) - * Transcribe audio to text using Google Cloud Speech-to-Text API + * Transcribe audio to text with the Google Cloud Speech-to-Text API. * * Category: cloud,ai * Since: 4.19 @@ -267,7 +294,11 @@ public interface GoogleCloudSpeechToTextEndpointBuilderFactory { * Syntax: <code>google-speech-to-text:operation</code> * * Path parameter: operation (required) - * The operation name + * The operation to perform. The only operation is recognize, which + * sends the audio in one synchronous call, so it suits short audio (the + * service accepts up to one minute). The + * CamelGoogleCloudSpeechToTextOperation header overrides it, and with + * pojoRequest=true it is ignored. * * @param path operation * @return the dsl builder @@ -277,7 +308,7 @@ public interface GoogleCloudSpeechToTextEndpointBuilderFactory { } /** * Google Cloud Speech To Text (camel-google-speech-to-text) - * Transcribe audio to text using Google Cloud Speech-to-Text API + * Transcribe audio to text with the Google Cloud Speech-to-Text API. * * Category: cloud,ai * Since: 4.19 @@ -286,7 +317,11 @@ public interface GoogleCloudSpeechToTextEndpointBuilderFactory { * Syntax: <code>google-speech-to-text:operation</code> * * Path parameter: operation (required) - * The operation name + * The operation to perform. The only operation is recognize, which + * sends the audio in one synchronous call, so it suits short audio (the + * service accepts up to one minute). The + * CamelGoogleCloudSpeechToTextOperation header overrides it, and with + * pojoRequest=true it is ignored. * * @param componentName to use a custom component name for the endpoint * instead of the default name @@ -309,7 +344,9 @@ public interface GoogleCloudSpeechToTextEndpointBuilderFactory { public static final GoogleCloudSpeechToTextHeaderNameBuilder INSTANCE = new GoogleCloudSpeechToTextHeaderNameBuilder(); /** - * The operation to perform. + * The operation to perform, which overrides the operation of the + * endpoint URI. The only operation is recognize. Not used when + * pojoRequest=true. * * The option is a: {@code * org.apache.camel.component.google.speechtotext.GoogleCloudSpeechToTextOperations} type. @@ -323,8 +360,9 @@ public interface GoogleCloudSpeechToTextEndpointBuilderFactory { return "CamelGoogleCloudSpeechToTextOperation"; } /** - * The response object resulting from the Google Cloud Speech-to-Text - * API invocation. + * The RecognizeResponse returned by the service, with all the results + * and alternatives. The message body holds only the best alternative of + * each result. * * The option is a: {@code com.google.cloud.speech.v1.RecognizeResponse} * type. diff --git a/tasks/component-descriptions.md b/tasks/component-descriptions.md index ff7ccf37b7a2..d736da4f58e2 100644 --- a/tasks/component-descriptions.md +++ b/tasks/component-descriptions.md @@ -192,7 +192,7 @@ or removes its row. | camel-google-pubsub | google-pubsub | | | camel-google-secret-manager | google-secret-manager | | | camel-google-sheets | google-sheets, google-sheets-stream | | -| camel-google-speech-to-text | google-speech-to-text | | +| camel-google-speech-to-text | google-speech-to-text | yes | | camel-google-storage | google-storage | | | camel-google-text-to-speech | google-text-to-speech | | | camel-google-vertexai | google-vertexai | |
