You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by fm...@apache.org on 2026/05/04 11:45:54 UTC
(camel) 01/02: CAMEL-23390: Add audio transcription support to camel-openai
This is an automated email from the ASF dual-hosted git repository.
Croway pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 9f0b0bb4d8ee4f81eb7156d31ac012215b7b0b22
Author: Croway <fe...@gmail.com>
AuthorDate: Thu Apr 30 16:01:01 2026 +0200
CAMEL-23390: Add audio transcription support to camel-openai
Add a new 'audio-transcription' operation that transcribes audio files
using OpenAI's speech-to-text models (Whisper, GPT-4o Transcribe) via
the existing openai-java SDK.
---
.../apache/camel/catalog/components/openai.json | 106 +++++++------
.../openai/OpenAIComponentConfigurer.java | 6 +
.../component/openai/OpenAIEndpointConfigurer.java | 36 +++++
.../component/openai/OpenAIEndpointUriFactory.java | 8 +-
.../org/apache/camel/component/openai/openai.json | 106 +++++++------
.../src/main/docs/openai-component.adoc | 105 ++++++++++++-
.../openai/OpenAIAudioTranscriptionProducer.java | 165 +++++++++++++++++++++
.../camel/component/openai/OpenAIComponent.java | 16 +-
.../component/openai/OpenAIConfiguration.java | 75 ++++++++++
.../camel/component/openai/OpenAIConstants.java | 15 ++
.../camel/component/openai/OpenAIEndpoint.java | 6 +-
.../camel/component/openai/OpenAIOperations.java | 6 +-
.../openai/OpenAIAudioTranscriptionMockTest.java | 140 +++++++++++++++++
.../camel/component/openai/OpenAIMtlsMockTest.java | 4 +-
.../openai/OpenAISslContextParametersTest.java | 2 +-
.../camel/component/openai/OpenAISslMockTest.java | 4 +-
.../openai/mock/AudioTranscriptionExpectation.java | 57 +++++++
.../mock/AudioTranscriptionRequestHandler.java | 70 +++++++++
.../mock/AudioTranscriptionResponseBuilder.java | 37 ++---
.../camel/test/infra/openai/mock/OpenAIMock.java | 11 +-
.../test/infra/openai/mock/OpenAIMockBuilder.java | 56 ++++++-
.../infra/openai/mock/OpenAIMockServerHandler.java | 8 +-
22 files changed, 900 insertions(+), 139 deletions(-)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/openai.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/openai.json
index 51e7541effeb..4b9f9e775b86 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/openai.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/openai.json
@@ -3,7 +3,7 @@
"kind": "component",
"name": "openai",
"title": "OpenAI",
- "description": "OpenAI endpoint for chat completion and embeddings.",
+ "description": "OpenAI endpoint for chat completion, embeddings, and audio transcription.",
"deprecated": false,
"firstVersion": "4.17.0",
"label": "ai",
@@ -25,12 +25,13 @@
},
"componentProperties": {
"apiKey": { "index": 0, "kind": "property", "displayName": "Api Key", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Default API key for all endpoints" },
- "baseUrl": { "index": 1, "kind": "property", "displayName": "Base Url", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "https:\/\/api.openai.com\/v1", "description": "Default base URL for all endpoints" },
- "embeddingModel": { "index": 2, "kind": "property", "displayName": "Embedding Model", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Default model for embeddings endpoints" },
- "lazyStartProducer": { "index": 3, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "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 producer may otherwise fail [...]
- "model": { "index": 4, "kind": "property", "displayName": "Model", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Default model for chat completion endpoints" },
- "autowiredEnabled": { "index": 5, "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 [...]
- "useGlobalSslContextParameters": { "index": 6, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters" }
+ "audioModel": { "index": 1, "kind": "property", "displayName": "Audio Model", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Default model for audio transcription endpoints" },
+ "baseUrl": { "index": 2, "kind": "property", "displayName": "Base Url", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "https:\/\/api.openai.com\/v1", "description": "Default base URL for all endpoints" },
+ "embeddingModel": { "index": 3, "kind": "property", "displayName": "Embedding Model", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Default model for embeddings endpoints" },
+ "lazyStartProducer": { "index": 4, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "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 producer may otherwise fail [...]
+ "model": { "index": 5, "kind": "property", "displayName": "Model", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Default model for chat completion endpoints" },
+ "autowiredEnabled": { "index": 6, "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 [...]
+ "useGlobalSslContextParameters": { "index": 7, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters" }
},
"headers": {
"CamelOpenAIUserMessage": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The user message to send to the OpenAI chat completion API", "constantName": "org.apache.camel.component.openai.OpenAIConstants#USER_MESSAGE" },
@@ -62,49 +63,60 @@
"CamelOpenAIEmbeddingVectorSize": { "index": 26, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Vector dimensions of the embeddings", "constantName": "org.apache.camel.component.openai.OpenAIConstants#EMBEDDING_VECTOR_SIZE" },
"CamelOpenAIReferenceEmbedding": { "index": 27, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "List<Float>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Reference embedding vector for similarity comparison", "constantName": "org.apache.camel.component.openai.OpenAIConstants#REFERENCE_EMBEDDING" },
"CamelOpenAISimilarityScore": { "index": 28, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Double", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Calculated cosine similarity score (0.0 to 1.0)", "constantName": "org.apache.camel.component.openai.OpenAIConstants#SIMILARITY_SCORE" },
- "CamelOpenAIOriginalText": { "index": 29, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String or List<String>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Original text content when embeddings operation is used", "constantName": "org.apache.camel.component.openai.OpenAIConstants#ORIGINAL_TEXT" }
+ "CamelOpenAIOriginalText": { "index": 29, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String or List<String>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Original text content when embeddings operation is used", "constantName": "org.apache.camel.component.openai.OpenAIConstants#ORIGINAL_TEXT" },
+ "CamelOpenAIAudioModel": { "index": 30, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The model to use for audio transcription", "constantName": "org.apache.camel.component.openai.OpenAIConstants#AUDIO_MODEL" },
+ "CamelOpenAIAudioLanguage": { "index": 31, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The language of the input audio (ISO-639-1)", "constantName": "org.apache.camel.component.openai.OpenAIConstants#AUDIO_LANGUAGE" },
+ "CamelOpenAIAudioResponseFormat": { "index": 32, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The response format for audio transcription (json, text, srt, verbose_json, vtt)", "constantName": "org.apache.camel.component.openai.OpenAIConstants#AUDIO_RESPONSE_FORMAT" },
+ "CamelOpenAIAudioDuration": { "index": 33, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Double", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Duration of the audio in seconds (verbose_json only)", "constantName": "org.apache.camel.component.openai.OpenAIConstants#AUDIO_DURATION" },
+ "CamelOpenAIAudioDetectedLanguage": { "index": 34, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Language detected in the audio (verbose_json only)", "constantName": "org.apache.camel.component.openai.OpenAIConstants#AUDIO_DETECTED_LANGUAGE" }
},
"properties": {
- "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.openai.OpenAIOperations", "enum": [ "chat-completion", "embeddings", "tool-execution" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform: 'chat-completion', 'embeddings', or 'tool-execution'" },
+ "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.openai.OpenAIOperations", "enum": [ "chat-completion", "embeddings", "tool-execution", "audio-transcription" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform: 'chat-completion', 'embeddings', 'tool-execution', or 'audio-transcription'" },
"additionalBodyProperty": { "index": 1, "kind": "parameter", "displayName": "Additional Body Property", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "additionalBodyProperty.", "multiValue": true, "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configur [...]
"apiKey": { "index": 2, "kind": "parameter", "displayName": "Api Key", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "OpenAI API key. Can also be set via OPENAI_API_KEY environment variable." },
- "autoToolExecution": { "index": 3, "kind": "parameter", "displayName": "Auto Tool Execution", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "When true and MCP servers are configured, automatically execut [...]
- "baseUrl": { "index": 4, "kind": "parameter", "displayName": "Base Url", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "https:\/\/api.openai.com\/v1", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Base URL for OpenAI API. Defaults to OpenAI's off [...]
- "conversationHistoryProperty": { "index": 5, "kind": "parameter", "displayName": "Conversation History Property", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "CamelOpenAIConversationHistory", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Exchan [...]
- "conversationMemory": { "index": 6, "kind": "parameter", "displayName": "Conversation Memory", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Enable conversation memory per Exchange" },
- "developerMessage": { "index": 7, "kind": "parameter", "displayName": "Developer Message", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Developer message to prepend before user messages" },
- "dimensions": { "index": 8, "kind": "parameter", "displayName": "Dimensions", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Number of dimensions for the embedding output. Only supported by text-embedding-3 models. [...]
- "embeddingModel": { "index": 9, "kind": "parameter", "displayName": "Embedding Model", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The model to use for embeddings" },
- "encodingFormat": { "index": 10, "kind": "parameter", "displayName": "Encoding Format", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "float", "base64" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "base64", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The format for embedding ou [...]
- "jsonSchema": { "index": 11, "kind": "parameter", "displayName": "Json Schema", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "supportFileReference": true, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "JSON schema for structured output validation" },
- "maxTokens": { "index": 12, "kind": "parameter", "displayName": "Max Tokens", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Maximum number of tokens to generate" },
- "maxToolIterations": { "index": 13, "kind": "parameter", "displayName": "Max Tool Iterations", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": 50, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Maximum number of tool call loop iterations to prevent infinite loops" },
- "mcpProtocolVersions": { "index": 14, "kind": "parameter", "displayName": "Mcp Protocol Versions", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Comma-separated list of MCP protocol versions to advertise when connect [...]
- "mcpReconnect": { "index": 15, "kind": "parameter", "displayName": "Mcp Reconnect", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Automatically reconnect to MCP servers when a tool call fails due to a t [...]
- "mcpServer": { "index": 16, "kind": "parameter", "displayName": "Mcp Server", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "mcpServer.", "multiValue": true, "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "MCP (Model Cont [...]
- "mcpTimeout": { "index": 17, "kind": "parameter", "displayName": "Mcp Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": 20, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Timeout in seconds for MCP tool call requests. Applies to all MCP operations inclu [...]
- "model": { "index": 18, "kind": "parameter", "displayName": "Model", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The model to use for chat completion" },
- "outputClass": { "index": 19, "kind": "parameter", "displayName": "Output Class", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Fully qualified class name for structured output using response format" },
- "storeFullResponse": { "index": 20, "kind": "parameter", "displayName": "Store Full Response", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Store the full response in the exchange property 'CamelOpenA [...]
- "streaming": { "index": 21, "kind": "parameter", "displayName": "Streaming", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Enable streaming responses" },
- "stripThinking": { "index": 22, "kind": "parameter", "displayName": "Strip Thinking", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Strip ... blocks from model responses (used by reasoning models like [...]
- "systemMessage": { "index": 23, "kind": "parameter", "displayName": "System Message", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "System message to prepend. When set and conversationMemory is enabled, the conversat [...]
- "temperature": { "index": 24, "kind": "parameter", "displayName": "Temperature", "group": "producer", "label": "", "required": false, "type": "number", "javaType": "java.lang.Double", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Temperature for response generation (0.0 to 2.0)" },
- "topP": { "index": 25, "kind": "parameter", "displayName": "Top P", "group": "producer", "label": "", "required": false, "type": "number", "javaType": "java.lang.Double", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Top P for response generation (0.0 to 1.0)" },
- "userMessage": { "index": 26, "kind": "parameter", "displayName": "User Message", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Default user message text to use when no prompt is provided" },
- "lazyStartProducer": { "index": 27, "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 produ [...]
- "oauthProfile": { "index": 28, "kind": "parameter", "displayName": "Oauth Profile", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "OAuth profile name for obtaining an access token via the OAuth 2.0 Client Cred [...]
- "sslContextParameters": { "index": 29, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "SSLContextParameters to use [...]
- "sslEndpointAlgorithm": { "index": 30, "kind": "parameter", "displayName": "Ssl Endpoint Algorithm", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "https", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The endpoint identification algorith [...]
- "sslKeymanagerAlgorithm": { "index": 31, "kind": "parameter", "displayName": "Ssl Keymanager Algorithm", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "SunX509", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The algorithm used by the key [...]
- "sslKeyPassword": { "index": 32, "kind": "parameter", "displayName": "Ssl Key Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The password of the private key in the key store file" },
- "sslKeystoreLocation": { "index": 33, "kind": "parameter", "displayName": "Ssl Keystore Location", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The location of the key store file. This is optional and can be [...]
- "sslKeystorePassword": { "index": 34, "kind": "parameter", "displayName": "Ssl Keystore Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The store password for the key store file" },
- "sslKeystoreType": { "index": 35, "kind": "parameter", "displayName": "Ssl Keystore Type", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "JKS", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The file format of the key store file" },
- "sslProtocol": { "index": 36, "kind": "parameter", "displayName": "Ssl Protocol", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "TLSv1.3", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The SSL protocol used to generate the SSLContext" },
- "sslTrustmanagerAlgorithm": { "index": 37, "kind": "parameter", "displayName": "Ssl Trustmanager Algorithm", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "PKIX", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The algorithm used by the tru [...]
- "sslTruststoreLocation": { "index": 38, "kind": "parameter", "displayName": "Ssl Truststore Location", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The location of the trust store file, used to validate the [...]
- "sslTruststorePassword": { "index": 39, "kind": "parameter", "displayName": "Ssl Truststore Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The password for the trust store file. [...]
- "sslTruststoreType": { "index": 40, "kind": "parameter", "displayName": "Ssl Truststore Type", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "JKS", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The file format of the trust store file" }
+ "audioLanguage": { "index": 3, "kind": "parameter", "displayName": "Audio Language", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The language of the input audio in ISO-639-1 format (e.g., 'en'). Improves accuracy a [...]
+ "audioModel": { "index": 4, "kind": "parameter", "displayName": "Audio Model", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The model to use for audio transcription (e.g., whisper-1, gpt-4o-transcribe)" },
+ "audioPrompt": { "index": 5, "kind": "parameter", "displayName": "Audio Prompt", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Optional text to guide the model's style or continue a previous audio segment" },
+ "audioResponseFormat": { "index": 6, "kind": "parameter", "displayName": "Audio Response Format", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "json", "text", "srt", "verbose_json", "vtt" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "json", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "descrip [...]
+ "audioTemperature": { "index": 7, "kind": "parameter", "displayName": "Audio Temperature", "group": "producer", "label": "", "required": false, "type": "number", "javaType": "java.lang.Double", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Sampling temperature for transcription (0.0 to 1.0)" },
+ "audioTimestampGranularities": { "index": 8, "kind": "parameter", "displayName": "Audio Timestamp Granularities", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Comma-separated timestamp granularities: 'word', 'segmen [...]
+ "autoToolExecution": { "index": 9, "kind": "parameter", "displayName": "Auto Tool Execution", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "When true and MCP servers are configured, automatically execut [...]
+ "baseUrl": { "index": 10, "kind": "parameter", "displayName": "Base Url", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "https:\/\/api.openai.com\/v1", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Base URL for OpenAI API. Defaults to OpenAI's of [...]
+ "conversationHistoryProperty": { "index": 11, "kind": "parameter", "displayName": "Conversation History Property", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "CamelOpenAIConversationHistory", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Excha [...]
+ "conversationMemory": { "index": 12, "kind": "parameter", "displayName": "Conversation Memory", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Enable conversation memory per Exchange" },
+ "developerMessage": { "index": 13, "kind": "parameter", "displayName": "Developer Message", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Developer message to prepend before user messages" },
+ "dimensions": { "index": 14, "kind": "parameter", "displayName": "Dimensions", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Number of dimensions for the embedding output. Only supported by text-embedding-3 models. [...]
+ "embeddingModel": { "index": 15, "kind": "parameter", "displayName": "Embedding Model", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The model to use for embeddings" },
+ "encodingFormat": { "index": 16, "kind": "parameter", "displayName": "Encoding Format", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "float", "base64" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "base64", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The format for embedding ou [...]
+ "jsonSchema": { "index": 17, "kind": "parameter", "displayName": "Json Schema", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "supportFileReference": true, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "JSON schema for structured output validation" },
+ "maxTokens": { "index": 18, "kind": "parameter", "displayName": "Max Tokens", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Maximum number of tokens to generate" },
+ "maxToolIterations": { "index": 19, "kind": "parameter", "displayName": "Max Tool Iterations", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": 50, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Maximum number of tool call loop iterations to prevent infinite loops" },
+ "mcpProtocolVersions": { "index": 20, "kind": "parameter", "displayName": "Mcp Protocol Versions", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Comma-separated list of MCP protocol versions to advertise when connect [...]
+ "mcpReconnect": { "index": 21, "kind": "parameter", "displayName": "Mcp Reconnect", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Automatically reconnect to MCP servers when a tool call fails due to a t [...]
+ "mcpServer": { "index": 22, "kind": "parameter", "displayName": "Mcp Server", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "mcpServer.", "multiValue": true, "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "MCP (Model Cont [...]
+ "mcpTimeout": { "index": 23, "kind": "parameter", "displayName": "Mcp Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": 20, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Timeout in seconds for MCP tool call requests. Applies to all MCP operations inclu [...]
+ "model": { "index": 24, "kind": "parameter", "displayName": "Model", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The model to use for chat completion" },
+ "outputClass": { "index": 25, "kind": "parameter", "displayName": "Output Class", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Fully qualified class name for structured output using response format" },
+ "storeFullResponse": { "index": 26, "kind": "parameter", "displayName": "Store Full Response", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Store the full response in the exchange property 'CamelOpenA [...]
+ "streaming": { "index": 27, "kind": "parameter", "displayName": "Streaming", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Enable streaming responses" },
+ "stripThinking": { "index": 28, "kind": "parameter", "displayName": "Strip Thinking", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Strip ... blocks from model responses (used by reasoning models like [...]
+ "systemMessage": { "index": 29, "kind": "parameter", "displayName": "System Message", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "System message to prepend. When set and conversationMemory is enabled, the conversat [...]
+ "temperature": { "index": 30, "kind": "parameter", "displayName": "Temperature", "group": "producer", "label": "", "required": false, "type": "number", "javaType": "java.lang.Double", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Temperature for response generation (0.0 to 2.0)" },
+ "topP": { "index": 31, "kind": "parameter", "displayName": "Top P", "group": "producer", "label": "", "required": false, "type": "number", "javaType": "java.lang.Double", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Top P for response generation (0.0 to 1.0)" },
+ "userMessage": { "index": 32, "kind": "parameter", "displayName": "User Message", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Default user message text to use when no prompt is provided" },
+ "lazyStartProducer": { "index": 33, "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 produ [...]
+ "oauthProfile": { "index": 34, "kind": "parameter", "displayName": "Oauth Profile", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "OAuth profile name for obtaining an access token via the OAuth 2.0 Client Cred [...]
+ "sslContextParameters": { "index": 35, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "SSLContextParameters to use [...]
+ "sslEndpointAlgorithm": { "index": 36, "kind": "parameter", "displayName": "Ssl Endpoint Algorithm", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "https", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The endpoint identification algorith [...]
+ "sslKeymanagerAlgorithm": { "index": 37, "kind": "parameter", "displayName": "Ssl Keymanager Algorithm", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "SunX509", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The algorithm used by the key [...]
+ "sslKeyPassword": { "index": 38, "kind": "parameter", "displayName": "Ssl Key Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The password of the private key in the key store file" },
+ "sslKeystoreLocation": { "index": 39, "kind": "parameter", "displayName": "Ssl Keystore Location", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The location of the key store file. This is optional and can be [...]
+ "sslKeystorePassword": { "index": 40, "kind": "parameter", "displayName": "Ssl Keystore Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The store password for the key store file" },
+ "sslKeystoreType": { "index": 41, "kind": "parameter", "displayName": "Ssl Keystore Type", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "JKS", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The file format of the key store file" },
+ "sslProtocol": { "index": 42, "kind": "parameter", "displayName": "Ssl Protocol", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "TLSv1.3", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The SSL protocol used to generate the SSLContext" },
+ "sslTrustmanagerAlgorithm": { "index": 43, "kind": "parameter", "displayName": "Ssl Trustmanager Algorithm", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "PKIX", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The algorithm used by the tru [...]
+ "sslTruststoreLocation": { "index": 44, "kind": "parameter", "displayName": "Ssl Truststore Location", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The location of the trust store file, used to validate the [...]
+ "sslTruststorePassword": { "index": 45, "kind": "parameter", "displayName": "Ssl Truststore Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The password for the trust store file. [...]
+ "sslTruststoreType": { "index": 46, "kind": "parameter", "displayName": "Ssl Truststore Type", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "JKS", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The file format of the trust store file" }
}
}
diff --git a/components/camel-ai/camel-openai/src/generated/java/org/apache/camel/component/openai/OpenAIComponentConfigurer.java b/components/camel-ai/camel-openai/src/generated/java/org/apache/camel/component/openai/OpenAIComponentConfigurer.java
index 03117979ab1a..55e02b8fc65d 100644
--- a/components/camel-ai/camel-openai/src/generated/java/org/apache/camel/component/openai/OpenAIComponentConfigurer.java
+++ b/components/camel-ai/camel-openai/src/generated/java/org/apache/camel/component/openai/OpenAIComponentConfigurer.java
@@ -25,6 +25,8 @@ public class OpenAIComponentConfigurer extends PropertyConfigurerSupport impleme
switch (ignoreCase ? name.toLowerCase() : name) {
case "apikey":
case "apiKey": target.setApiKey(property(camelContext, java.lang.String.class, value)); return true;
+ case "audiomodel":
+ case "audioModel": target.setAudioModel(property(camelContext, java.lang.String.class, value)); return true;
case "autowiredenabled":
case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
case "baseurl":
@@ -45,6 +47,8 @@ public class OpenAIComponentConfigurer extends PropertyConfigurerSupport impleme
switch (ignoreCase ? name.toLowerCase() : name) {
case "apikey":
case "apiKey": return java.lang.String.class;
+ case "audiomodel":
+ case "audioModel": return java.lang.String.class;
case "autowiredenabled":
case "autowiredEnabled": return boolean.class;
case "baseurl":
@@ -66,6 +70,8 @@ public class OpenAIComponentConfigurer extends PropertyConfigurerSupport impleme
switch (ignoreCase ? name.toLowerCase() : name) {
case "apikey":
case "apiKey": return target.getApiKey();
+ case "audiomodel":
+ case "audioModel": return target.getAudioModel();
case "autowiredenabled":
case "autowiredEnabled": return target.isAutowiredEnabled();
case "baseurl":
diff --git a/components/camel-ai/camel-openai/src/generated/java/org/apache/camel/component/openai/OpenAIEndpointConfigurer.java b/components/camel-ai/camel-openai/src/generated/java/org/apache/camel/component/openai/OpenAIEndpointConfigurer.java
index fd752107df0b..a7abe5d9b6b5 100644
--- a/components/camel-ai/camel-openai/src/generated/java/org/apache/camel/component/openai/OpenAIEndpointConfigurer.java
+++ b/components/camel-ai/camel-openai/src/generated/java/org/apache/camel/component/openai/OpenAIEndpointConfigurer.java
@@ -27,6 +27,18 @@ public class OpenAIEndpointConfigurer extends PropertyConfigurerSupport implemen
case "additionalBodyProperty": target.getConfiguration().setAdditionalBodyProperty(property(camelContext, java.util.Map.class, value)); return true;
case "apikey":
case "apiKey": target.getConfiguration().setApiKey(property(camelContext, java.lang.String.class, value)); return true;
+ case "audiolanguage":
+ case "audioLanguage": target.getConfiguration().setAudioLanguage(property(camelContext, java.lang.String.class, value)); return true;
+ case "audiomodel":
+ case "audioModel": target.getConfiguration().setAudioModel(property(camelContext, java.lang.String.class, value)); return true;
+ case "audioprompt":
+ case "audioPrompt": target.getConfiguration().setAudioPrompt(property(camelContext, java.lang.String.class, value)); return true;
+ case "audioresponseformat":
+ case "audioResponseFormat": target.getConfiguration().setAudioResponseFormat(property(camelContext, java.lang.String.class, value)); return true;
+ case "audiotemperature":
+ case "audioTemperature": target.getConfiguration().setAudioTemperature(property(camelContext, java.lang.Double.class, value)); return true;
+ case "audiotimestampgranularities":
+ case "audioTimestampGranularities": target.getConfiguration().setAudioTimestampGranularities(property(camelContext, java.lang.String.class, value)); return true;
case "autotoolexecution":
case "autoToolExecution": target.getConfiguration().setAutoToolExecution(property(camelContext, boolean.class, value)); return true;
case "baseurl":
@@ -110,6 +122,18 @@ public class OpenAIEndpointConfigurer extends PropertyConfigurerSupport implemen
case "additionalBodyProperty": return java.util.Map.class;
case "apikey":
case "apiKey": return java.lang.String.class;
+ case "audiolanguage":
+ case "audioLanguage": return java.lang.String.class;
+ case "audiomodel":
+ case "audioModel": return java.lang.String.class;
+ case "audioprompt":
+ case "audioPrompt": return java.lang.String.class;
+ case "audioresponseformat":
+ case "audioResponseFormat": return java.lang.String.class;
+ case "audiotemperature":
+ case "audioTemperature": return java.lang.Double.class;
+ case "audiotimestampgranularities":
+ case "audioTimestampGranularities": return java.lang.String.class;
case "autotoolexecution":
case "autoToolExecution": return boolean.class;
case "baseurl":
@@ -194,6 +218,18 @@ public class OpenAIEndpointConfigurer extends PropertyConfigurerSupport implemen
case "additionalBodyProperty": return target.getConfiguration().getAdditionalBodyProperty();
case "apikey":
case "apiKey": return target.getConfiguration().getApiKey();
+ case "audiolanguage":
+ case "audioLanguage": return target.getConfiguration().getAudioLanguage();
+ case "audiomodel":
+ case "audioModel": return target.getConfiguration().getAudioModel();
+ case "audioprompt":
+ case "audioPrompt": return target.getConfiguration().getAudioPrompt();
+ case "audioresponseformat":
+ case "audioResponseFormat": return target.getConfiguration().getAudioResponseFormat();
+ case "audiotemperature":
+ case "audioTemperature": return target.getConfiguration().getAudioTemperature();
+ case "audiotimestampgranularities":
+ case "audioTimestampGranularities": return target.getConfiguration().getAudioTimestampGranularities();
case "autotoolexecution":
case "autoToolExecution": return target.getConfiguration().isAutoToolExecution();
case "baseurl":
diff --git a/components/camel-ai/camel-openai/src/generated/java/org/apache/camel/component/openai/OpenAIEndpointUriFactory.java b/components/camel-ai/camel-openai/src/generated/java/org/apache/camel/component/openai/OpenAIEndpointUriFactory.java
index 4f41e0861345..28fa71287108 100644
--- a/components/camel-ai/camel-openai/src/generated/java/org/apache/camel/component/openai/OpenAIEndpointUriFactory.java
+++ b/components/camel-ai/camel-openai/src/generated/java/org/apache/camel/component/openai/OpenAIEndpointUriFactory.java
@@ -23,9 +23,15 @@ public class OpenAIEndpointUriFactory extends org.apache.camel.support.component
private static final Set<String> SECRET_PROPERTY_NAMES;
private static final Map<String, String> MULTI_VALUE_PREFIXES;
static {
- Set<String> props = new HashSet<>(41);
+ Set<String> props = new HashSet<>(47);
props.add("additionalBodyProperty");
props.add("apiKey");
+ props.add("audioLanguage");
+ props.add("audioModel");
+ props.add("audioPrompt");
+ props.add("audioResponseFormat");
+ props.add("audioTemperature");
+ props.add("audioTimestampGranularities");
props.add("autoToolExecution");
props.add("baseUrl");
props.add("conversationHistoryProperty");
diff --git a/components/camel-ai/camel-openai/src/generated/resources/META-INF/org/apache/camel/component/openai/openai.json b/components/camel-ai/camel-openai/src/generated/resources/META-INF/org/apache/camel/component/openai/openai.json
index 51e7541effeb..4b9f9e775b86 100644
--- a/components/camel-ai/camel-openai/src/generated/resources/META-INF/org/apache/camel/component/openai/openai.json
+++ b/components/camel-ai/camel-openai/src/generated/resources/META-INF/org/apache/camel/component/openai/openai.json
@@ -3,7 +3,7 @@
"kind": "component",
"name": "openai",
"title": "OpenAI",
- "description": "OpenAI endpoint for chat completion and embeddings.",
+ "description": "OpenAI endpoint for chat completion, embeddings, and audio transcription.",
"deprecated": false,
"firstVersion": "4.17.0",
"label": "ai",
@@ -25,12 +25,13 @@
},
"componentProperties": {
"apiKey": { "index": 0, "kind": "property", "displayName": "Api Key", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Default API key for all endpoints" },
- "baseUrl": { "index": 1, "kind": "property", "displayName": "Base Url", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "https:\/\/api.openai.com\/v1", "description": "Default base URL for all endpoints" },
- "embeddingModel": { "index": 2, "kind": "property", "displayName": "Embedding Model", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Default model for embeddings endpoints" },
- "lazyStartProducer": { "index": 3, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "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 producer may otherwise fail [...]
- "model": { "index": 4, "kind": "property", "displayName": "Model", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Default model for chat completion endpoints" },
- "autowiredEnabled": { "index": 5, "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 [...]
- "useGlobalSslContextParameters": { "index": 6, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters" }
+ "audioModel": { "index": 1, "kind": "property", "displayName": "Audio Model", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Default model for audio transcription endpoints" },
+ "baseUrl": { "index": 2, "kind": "property", "displayName": "Base Url", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "https:\/\/api.openai.com\/v1", "description": "Default base URL for all endpoints" },
+ "embeddingModel": { "index": 3, "kind": "property", "displayName": "Embedding Model", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Default model for embeddings endpoints" },
+ "lazyStartProducer": { "index": 4, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "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 producer may otherwise fail [...]
+ "model": { "index": 5, "kind": "property", "displayName": "Model", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Default model for chat completion endpoints" },
+ "autowiredEnabled": { "index": 6, "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 [...]
+ "useGlobalSslContextParameters": { "index": 7, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters" }
},
"headers": {
"CamelOpenAIUserMessage": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The user message to send to the OpenAI chat completion API", "constantName": "org.apache.camel.component.openai.OpenAIConstants#USER_MESSAGE" },
@@ -62,49 +63,60 @@
"CamelOpenAIEmbeddingVectorSize": { "index": 26, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Vector dimensions of the embeddings", "constantName": "org.apache.camel.component.openai.OpenAIConstants#EMBEDDING_VECTOR_SIZE" },
"CamelOpenAIReferenceEmbedding": { "index": 27, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "List<Float>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Reference embedding vector for similarity comparison", "constantName": "org.apache.camel.component.openai.OpenAIConstants#REFERENCE_EMBEDDING" },
"CamelOpenAISimilarityScore": { "index": 28, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Double", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Calculated cosine similarity score (0.0 to 1.0)", "constantName": "org.apache.camel.component.openai.OpenAIConstants#SIMILARITY_SCORE" },
- "CamelOpenAIOriginalText": { "index": 29, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String or List<String>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Original text content when embeddings operation is used", "constantName": "org.apache.camel.component.openai.OpenAIConstants#ORIGINAL_TEXT" }
+ "CamelOpenAIOriginalText": { "index": 29, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String or List<String>", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Original text content when embeddings operation is used", "constantName": "org.apache.camel.component.openai.OpenAIConstants#ORIGINAL_TEXT" },
+ "CamelOpenAIAudioModel": { "index": 30, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The model to use for audio transcription", "constantName": "org.apache.camel.component.openai.OpenAIConstants#AUDIO_MODEL" },
+ "CamelOpenAIAudioLanguage": { "index": 31, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The language of the input audio (ISO-639-1)", "constantName": "org.apache.camel.component.openai.OpenAIConstants#AUDIO_LANGUAGE" },
+ "CamelOpenAIAudioResponseFormat": { "index": 32, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The response format for audio transcription (json, text, srt, verbose_json, vtt)", "constantName": "org.apache.camel.component.openai.OpenAIConstants#AUDIO_RESPONSE_FORMAT" },
+ "CamelOpenAIAudioDuration": { "index": 33, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Double", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Duration of the audio in seconds (verbose_json only)", "constantName": "org.apache.camel.component.openai.OpenAIConstants#AUDIO_DURATION" },
+ "CamelOpenAIAudioDetectedLanguage": { "index": 34, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Language detected in the audio (verbose_json only)", "constantName": "org.apache.camel.component.openai.OpenAIConstants#AUDIO_DETECTED_LANGUAGE" }
},
"properties": {
- "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.openai.OpenAIOperations", "enum": [ "chat-completion", "embeddings", "tool-execution" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform: 'chat-completion', 'embeddings', or 'tool-execution'" },
+ "operation": { "index": 0, "kind": "path", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.openai.OpenAIOperations", "enum": [ "chat-completion", "embeddings", "tool-execution", "audio-transcription" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform: 'chat-completion', 'embeddings', 'tool-execution', or 'audio-transcription'" },
"additionalBodyProperty": { "index": 1, "kind": "parameter", "displayName": "Additional Body Property", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "additionalBodyProperty.", "multiValue": true, "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configur [...]
"apiKey": { "index": 2, "kind": "parameter", "displayName": "Api Key", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "OpenAI API key. Can also be set via OPENAI_API_KEY environment variable." },
- "autoToolExecution": { "index": 3, "kind": "parameter", "displayName": "Auto Tool Execution", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "When true and MCP servers are configured, automatically execut [...]
- "baseUrl": { "index": 4, "kind": "parameter", "displayName": "Base Url", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "https:\/\/api.openai.com\/v1", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Base URL for OpenAI API. Defaults to OpenAI's off [...]
- "conversationHistoryProperty": { "index": 5, "kind": "parameter", "displayName": "Conversation History Property", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "CamelOpenAIConversationHistory", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Exchan [...]
- "conversationMemory": { "index": 6, "kind": "parameter", "displayName": "Conversation Memory", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Enable conversation memory per Exchange" },
- "developerMessage": { "index": 7, "kind": "parameter", "displayName": "Developer Message", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Developer message to prepend before user messages" },
- "dimensions": { "index": 8, "kind": "parameter", "displayName": "Dimensions", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Number of dimensions for the embedding output. Only supported by text-embedding-3 models. [...]
- "embeddingModel": { "index": 9, "kind": "parameter", "displayName": "Embedding Model", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The model to use for embeddings" },
- "encodingFormat": { "index": 10, "kind": "parameter", "displayName": "Encoding Format", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "float", "base64" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "base64", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The format for embedding ou [...]
- "jsonSchema": { "index": 11, "kind": "parameter", "displayName": "Json Schema", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "supportFileReference": true, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "JSON schema for structured output validation" },
- "maxTokens": { "index": 12, "kind": "parameter", "displayName": "Max Tokens", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Maximum number of tokens to generate" },
- "maxToolIterations": { "index": 13, "kind": "parameter", "displayName": "Max Tool Iterations", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": 50, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Maximum number of tool call loop iterations to prevent infinite loops" },
- "mcpProtocolVersions": { "index": 14, "kind": "parameter", "displayName": "Mcp Protocol Versions", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Comma-separated list of MCP protocol versions to advertise when connect [...]
- "mcpReconnect": { "index": 15, "kind": "parameter", "displayName": "Mcp Reconnect", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Automatically reconnect to MCP servers when a tool call fails due to a t [...]
- "mcpServer": { "index": 16, "kind": "parameter", "displayName": "Mcp Server", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "mcpServer.", "multiValue": true, "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "MCP (Model Cont [...]
- "mcpTimeout": { "index": 17, "kind": "parameter", "displayName": "Mcp Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": 20, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Timeout in seconds for MCP tool call requests. Applies to all MCP operations inclu [...]
- "model": { "index": 18, "kind": "parameter", "displayName": "Model", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The model to use for chat completion" },
- "outputClass": { "index": 19, "kind": "parameter", "displayName": "Output Class", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Fully qualified class name for structured output using response format" },
- "storeFullResponse": { "index": 20, "kind": "parameter", "displayName": "Store Full Response", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Store the full response in the exchange property 'CamelOpenA [...]
- "streaming": { "index": 21, "kind": "parameter", "displayName": "Streaming", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Enable streaming responses" },
- "stripThinking": { "index": 22, "kind": "parameter", "displayName": "Strip Thinking", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Strip ... blocks from model responses (used by reasoning models like [...]
- "systemMessage": { "index": 23, "kind": "parameter", "displayName": "System Message", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "System message to prepend. When set and conversationMemory is enabled, the conversat [...]
- "temperature": { "index": 24, "kind": "parameter", "displayName": "Temperature", "group": "producer", "label": "", "required": false, "type": "number", "javaType": "java.lang.Double", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Temperature for response generation (0.0 to 2.0)" },
- "topP": { "index": 25, "kind": "parameter", "displayName": "Top P", "group": "producer", "label": "", "required": false, "type": "number", "javaType": "java.lang.Double", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Top P for response generation (0.0 to 1.0)" },
- "userMessage": { "index": 26, "kind": "parameter", "displayName": "User Message", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Default user message text to use when no prompt is provided" },
- "lazyStartProducer": { "index": 27, "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 produ [...]
- "oauthProfile": { "index": 28, "kind": "parameter", "displayName": "Oauth Profile", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "OAuth profile name for obtaining an access token via the OAuth 2.0 Client Cred [...]
- "sslContextParameters": { "index": 29, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "SSLContextParameters to use [...]
- "sslEndpointAlgorithm": { "index": 30, "kind": "parameter", "displayName": "Ssl Endpoint Algorithm", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "https", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The endpoint identification algorith [...]
- "sslKeymanagerAlgorithm": { "index": 31, "kind": "parameter", "displayName": "Ssl Keymanager Algorithm", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "SunX509", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The algorithm used by the key [...]
- "sslKeyPassword": { "index": 32, "kind": "parameter", "displayName": "Ssl Key Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The password of the private key in the key store file" },
- "sslKeystoreLocation": { "index": 33, "kind": "parameter", "displayName": "Ssl Keystore Location", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The location of the key store file. This is optional and can be [...]
- "sslKeystorePassword": { "index": 34, "kind": "parameter", "displayName": "Ssl Keystore Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The store password for the key store file" },
- "sslKeystoreType": { "index": 35, "kind": "parameter", "displayName": "Ssl Keystore Type", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "JKS", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The file format of the key store file" },
- "sslProtocol": { "index": 36, "kind": "parameter", "displayName": "Ssl Protocol", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "TLSv1.3", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The SSL protocol used to generate the SSLContext" },
- "sslTrustmanagerAlgorithm": { "index": 37, "kind": "parameter", "displayName": "Ssl Trustmanager Algorithm", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "PKIX", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The algorithm used by the tru [...]
- "sslTruststoreLocation": { "index": 38, "kind": "parameter", "displayName": "Ssl Truststore Location", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The location of the trust store file, used to validate the [...]
- "sslTruststorePassword": { "index": 39, "kind": "parameter", "displayName": "Ssl Truststore Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The password for the trust store file. [...]
- "sslTruststoreType": { "index": 40, "kind": "parameter", "displayName": "Ssl Truststore Type", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "JKS", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The file format of the trust store file" }
+ "audioLanguage": { "index": 3, "kind": "parameter", "displayName": "Audio Language", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The language of the input audio in ISO-639-1 format (e.g., 'en'). Improves accuracy a [...]
+ "audioModel": { "index": 4, "kind": "parameter", "displayName": "Audio Model", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The model to use for audio transcription (e.g., whisper-1, gpt-4o-transcribe)" },
+ "audioPrompt": { "index": 5, "kind": "parameter", "displayName": "Audio Prompt", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Optional text to guide the model's style or continue a previous audio segment" },
+ "audioResponseFormat": { "index": 6, "kind": "parameter", "displayName": "Audio Response Format", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "json", "text", "srt", "verbose_json", "vtt" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "json", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "descrip [...]
+ "audioTemperature": { "index": 7, "kind": "parameter", "displayName": "Audio Temperature", "group": "producer", "label": "", "required": false, "type": "number", "javaType": "java.lang.Double", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Sampling temperature for transcription (0.0 to 1.0)" },
+ "audioTimestampGranularities": { "index": 8, "kind": "parameter", "displayName": "Audio Timestamp Granularities", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Comma-separated timestamp granularities: 'word', 'segmen [...]
+ "autoToolExecution": { "index": 9, "kind": "parameter", "displayName": "Auto Tool Execution", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "When true and MCP servers are configured, automatically execut [...]
+ "baseUrl": { "index": 10, "kind": "parameter", "displayName": "Base Url", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "https:\/\/api.openai.com\/v1", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Base URL for OpenAI API. Defaults to OpenAI's of [...]
+ "conversationHistoryProperty": { "index": 11, "kind": "parameter", "displayName": "Conversation History Property", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "CamelOpenAIConversationHistory", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Excha [...]
+ "conversationMemory": { "index": 12, "kind": "parameter", "displayName": "Conversation Memory", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Enable conversation memory per Exchange" },
+ "developerMessage": { "index": 13, "kind": "parameter", "displayName": "Developer Message", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Developer message to prepend before user messages" },
+ "dimensions": { "index": 14, "kind": "parameter", "displayName": "Dimensions", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Number of dimensions for the embedding output. Only supported by text-embedding-3 models. [...]
+ "embeddingModel": { "index": 15, "kind": "parameter", "displayName": "Embedding Model", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The model to use for embeddings" },
+ "encodingFormat": { "index": 16, "kind": "parameter", "displayName": "Encoding Format", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "float", "base64" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "base64", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The format for embedding ou [...]
+ "jsonSchema": { "index": 17, "kind": "parameter", "displayName": "Json Schema", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "supportFileReference": true, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "JSON schema for structured output validation" },
+ "maxTokens": { "index": 18, "kind": "parameter", "displayName": "Max Tokens", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Maximum number of tokens to generate" },
+ "maxToolIterations": { "index": 19, "kind": "parameter", "displayName": "Max Tool Iterations", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": 50, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Maximum number of tool call loop iterations to prevent infinite loops" },
+ "mcpProtocolVersions": { "index": 20, "kind": "parameter", "displayName": "Mcp Protocol Versions", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Comma-separated list of MCP protocol versions to advertise when connect [...]
+ "mcpReconnect": { "index": 21, "kind": "parameter", "displayName": "Mcp Reconnect", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Automatically reconnect to MCP servers when a tool call fails due to a t [...]
+ "mcpServer": { "index": 22, "kind": "parameter", "displayName": "Mcp Server", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "mcpServer.", "multiValue": true, "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "MCP (Model Cont [...]
+ "mcpTimeout": { "index": 23, "kind": "parameter", "displayName": "Mcp Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": 20, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Timeout in seconds for MCP tool call requests. Applies to all MCP operations inclu [...]
+ "model": { "index": 24, "kind": "parameter", "displayName": "Model", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The model to use for chat completion" },
+ "outputClass": { "index": 25, "kind": "parameter", "displayName": "Output Class", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Fully qualified class name for structured output using response format" },
+ "storeFullResponse": { "index": 26, "kind": "parameter", "displayName": "Store Full Response", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Store the full response in the exchange property 'CamelOpenA [...]
+ "streaming": { "index": 27, "kind": "parameter", "displayName": "Streaming", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Enable streaming responses" },
+ "stripThinking": { "index": 28, "kind": "parameter", "displayName": "Strip Thinking", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Strip ... blocks from model responses (used by reasoning models like [...]
+ "systemMessage": { "index": 29, "kind": "parameter", "displayName": "System Message", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "System message to prepend. When set and conversationMemory is enabled, the conversat [...]
+ "temperature": { "index": 30, "kind": "parameter", "displayName": "Temperature", "group": "producer", "label": "", "required": false, "type": "number", "javaType": "java.lang.Double", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Temperature for response generation (0.0 to 2.0)" },
+ "topP": { "index": 31, "kind": "parameter", "displayName": "Top P", "group": "producer", "label": "", "required": false, "type": "number", "javaType": "java.lang.Double", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Top P for response generation (0.0 to 1.0)" },
+ "userMessage": { "index": 32, "kind": "parameter", "displayName": "User Message", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "Default user message text to use when no prompt is provided" },
+ "lazyStartProducer": { "index": 33, "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 produ [...]
+ "oauthProfile": { "index": 34, "kind": "parameter", "displayName": "Oauth Profile", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "OAuth profile name for obtaining an access token via the OAuth 2.0 Client Cred [...]
+ "sslContextParameters": { "index": 35, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "SSLContextParameters to use [...]
+ "sslEndpointAlgorithm": { "index": 36, "kind": "parameter", "displayName": "Ssl Endpoint Algorithm", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "https", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The endpoint identification algorith [...]
+ "sslKeymanagerAlgorithm": { "index": 37, "kind": "parameter", "displayName": "Ssl Keymanager Algorithm", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "SunX509", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The algorithm used by the key [...]
+ "sslKeyPassword": { "index": 38, "kind": "parameter", "displayName": "Ssl Key Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The password of the private key in the key store file" },
+ "sslKeystoreLocation": { "index": 39, "kind": "parameter", "displayName": "Ssl Keystore Location", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The location of the key store file. This is optional and can be [...]
+ "sslKeystorePassword": { "index": 40, "kind": "parameter", "displayName": "Ssl Keystore Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The store password for the key store file" },
+ "sslKeystoreType": { "index": 41, "kind": "parameter", "displayName": "Ssl Keystore Type", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "JKS", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The file format of the key store file" },
+ "sslProtocol": { "index": 42, "kind": "parameter", "displayName": "Ssl Protocol", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "TLSv1.3", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The SSL protocol used to generate the SSLContext" },
+ "sslTrustmanagerAlgorithm": { "index": 43, "kind": "parameter", "displayName": "Ssl Trustmanager Algorithm", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "PKIX", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The algorithm used by the tru [...]
+ "sslTruststoreLocation": { "index": 44, "kind": "parameter", "displayName": "Ssl Truststore Location", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The location of the trust store file, used to validate the [...]
+ "sslTruststorePassword": { "index": 45, "kind": "parameter", "displayName": "Ssl Truststore Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The password for the trust store file. [...]
+ "sslTruststoreType": { "index": 46, "kind": "parameter", "displayName": "Ssl Truststore Type", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "JKS", "configurationClass": "org.apache.camel.component.openai.OpenAIConfiguration", "configurationField": "configuration", "description": "The file format of the trust store file" }
}
}
diff --git a/components/camel-ai/camel-openai/src/main/docs/openai-component.adoc b/components/camel-ai/camel-openai/src/main/docs/openai-component.adoc
index 23a876023b19..65b01fca6841 100644
--- a/components/camel-ai/camel-openai/src/main/docs/openai-component.adoc
+++ b/components/camel-ai/camel-openai/src/main/docs/openai-component.adoc
@@ -2,7 +2,7 @@
:doctitle: OpenAI
:shortname: openai
:artifactid: camel-openai
-:description: OpenAI endpoint for chat completion and embeddings.
+:description: OpenAI endpoint for chat completion, embeddings, and audio transcription.
:since: 4.17
:supportlevel: Stable
:tabs-sync-option:
@@ -15,7 +15,7 @@
*{component-header}*
-The OpenAI component provides integration with OpenAI and OpenAI-compatible APIs for chat completion and text embeddings using the official openai-java SDK.
+The OpenAI component provides integration with OpenAI and OpenAI-compatible APIs for chat completion, text embeddings, and audio transcription using the official openai-java SDK.
Maven users will need to add the following dependency to their `pom.xml` for this component:
@@ -41,6 +41,7 @@ Supported operations:
* `chat-completion` - Generate chat completions using language models
* `embeddings` - Generate vector embeddings from text for semantic search and RAG applications
* `tool-execution` - Execute MCP tool calls from a stored chat completion response (used in manual tool loops)
+* `audio-transcription` - Transcribe audio files to text using speech-to-text models (e.g., Whisper, GPT-4o Transcribe)
// component options: START
include::partial$component-configure-options.adoc[]
@@ -644,6 +645,104 @@ The following headers are set after an embeddings request:
| `CamelOpenAISimilarityScore` | Double | Cosine similarity (if reference embedding provided)
|===
+== Audio Transcription Operation
+
+The `audio-transcription` operation transcribes audio files to text using OpenAI's speech-to-text models (Whisper, GPT-4o Transcribe).
+
+=== Basic Audio Transcription
+
+[tabs]
+====
+Java::
++
+[source,java]
+----
+from("file:audio?noop=true")
+ .to("openai:audio-transcription?audioModel=whisper-1")
+ .log("Transcription: ${body}");
+----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: direct:transcribe
+ steps:
+ - to:
+ uri: openai:audio-transcription
+ parameters:
+ audioModel: whisper-1
+ - log: "Transcription: ${body}"
+----
+====
+
+=== Input Handling
+
+The audio transcription operation accepts the following types in the message body:
+
+* `java.io.File` - Audio file reference
+* `java.nio.file.Path` - Path to an audio file
+* `java.io.InputStream` - Audio data stream
+* `byte[]` - Raw audio bytes
+
+Supported audio formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm.
+
+=== Audio Transcription Parameters
+
+[cols="1,1,1,3"]
+|===
+| Parameter | Type | Default | Description
+
+| `audioModel` | String | | The model to use (e.g., `whisper-1`, `gpt-4o-transcribe`). Required.
+| `audioLanguage` | String | | Input audio language in ISO-639-1 format (e.g., `en`). Improves accuracy.
+| `audioPrompt` | String | | Optional text to guide the model's style or continue a previous segment.
+| `audioResponseFormat` | String | `json` | Output format: `json`, `text`, `srt`, `verbose_json`, `vtt`.
+| `audioTemperature` | Double | | Sampling temperature (0.0 to 1.0).
+| `audioTimestampGranularities` | String | | Comma-separated: `word`, `segment`, or `word,segment`. Only with `verbose_json`.
+|===
+
+=== Audio Transcription Output Headers
+
+[cols="1,1,3"]
+|===
+| Header | Type | Description
+
+| `CamelOpenAIAudioDuration` | Double | Duration of the audio in seconds (verbose_json only)
+| `CamelOpenAIAudioDetectedLanguage` | String | Language detected in the audio (verbose_json only)
+|===
+
+=== Audio Models by Provider
+
+[cols="1,2,3"]
+|===
+| Provider | Model | Description
+
+| OpenAI | `whisper-1` | General-purpose speech recognition
+| OpenAI | `gpt-4o-transcribe` | High-accuracy transcription based on GPT-4o
+| OpenAI | `gpt-4o-mini-transcribe` | Lighter-weight GPT-4o variant
+|===
+
+=== Local Audio Transcription Servers
+
+The audio transcription operation works with any OpenAI-compatible server that implements the `POST /v1/audio/transcriptions` endpoint. It has been tested with:
+
+* https://github.com/ml-explore/mlx-audio[MLX Audio] — `python3 -m mlx_audio.server --host 127.0.0.1 --port 8003`
+
+.Example using MLX Audio for local transcription:
+[source,java]
+----
+from("direct:transcribe")
+ .to("openai:audio-transcription?audioModel=mlx-community/whisper-large-v3-turbo"
+ + "&baseUrl=http://localhost:8003/v1");
+----
+
+[NOTE]
+====
+Some local servers require the model parameter to be a path (e.g., `./models/granite-speech-4.1-2b-8bit`). Refer to your server's documentation for the expected model identifier format.
+====
+
== MCP Tool Calling (Agentic Loop)
The component supports automatic tool calling via the https://modelcontextprotocol.io[Model Context Protocol (MCP)]. When MCP servers are configured, the component acts as an MCP client: it lists available tools, converts them to OpenAI function-calling format, and runs an agentic loop — the model requests tool calls, the component executes them via MCP, feeds results back, and repeats until the model produces a final text answer.
@@ -972,7 +1071,7 @@ from("direct:chat")
The component may throw the following exceptions:
* `IllegalArgumentException`:
- ** When an invalid operation is specified (supported: `chat-completion`, `embeddings`)
+ ** When an invalid operation is specified (supported: `chat-completion`, `embeddings`, `tool-execution`, `audio-transcription`)
** When message body or user message is missing
** When image file is provided without userMessage (chat-completion)
** When unsupported file type is provided (only text and image files are supported)
diff --git a/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIAudioTranscriptionProducer.java b/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIAudioTranscriptionProducer.java
new file mode 100644
index 000000000000..33e781354b8e
--- /dev/null
+++ b/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIAudioTranscriptionProducer.java
@@ -0,0 +1,165 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.openai;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.InputStream;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.openai.core.MultipartField;
+import com.openai.models.audio.AudioResponseFormat;
+import com.openai.models.audio.transcriptions.TranscriptionCreateParams;
+import com.openai.models.audio.transcriptions.TranscriptionCreateResponse;
+import com.openai.models.audio.transcriptions.TranscriptionVerbose;
+import org.apache.camel.AsyncCallback;
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.support.DefaultAsyncProducer;
+import org.apache.camel.util.ObjectHelper;
+
+/**
+ * OpenAI producer for audio transcription.
+ */
+public class OpenAIAudioTranscriptionProducer extends DefaultAsyncProducer {
+
+ public OpenAIAudioTranscriptionProducer(OpenAIEndpoint endpoint) {
+ super(endpoint);
+ }
+
+ @Override
+ public OpenAIEndpoint getEndpoint() {
+ return (OpenAIEndpoint) super.getEndpoint();
+ }
+
+ @Override
+ public boolean process(Exchange exchange, AsyncCallback callback) {
+ try {
+ processInternal(exchange);
+ callback.done(true);
+ return true;
+ } catch (Exception e) {
+ exchange.setException(e);
+ callback.done(true);
+ return true;
+ }
+ }
+
+ private void processInternal(Exchange exchange) throws Exception {
+ OpenAIConfiguration config = getEndpoint().getConfiguration();
+ Message in = exchange.getIn();
+
+ String model = resolveParameter(in, OpenAIConstants.AUDIO_MODEL, config.getAudioModel(), String.class);
+ if (model == null) {
+ throw new IllegalArgumentException(
+ "Audio model must be specified via audioModel parameter or CamelOpenAIAudioModel header");
+ }
+
+ String language = resolveParameter(in, OpenAIConstants.AUDIO_LANGUAGE, config.getAudioLanguage(), String.class);
+ String responseFormat = resolveParameter(in, OpenAIConstants.AUDIO_RESPONSE_FORMAT,
+ config.getAudioResponseFormat(), String.class);
+ Double temperature = resolveParameter(in, null, config.getAudioTemperature(), Double.class);
+ String prompt = resolveParameter(in, null, config.getAudioPrompt(), String.class);
+ String timestampGranularities = resolveParameter(in, null, config.getAudioTimestampGranularities(), String.class);
+
+ TranscriptionCreateParams.Builder paramsBuilder = TranscriptionCreateParams.builder()
+ .model(model);
+
+ setFileInput(paramsBuilder, in);
+
+ if (ObjectHelper.isNotEmpty(language)) {
+ paramsBuilder.language(language);
+ }
+ if (ObjectHelper.isNotEmpty(prompt)) {
+ paramsBuilder.prompt(prompt);
+ }
+ if (ObjectHelper.isNotEmpty(responseFormat)) {
+ paramsBuilder.responseFormat(AudioResponseFormat.of(responseFormat));
+ }
+ if (temperature != null) {
+ paramsBuilder.temperature(temperature);
+ }
+ if (ObjectHelper.isNotEmpty(timestampGranularities)) {
+ List<TranscriptionCreateParams.TimestampGranularity> granularities = new ArrayList<>();
+ for (String g : timestampGranularities.split(",")) {
+ granularities.add(TranscriptionCreateParams.TimestampGranularity.of(g.trim()));
+ }
+ paramsBuilder.timestampGranularities(granularities);
+ }
+
+ TranscriptionCreateParams params = paramsBuilder.build();
+ TranscriptionCreateResponse response = getEndpoint().getClient()
+ .audio().transcriptions().create(params);
+
+ Message out = exchange.getMessage();
+
+ if (response.isVerbose()) {
+ TranscriptionVerbose verbose = response.asVerbose();
+ out.setBody(verbose.text());
+ out.setHeader(OpenAIConstants.AUDIO_DURATION, verbose.duration());
+ out.setHeader(OpenAIConstants.AUDIO_DETECTED_LANGUAGE, verbose.language());
+ } else if (response.isTranscription()) {
+ out.setBody(response.asTranscription().text());
+ } else {
+ out.setBody(response.toString());
+ }
+
+ if (config.isStoreFullResponse()) {
+ exchange.setProperty(OpenAIConstants.RESPONSE, response);
+ }
+ }
+
+ private void setFileInput(TranscriptionCreateParams.Builder paramsBuilder, Message in) {
+ Object body = in.getBody();
+
+ if (body instanceof File file) {
+ paramsBuilder.file(file.toPath());
+ } else if (body instanceof Path path) {
+ paramsBuilder.file(path);
+ } else if (body instanceof byte[] bytes) {
+ paramsBuilder.file(multipartWithFilename(new ByteArrayInputStream(bytes)));
+ } else if (body instanceof InputStream inputStream) {
+ paramsBuilder.file(multipartWithFilename(inputStream));
+ } else {
+ InputStream converted = in.getBody(InputStream.class);
+ if (converted == null) {
+ throw new IllegalArgumentException(
+ "Unsupported body type for audio transcription: "
+ + (body != null ? body.getClass().getName() : "null")
+ + ". Supported: File, Path, InputStream, byte[]");
+ }
+ paramsBuilder.file(multipartWithFilename(converted));
+ }
+ }
+
+ private MultipartField<InputStream> multipartWithFilename(InputStream stream) {
+ return MultipartField.<InputStream> builder()
+ .value(stream)
+ .filename("audio")
+ .build();
+ }
+
+ private <T> T resolveParameter(Message message, String headerName, T defaultValue, Class<T> type) {
+ if (headerName != null) {
+ T headerValue = message.getHeader(headerName, type);
+ return ObjectHelper.isNotEmpty(headerValue) ? headerValue : defaultValue;
+ }
+ return defaultValue;
+ }
+}
diff --git a/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIComponent.java b/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIComponent.java
index 6c5a93336391..d70cc8772809 100644
--- a/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIComponent.java
+++ b/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIComponent.java
@@ -26,7 +26,7 @@ import org.apache.camel.spi.annotations.Component;
import org.apache.camel.support.DefaultComponent;
/**
- * OpenAI component for chat completion and embeddings.
+ * OpenAI component for chat completion, embeddings, and audio transcription.
*/
@Component("openai")
public class OpenAIComponent extends DefaultComponent implements SSLContextParametersAware {
@@ -43,6 +43,9 @@ public class OpenAIComponent extends DefaultComponent implements SSLContextParam
@Metadata(description = "Default model for embeddings endpoints")
private String embeddingModel;
+ @Metadata(description = "Default model for audio transcription endpoints")
+ private String audioModel;
+
@Metadata(label = "security", defaultValue = "false",
description = "Enable usage of global SSL context parameters")
private boolean useGlobalSslContextParameters;
@@ -63,6 +66,9 @@ public class OpenAIComponent extends DefaultComponent implements SSLContextParam
if (embeddingModel != null) {
configuration.setEmbeddingModel(embeddingModel);
}
+ if (audioModel != null) {
+ configuration.setAudioModel(audioModel);
+ }
OpenAIEndpoint endpoint = new OpenAIEndpoint(uri, this, configuration);
// set the operation from the URI path (e.g., chat-completion)
@@ -108,6 +114,14 @@ public class OpenAIComponent extends DefaultComponent implements SSLContextParam
this.embeddingModel = embeddingModel;
}
+ public String getAudioModel() {
+ return audioModel;
+ }
+
+ public void setAudioModel(String audioModel) {
+ this.audioModel = audioModel;
+ }
+
@Override
public boolean isUseGlobalSslContextParameters() {
return useGlobalSslContextParameters;
diff --git a/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIConfiguration.java b/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIConfiguration.java
index 2b3031787897..23300b236b41 100644
--- a/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIConfiguration.java
+++ b/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIConfiguration.java
@@ -158,6 +158,33 @@ public class OpenAIConfiguration implements Cloneable {
@Metadata(description = "The format for embedding output: 'float' for list of floats, 'base64' for compressed format")
private String encodingFormat = "base64";
+ // ========== AUDIO TRANSCRIPTION CONFIGURATION ==========
+
+ @UriParam
+ @Metadata(description = "The model to use for audio transcription (e.g., whisper-1, gpt-4o-transcribe)")
+ private String audioModel;
+
+ @UriParam
+ @Metadata(description = "The language of the input audio in ISO-639-1 format (e.g., 'en'). Improves accuracy and latency.")
+ private String audioLanguage;
+
+ @UriParam
+ @Metadata(description = "Optional text to guide the model's style or continue a previous audio segment")
+ private String audioPrompt;
+
+ @UriParam(enums = "json,text,srt,verbose_json,vtt", defaultValue = "json")
+ @Metadata(description = "The format of the transcription output")
+ private String audioResponseFormat = "json";
+
+ @UriParam
+ @Metadata(description = "Sampling temperature for transcription (0.0 to 1.0)")
+ private Double audioTemperature;
+
+ @UriParam
+ @Metadata(description = "Comma-separated timestamp granularities: 'word', 'segment', or 'word,segment'. "
+ + "Only applicable with verbose_json response format.")
+ private String audioTimestampGranularities;
+
// ========== SSL CONFIGURATION ==========
@UriParam(label = "security")
@@ -380,6 +407,54 @@ public class OpenAIConfiguration implements Cloneable {
this.encodingFormat = encodingFormat;
}
+ public String getAudioModel() {
+ return audioModel;
+ }
+
+ public void setAudioModel(String audioModel) {
+ this.audioModel = audioModel;
+ }
+
+ public String getAudioLanguage() {
+ return audioLanguage;
+ }
+
+ public void setAudioLanguage(String audioLanguage) {
+ this.audioLanguage = audioLanguage;
+ }
+
+ public String getAudioPrompt() {
+ return audioPrompt;
+ }
+
+ public void setAudioPrompt(String audioPrompt) {
+ this.audioPrompt = audioPrompt;
+ }
+
+ public String getAudioResponseFormat() {
+ return audioResponseFormat;
+ }
+
+ public void setAudioResponseFormat(String audioResponseFormat) {
+ this.audioResponseFormat = audioResponseFormat;
+ }
+
+ public Double getAudioTemperature() {
+ return audioTemperature;
+ }
+
+ public void setAudioTemperature(Double audioTemperature) {
+ this.audioTemperature = audioTemperature;
+ }
+
+ public String getAudioTimestampGranularities() {
+ return audioTimestampGranularities;
+ }
+
+ public void setAudioTimestampGranularities(String audioTimestampGranularities) {
+ this.audioTimestampGranularities = audioTimestampGranularities;
+ }
+
public Map<String, Object> getMcpServer() {
return mcpServer;
}
diff --git a/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIConstants.java b/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIConstants.java
index c53a6884521b..473eaeada6bf 100644
--- a/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIConstants.java
+++ b/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIConstants.java
@@ -102,6 +102,21 @@ public final class OpenAIConstants {
@Metadata(description = "Original text content when embeddings operation is used", javaType = "String or List<String>")
public static final String ORIGINAL_TEXT = "CamelOpenAIOriginalText";
+ // Audio Transcription Input Headers
+ @Metadata(description = "The model to use for audio transcription", javaType = "String")
+ public static final String AUDIO_MODEL = "CamelOpenAIAudioModel";
+ @Metadata(description = "The language of the input audio (ISO-639-1)", javaType = "String")
+ public static final String AUDIO_LANGUAGE = "CamelOpenAIAudioLanguage";
+ @Metadata(description = "The response format for audio transcription (json, text, srt, verbose_json, vtt)",
+ javaType = "String")
+ public static final String AUDIO_RESPONSE_FORMAT = "CamelOpenAIAudioResponseFormat";
+
+ // Audio Transcription Output Headers
+ @Metadata(description = "Duration of the audio in seconds (verbose_json only)", javaType = "Double")
+ public static final String AUDIO_DURATION = "CamelOpenAIAudioDuration";
+ @Metadata(description = "Language detected in the audio (verbose_json only)", javaType = "String")
+ public static final String AUDIO_DETECTED_LANGUAGE = "CamelOpenAIAudioDetectedLanguage";
+
private OpenAIConstants() {
// Utility class
}
diff --git a/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIEndpoint.java b/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIEndpoint.java
index e9fc9e0d53c9..e5c6da160c70 100644
--- a/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIEndpoint.java
+++ b/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIEndpoint.java
@@ -62,7 +62,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * OpenAI endpoint for chat completion and embeddings.
+ * OpenAI endpoint for chat completion, embeddings, and audio transcription.
*/
@UriEndpoint(firstVersion = "4.17.0",
scheme = "openai",
@@ -76,7 +76,8 @@ public class OpenAIEndpoint extends DefaultEndpoint {
private static final Logger LOG = LoggerFactory.getLogger(OpenAIEndpoint.class);
@UriPath
- @Metadata(required = true, description = "The operation to perform: 'chat-completion', 'embeddings', or 'tool-execution'")
+ @Metadata(required = true,
+ description = "The operation to perform: 'chat-completion', 'embeddings', 'tool-execution', or 'audio-transcription'")
private OpenAIOperations operation;
@UriParam
@@ -101,6 +102,7 @@ public class OpenAIEndpoint extends DefaultEndpoint {
case chatCompletion -> new OpenAIProducer(this);
case embeddings -> new OpenAIEmbeddingsProducer(this);
case toolExecution -> new OpenAIToolExecutionProducer(this);
+ case audioTranscription -> new OpenAIAudioTranscriptionProducer(this);
};
}
diff --git a/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIOperations.java b/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIOperations.java
index 7f1ac265733e..25e7ae126586 100644
--- a/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIOperations.java
+++ b/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIOperations.java
@@ -20,7 +20,8 @@ public enum OpenAIOperations {
chatCompletion("chat-completion"),
embeddings("embeddings"),
- toolExecution("tool-execution");
+ toolExecution("tool-execution"),
+ audioTranscription("audio-transcription");
private final String value;
@@ -35,7 +36,8 @@ public enum OpenAIOperations {
}
}
throw new IllegalArgumentException(
- "Unknown operation: " + value + ". Supported: chat-completion, embeddings, tool-execution");
+ "Unknown operation: " + value
+ + ". Supported: chat-completion, embeddings, tool-execution, audio-transcription");
}
public String getValue() {
diff --git a/components/camel-ai/camel-openai/src/test/java/org/apache/camel/component/openai/OpenAIAudioTranscriptionMockTest.java b/components/camel-ai/camel-openai/src/test/java/org/apache/camel/component/openai/OpenAIAudioTranscriptionMockTest.java
new file mode 100644
index 000000000000..eeca71767c58
--- /dev/null
+++ b/components/camel-ai/camel-openai/src/test/java/org/apache/camel/component/openai/OpenAIAudioTranscriptionMockTest.java
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.openai;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.test.infra.openai.mock.OpenAIMock;
+import org.apache.camel.test.junit6.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.api.io.TempDir;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class OpenAIAudioTranscriptionMockTest extends CamelTestSupport {
+
+ private static final String TRANSCRIPTION_TEXT = "Hello, this is a test transcription from Apache Camel.";
+
+ @TempDir
+ Path tempDir;
+
+ @RegisterExtension
+ public OpenAIMock openAIMock = new OpenAIMock().builder()
+ .whenTranscription()
+ .replyWithTranscription(TRANSCRIPTION_TEXT)
+ .end()
+ .build();
+
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:transcribe")
+ .to("openai:audio-transcription?audioModel=whisper-1&apiKey=dummy&baseUrl="
+ + openAIMock.getBaseUrl() + "/v1");
+
+ from("direct:transcribe-no-model")
+ .to("openai:audio-transcription?apiKey=dummy&baseUrl="
+ + openAIMock.getBaseUrl() + "/v1");
+ }
+ };
+ }
+
+ @Test
+ void testTranscriptionWithFile() throws Exception {
+ File audioFile = tempDir.resolve("test-audio.wav").toFile();
+ Files.write(audioFile.toPath(), new byte[] { 0x00, 0x01, 0x02 });
+
+ Exchange result = template.request("direct:transcribe", e -> e.getIn().setBody(audioFile));
+
+ assertNotNull(result);
+ assertNull(result.getException());
+ assertEquals(TRANSCRIPTION_TEXT, result.getMessage().getBody(String.class));
+ }
+
+ @Test
+ void testTranscriptionWithByteArray() {
+ byte[] audioBytes = new byte[] { 0x00, 0x01, 0x02 };
+
+ Exchange result = template.request("direct:transcribe", e -> e.getIn().setBody(audioBytes));
+
+ assertNotNull(result);
+ assertNull(result.getException());
+ assertEquals(TRANSCRIPTION_TEXT, result.getMessage().getBody(String.class));
+ }
+
+ @Test
+ void testTranscriptionWithInputStream() {
+ InputStream audioStream = new ByteArrayInputStream(new byte[] { 0x00, 0x01, 0x02 });
+
+ Exchange result = template.request("direct:transcribe", e -> e.getIn().setBody(audioStream));
+
+ assertNotNull(result);
+ assertNull(result.getException());
+ assertEquals(TRANSCRIPTION_TEXT, result.getMessage().getBody(String.class));
+ }
+
+ @Test
+ void testTranscriptionWithPath() throws Exception {
+ Path audioPath = tempDir.resolve("test-audio.mp3");
+ Files.write(audioPath, new byte[] { 0x00, 0x01, 0x02 });
+
+ Exchange result = template.request("direct:transcribe", e -> e.getIn().setBody(audioPath));
+
+ assertNotNull(result);
+ assertNull(result.getException());
+ assertEquals(TRANSCRIPTION_TEXT, result.getMessage().getBody(String.class));
+ }
+
+ @Test
+ void testTranscriptionWithHeaderOverrides() {
+ byte[] audioBytes = new byte[] { 0x00, 0x01, 0x02 };
+
+ Exchange result = template.request("direct:transcribe", e -> {
+ e.getIn().setBody(audioBytes);
+ e.getIn().setHeader(OpenAIConstants.AUDIO_MODEL, "gpt-4o-transcribe");
+ e.getIn().setHeader(OpenAIConstants.AUDIO_LANGUAGE, "en");
+ });
+
+ assertNotNull(result);
+ assertNull(result.getException());
+ assertEquals(TRANSCRIPTION_TEXT, result.getMessage().getBody(String.class));
+ }
+
+ @Test
+ void testTranscriptionMissingModel() {
+ byte[] audioBytes = new byte[] { 0x00, 0x01, 0x02 };
+
+ Exchange result = template.request("direct:transcribe-no-model", e -> e.getIn().setBody(audioBytes));
+
+ assertNotNull(result);
+ assertNotNull(result.getException());
+ assertTrue(result.getException() instanceof IllegalArgumentException);
+ assertTrue(result.getException().getMessage().contains("Audio model must be specified"));
+ }
+}
diff --git a/components/camel-ai/camel-openai/src/test/java/org/apache/camel/component/openai/OpenAIMtlsMockTest.java b/components/camel-ai/camel-openai/src/test/java/org/apache/camel/component/openai/OpenAIMtlsMockTest.java
index 92daaf92a6c2..cbd6d5977c2f 100644
--- a/components/camel-ai/camel-openai/src/test/java/org/apache/camel/component/openai/OpenAIMtlsMockTest.java
+++ b/components/camel-ai/camel-openai/src/test/java/org/apache/camel/component/openai/OpenAIMtlsMockTest.java
@@ -95,7 +95,7 @@ class OpenAIMtlsMockTest extends CamelTestSupport {
expectations.add(expectation);
httpsServer.createContext("/",
- new OpenAIMockServerHandler(expectations, List.of(), new ObjectMapper()));
+ new OpenAIMockServerHandler(expectations, List.of(), List.of(), new ObjectMapper()));
executor = Executors.newSingleThreadExecutor();
httpsServer.setExecutor(executor);
@@ -260,7 +260,7 @@ class OpenAIMtlsMockTest extends CamelTestSupport {
expectations.add(expectation);
server.createContext("/",
- new OpenAIMockServerHandler(expectations, List.of(), new ObjectMapper()));
+ new OpenAIMockServerHandler(expectations, List.of(), List.of(), new ObjectMapper()));
server.setExecutor(Executors.newSingleThreadExecutor());
server.start();
diff --git a/components/camel-ai/camel-openai/src/test/java/org/apache/camel/component/openai/OpenAISslContextParametersTest.java b/components/camel-ai/camel-openai/src/test/java/org/apache/camel/component/openai/OpenAISslContextParametersTest.java
index ef0d37722d61..0779966bd441 100644
--- a/components/camel-ai/camel-openai/src/test/java/org/apache/camel/component/openai/OpenAISslContextParametersTest.java
+++ b/components/camel-ai/camel-openai/src/test/java/org/apache/camel/component/openai/OpenAISslContextParametersTest.java
@@ -89,7 +89,7 @@ class OpenAISslContextParametersTest extends CamelTestSupport {
expectations.add(expectation);
httpsServer.createContext("/",
- new OpenAIMockServerHandler(expectations, List.of(), new ObjectMapper()));
+ new OpenAIMockServerHandler(expectations, List.of(), List.of(), new ObjectMapper()));
executor = Executors.newSingleThreadExecutor();
httpsServer.setExecutor(executor);
diff --git a/components/camel-ai/camel-openai/src/test/java/org/apache/camel/component/openai/OpenAISslMockTest.java b/components/camel-ai/camel-openai/src/test/java/org/apache/camel/component/openai/OpenAISslMockTest.java
index 0f8bf4d16e43..c3d91fe13444 100644
--- a/components/camel-ai/camel-openai/src/test/java/org/apache/camel/component/openai/OpenAISslMockTest.java
+++ b/components/camel-ai/camel-openai/src/test/java/org/apache/camel/component/openai/OpenAISslMockTest.java
@@ -85,7 +85,7 @@ class OpenAISslMockTest extends CamelTestSupport {
expectations.add(expectation);
httpsServer.createContext("/",
- new OpenAIMockServerHandler(expectations, List.of(), new ObjectMapper()));
+ new OpenAIMockServerHandler(expectations, List.of(), List.of(), new ObjectMapper()));
executor = Executors.newSingleThreadExecutor();
httpsServer.setExecutor(executor);
@@ -229,7 +229,7 @@ class OpenAISslMockTest extends CamelTestSupport {
expectations.add(expectation);
server.createContext("/",
- new OpenAIMockServerHandler(expectations, List.of(), new ObjectMapper()));
+ new OpenAIMockServerHandler(expectations, List.of(), List.of(), new ObjectMapper()));
server.setExecutor(Executors.newSingleThreadExecutor());
server.start();
diff --git a/test-infra/camel-test-infra-openai-mock/src/main/java/org/apache/camel/test/infra/openai/mock/AudioTranscriptionExpectation.java b/test-infra/camel-test-infra-openai-mock/src/main/java/org/apache/camel/test/infra/openai/mock/AudioTranscriptionExpectation.java
new file mode 100644
index 000000000000..51fd82708434
--- /dev/null
+++ b/test-infra/camel-test-infra-openai-mock/src/main/java/org/apache/camel/test/infra/openai/mock/AudioTranscriptionExpectation.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.infra.openai.mock;
+
+/**
+ * Represents a mock expectation for an audio transcription request.
+ */
+public class AudioTranscriptionExpectation {
+
+ private String transcriptionText;
+ private String language = "en";
+ private double duration = 0.0;
+
+ public String getTranscriptionText() {
+ return transcriptionText;
+ }
+
+ public void setTranscriptionText(String transcriptionText) {
+ this.transcriptionText = transcriptionText;
+ }
+
+ public String getLanguage() {
+ return language;
+ }
+
+ public void setLanguage(String language) {
+ this.language = language;
+ }
+
+ public double getDuration() {
+ return duration;
+ }
+
+ public void setDuration(double duration) {
+ this.duration = duration;
+ }
+
+ @Override
+ public String toString() {
+ return String.format("AudioTranscriptionExpectation{text='%s', language='%s', duration=%.1f}",
+ transcriptionText, language, duration);
+ }
+}
diff --git a/test-infra/camel-test-infra-openai-mock/src/main/java/org/apache/camel/test/infra/openai/mock/AudioTranscriptionRequestHandler.java b/test-infra/camel-test-infra-openai-mock/src/main/java/org/apache/camel/test/infra/openai/mock/AudioTranscriptionRequestHandler.java
new file mode 100644
index 000000000000..c42480f3aab8
--- /dev/null
+++ b/test-infra/camel-test-infra-openai-mock/src/main/java/org/apache/camel/test/infra/openai/mock/AudioTranscriptionRequestHandler.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.infra.openai.mock;
+
+import java.io.IOException;
+import java.util.List;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.sun.net.httpserver.HttpExchange;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Handles incoming audio transcription requests and returns pre-configured mock responses. Does not parse the multipart
+ * body — the mock returns the next configured expectation sequentially.
+ */
+public class AudioTranscriptionRequestHandler {
+ private static final Logger LOG = LoggerFactory.getLogger(AudioTranscriptionRequestHandler.class);
+
+ private final List<AudioTranscriptionExpectation> expectations;
+ private final AudioTranscriptionResponseBuilder responseBuilder;
+ private int callIndex = 0;
+
+ public AudioTranscriptionRequestHandler(List<AudioTranscriptionExpectation> expectations, ObjectMapper objectMapper) {
+ this.expectations = expectations;
+ this.responseBuilder = new AudioTranscriptionResponseBuilder(objectMapper);
+ }
+
+ public String handleRequest(HttpExchange exchange) throws IOException {
+ try {
+ // consume the request body
+ exchange.getRequestBody().readAllBytes();
+ LOG.debug("Processing audio transcription request (call #{})", callIndex);
+
+ if (expectations.isEmpty()) {
+ throw new IllegalStateException("No audio transcription expectations configured");
+ }
+
+ AudioTranscriptionExpectation expectation = expectations.get(callIndex % expectations.size());
+ callIndex++;
+
+ return responseBuilder.createTranscriptionResponse(expectation);
+ } catch (Exception e) {
+ String errorMessage = "Error processing audio transcription request: " + e.getMessage();
+ LOG.error(errorMessage, e);
+ String jsonError = String.format(
+ "{\"error\": {\"message\": \"%s\", \"type\": \"invalid_request_error\"}}", errorMessage);
+ try {
+ exchange.sendResponseHeaders(500, jsonError.length());
+ } catch (IOException ignored) {
+ // headers may already be sent
+ }
+ return jsonError;
+ }
+ }
+}
diff --git a/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIOperations.java b/test-infra/camel-test-infra-openai-mock/src/main/java/org/apache/camel/test/infra/openai/mock/AudioTranscriptionResponseBuilder.java
similarity index 50%
copy from components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIOperations.java
copy to test-infra/camel-test-infra-openai-mock/src/main/java/org/apache/camel/test/infra/openai/mock/AudioTranscriptionResponseBuilder.java
index 7f1ac265733e..63861bec042a 100644
--- a/components/camel-ai/camel-openai/src/main/java/org/apache/camel/component/openai/OpenAIOperations.java
+++ b/test-infra/camel-test-infra-openai-mock/src/main/java/org/apache/camel/test/infra/openai/mock/AudioTranscriptionResponseBuilder.java
@@ -14,36 +14,25 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.openai;
+package org.apache.camel.test.infra.openai.mock;
-public enum OpenAIOperations {
+import com.fasterxml.jackson.databind.ObjectMapper;
- chatCompletion("chat-completion"),
- embeddings("embeddings"),
- toolExecution("tool-execution");
-
- private final String value;
+/**
+ * Builder class for creating OpenAI audio transcription API mock responses.
+ */
+public class AudioTranscriptionResponseBuilder {
+ private final ObjectMapper objectMapper;
- OpenAIOperations(String value) {
- this.value = value;
+ public AudioTranscriptionResponseBuilder(ObjectMapper objectMapper) {
+ this.objectMapper = objectMapper;
}
- public static OpenAIOperations fromValue(String value) {
- for (OpenAIOperations op : values()) {
- if (op.value.equalsIgnoreCase(value) || op.name().equalsIgnoreCase(value)) {
- return op;
- }
+ public String createTranscriptionResponse(AudioTranscriptionExpectation expectation) throws Exception {
+ record TranscriptionResponse(String text) {
}
- throw new IllegalArgumentException(
- "Unknown operation: " + value + ". Supported: chat-completion, embeddings, tool-execution");
- }
-
- public String getValue() {
- return value;
- }
- @Override
- public String toString() {
- return value;
+ TranscriptionResponse response = new TranscriptionResponse(expectation.getTranscriptionText());
+ return objectMapper.writeValueAsString(response);
}
}
diff --git a/test-infra/camel-test-infra-openai-mock/src/main/java/org/apache/camel/test/infra/openai/mock/OpenAIMock.java b/test-infra/camel-test-infra-openai-mock/src/main/java/org/apache/camel/test/infra/openai/mock/OpenAIMock.java
index 37bd2c71f518..4f54d642f064 100644
--- a/test-infra/camel-test-infra-openai-mock/src/main/java/org/apache/camel/test/infra/openai/mock/OpenAIMock.java
+++ b/test-infra/camel-test-infra-openai-mock/src/main/java/org/apache/camel/test/infra/openai/mock/OpenAIMock.java
@@ -40,6 +40,7 @@ public class OpenAIMock implements BeforeEachCallback, AfterEachCallback {
private HttpServer server;
private final List<MockExpectation> expectations;
private final List<EmbeddingExpectation> embeddingExpectations;
+ private final List<AudioTranscriptionExpectation> audioTranscriptionExpectations;
private final OpenAIMockBuilder builder;
private final ObjectMapper objectMapper;
private ExecutorService executor;
@@ -47,8 +48,11 @@ public class OpenAIMock implements BeforeEachCallback, AfterEachCallback {
public OpenAIMock() {
this.expectations = new ArrayList<>();
this.embeddingExpectations = new ArrayList<>();
+ this.audioTranscriptionExpectations = new ArrayList<>();
this.objectMapper = new ObjectMapper();
- this.builder = new OpenAIMockBuilder(this, this.expectations, this.embeddingExpectations);
+ this.builder = new OpenAIMockBuilder(
+ this, this.expectations, this.embeddingExpectations,
+ this.audioTranscriptionExpectations);
}
public OpenAIMockBuilder builder() {
@@ -65,7 +69,10 @@ public class OpenAIMock implements BeforeEachCallback, AfterEachCallback {
@Override
public void beforeEach(ExtensionContext context) throws Exception {
server = HttpServer.create(new InetSocketAddress(0), 0);
- server.createContext("/", new OpenAIMockServerHandler(expectations, embeddingExpectations, objectMapper));
+ server.createContext("/",
+ new OpenAIMockServerHandler(
+ expectations, embeddingExpectations, audioTranscriptionExpectations,
+ objectMapper));
executor = Executors.newSingleThreadExecutor();
server.setExecutor(executor);
diff --git a/test-infra/camel-test-infra-openai-mock/src/main/java/org/apache/camel/test/infra/openai/mock/OpenAIMockBuilder.java b/test-infra/camel-test-infra-openai-mock/src/main/java/org/apache/camel/test/infra/openai/mock/OpenAIMockBuilder.java
index 42f0daa1cd86..b72eb16009e3 100644
--- a/test-infra/camel-test-infra-openai-mock/src/main/java/org/apache/camel/test/infra/openai/mock/OpenAIMockBuilder.java
+++ b/test-infra/camel-test-infra-openai-mock/src/main/java/org/apache/camel/test/infra/openai/mock/OpenAIMockBuilder.java
@@ -34,14 +34,18 @@ public class OpenAIMockBuilder {
private final OpenAIMock mock;
private final List<MockExpectation> expectations;
private final List<EmbeddingExpectation> embeddingExpectations;
+ private final List<AudioTranscriptionExpectation> audioTranscriptionExpectations;
private MockExpectation currentExpectation;
private EmbeddingExpectation currentEmbeddingExpectation;
+ private AudioTranscriptionExpectation currentAudioTranscriptionExpectation;
public OpenAIMockBuilder(OpenAIMock mock, List<MockExpectation> expectations,
- List<EmbeddingExpectation> embeddingExpectations) {
+ List<EmbeddingExpectation> embeddingExpectations,
+ List<AudioTranscriptionExpectation> audioTranscriptionExpectations) {
this.mock = mock;
this.expectations = expectations;
this.embeddingExpectations = embeddingExpectations;
+ this.audioTranscriptionExpectations = audioTranscriptionExpectations;
}
public OpenAIMockBuilder when(String expectedInput) {
@@ -162,6 +166,35 @@ public class OpenAIMockBuilder {
return this;
}
+ // Audio Transcription API methods
+
+ public OpenAIMockBuilder whenTranscription() {
+ log.debug("Setting up audio transcription expectation");
+ currentAudioTranscriptionExpectation = new AudioTranscriptionExpectation();
+ return this;
+ }
+
+ public OpenAIMockBuilder replyWithTranscription(String text) {
+ validateCurrentAudioTranscriptionExpectation("replyWithTranscription()");
+ log.debug("Setting transcription text: {}", text);
+ currentAudioTranscriptionExpectation.setTranscriptionText(text);
+ return this;
+ }
+
+ public OpenAIMockBuilder withDuration(double duration) {
+ validateCurrentAudioTranscriptionExpectation("withDuration()");
+ log.debug("Setting transcription duration: {}", duration);
+ currentAudioTranscriptionExpectation.setDuration(duration);
+ return this;
+ }
+
+ public OpenAIMockBuilder withLanguage(String language) {
+ validateCurrentAudioTranscriptionExpectation("withLanguage()");
+ log.debug("Setting transcription language: {}", language);
+ currentAudioTranscriptionExpectation.setLanguage(language);
+ return this;
+ }
+
public OpenAIMockBuilder end() {
if (currentExpectation != null) {
log.debug("Finalizing expectation for input: {}", currentExpectation.getExpectedInput());
@@ -171,8 +204,12 @@ public class OpenAIMockBuilder {
log.debug("Finalizing embedding expectation for input: {}", currentEmbeddingExpectation.getExpectedInput());
embeddingExpectations.add(currentEmbeddingExpectation);
currentEmbeddingExpectation = null;
+ } else if (currentAudioTranscriptionExpectation != null) {
+ log.debug("Finalizing audio transcription expectation");
+ audioTranscriptionExpectations.add(currentAudioTranscriptionExpectation);
+ currentAudioTranscriptionExpectation = null;
} else {
- throw new IllegalStateException("Call when() or whenEmbedding() before end()");
+ throw new IllegalStateException("Call when(), whenEmbedding(), or whenTranscription() before end()");
}
return this;
}
@@ -188,8 +225,13 @@ public class OpenAIMockBuilder {
embeddingExpectations.add(currentEmbeddingExpectation);
currentEmbeddingExpectation = null;
}
- log.info("Built OpenAIMock with {} chat expectations and {} embedding expectations",
- expectations.size(), embeddingExpectations.size());
+ if (currentAudioTranscriptionExpectation != null) {
+ log.debug("Auto-finalizing current audio transcription expectation during build");
+ audioTranscriptionExpectations.add(currentAudioTranscriptionExpectation);
+ currentAudioTranscriptionExpectation = null;
+ }
+ log.info("Built OpenAIMock with {} chat, {} embedding, and {} audio transcription expectations",
+ expectations.size(), embeddingExpectations.size(), audioTranscriptionExpectations.size());
return mock;
}
@@ -205,6 +247,12 @@ public class OpenAIMockBuilder {
}
}
+ private void validateCurrentAudioTranscriptionExpectation(String methodName) {
+ if (currentAudioTranscriptionExpectation == null) {
+ throw new IllegalStateException("Call whenTranscription() before " + methodName);
+ }
+ }
+
private void validateHasToolSteps(String methodName) {
if (currentExpectation.getToolSequence().isEmpty()) {
throw new IllegalStateException("Call invokeTool() before " + methodName);
diff --git a/test-infra/camel-test-infra-openai-mock/src/main/java/org/apache/camel/test/infra/openai/mock/OpenAIMockServerHandler.java b/test-infra/camel-test-infra-openai-mock/src/main/java/org/apache/camel/test/infra/openai/mock/OpenAIMockServerHandler.java
index f6619da70d53..fa29451a254d 100644
--- a/test-infra/camel-test-infra-openai-mock/src/main/java/org/apache/camel/test/infra/openai/mock/OpenAIMockServerHandler.java
+++ b/test-infra/camel-test-infra-openai-mock/src/main/java/org/apache/camel/test/infra/openai/mock/OpenAIMockServerHandler.java
@@ -30,12 +30,16 @@ import com.sun.net.httpserver.HttpHandler;
public class OpenAIMockServerHandler implements HttpHandler {
private final RequestHandler chatRequestHandler;
private final EmbeddingRequestHandler embeddingRequestHandler;
+ private final AudioTranscriptionRequestHandler audioTranscriptionRequestHandler;
public OpenAIMockServerHandler(List<MockExpectation> expectations,
List<EmbeddingExpectation> embeddingExpectations,
+ List<AudioTranscriptionExpectation> audioTranscriptionExpectations,
ObjectMapper objectMapper) {
this.chatRequestHandler = new RequestHandler(expectations, objectMapper);
this.embeddingRequestHandler = new EmbeddingRequestHandler(embeddingExpectations, objectMapper);
+ this.audioTranscriptionRequestHandler
+ = new AudioTranscriptionRequestHandler(audioTranscriptionExpectations, objectMapper);
}
@Override
@@ -45,7 +49,9 @@ public class OpenAIMockServerHandler implements HttpHandler {
String path = exchange.getRequestURI().getPath();
String response;
- if (path.endsWith("/embeddings")) {
+ if (path.endsWith("/audio/transcriptions")) {
+ response = audioTranscriptionRequestHandler.handleRequest(exchange);
+ } else if (path.endsWith("/embeddings")) {
response = embeddingRequestHandler.handleRequest(exchange);
} else {
response = chatRequestHandler.handleRequest(exchange);