Skip to content

CAMEL-24539: camel-openai - store embeddings and audio full responses under operation-specific properties - #26110

Open
oscerd wants to merge 1 commit into
apache:mainfrom
oscerd:fix/CAMEL-24539
Open

CAMEL-24539: camel-openai - store embeddings and audio full responses under operation-specific properties#26110
oscerd wants to merge 1 commit into
apache:mainfrom
oscerd:fix/CAMEL-24539

Conversation

@oscerd

@oscerd oscerd commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Issue

CAMEL-24539

Problem

With storeFullResponse=true, the embeddings and audio operations store their full SDK response under
CamelOpenAIResponse. That exchange property is typed as the chat-completion response
(com.openai.models.chat.completions.ChatCompletion), so a downstream reader that expects that type
receives an incompatible object — for example OpenAIToolExecutionProducer reads CamelOpenAIResponse
as a ChatCompletion. The chat, responses, moderation and image operations already use their own
operation-specific properties (CamelOpenAIResponsesResponse, CamelOpenAIModerationResponse,
CamelOpenAIImageResponse).

Fix

Add operation-specific properties and store each response under the matching one:

  • embeddings → CamelOpenAIEmbeddingsResponse (CreateEmbeddingResponse)
  • audio transcription → CamelOpenAIAudioTranscriptionResponse (TranscriptionCreateResponse)
  • audio translation → CamelOpenAIAudioTranslationResponse (TranslationCreateResponse)

The storeFullResponse option documentation and the 4.23 upgrade guide are updated to list the new
properties. Generated catalog and endpoint-DSL metadata regenerated.

Testing

  • OpenAIEmbeddingsMockTest.storeFullResponseStoresEmbeddingResponse now asserts the response is stored
    under CamelOpenAIEmbeddingsResponse and is not set under the chat-completion CamelOpenAIResponse.
  • Full camel-openai unit suite green.
  • mvn -Psourcecheck validate green.

🤖 Generated with Claude Code

… under operation-specific properties

When storeFullResponse=true, the embeddings and audio operations stored their full SDK response under
CamelOpenAIResponse, the property typed as the chat-completion response (ChatCompletion). A downstream
processor reading that property for its declared type received an incompatible object (for example the
tool-execution producer casts it to ChatCompletion), while the chat, responses, moderation and image
operations already use their own operation-specific properties.

Add operation-specific properties and store each response under the matching one:
- embeddings -> CamelOpenAIEmbeddingsResponse (CreateEmbeddingResponse)
- audio transcription -> CamelOpenAIAudioTranscriptionResponse (TranscriptionCreateResponse)
- audio translation -> CamelOpenAIAudioTranslationResponse (TranslationCreateResponse)

The storeFullResponse option documentation and the 4.23 upgrade guide are updated accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y1gCrVvA3FowKoRM9EvmT
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
@oscerd
oscerd requested review from davsclaus and gnodet September 4, 2026 07:47
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • catalog/camel-catalog
  • components/camel-ai/camel-openai
  • docs
  • dsl/camel-endpointdsl

🔬 Scalpel shadow comparison — Scalpel: 13 tested, 24 compile-only — current: 10 all tested

Maveniverse Scalpel detected 37 affected modules (current approach: 10).

⚠️ Modules only in Scalpel (27)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

Skip-tests mode would test 13 modules (4 direct + 9 downstream), skip tests for 24 (generated code, meta-modules)

Modules Scalpel would test (13)
  • camel-catalog
  • camel-endpointdsl
  • camel-jbang-mcp
  • camel-jbang-plugin-mcp
  • camel-jbang-plugin-route-parser
  • camel-jbang-plugin-tui
  • camel-jbang-plugin-validate
  • camel-launcher-container
  • camel-mcp-server
  • camel-openai
  • camel-yaml-dsl-validator
  • camel-yaml-dsl-validator-maven-plugin
  • docs
Modules with tests skipped (24)
  • apache-camel
  • camel-allcomponents
  • camel-catalog-console
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • components/camel-ai/camel-openai: 7 test(s) disabled on GitHub Actions
All tested modules (37 modules)
  • Camel :: AI :: MCP Server
  • Camel :: AI :: OpenAI
  • Camel :: All Components Sync point
  • Camel :: Assembly
  • Camel :: Catalog :: Camel Catalog
  • Camel :: Catalog :: Camel Report Maven Plugin
  • Camel :: Catalog :: Camel Route Parser
  • Camel :: Catalog :: Console
  • Camel :: Catalog :: Dummy Component
  • Camel :: Catalog :: Maven
  • Camel :: Catalog :: Suggest
  • Camel :: Component DSL
  • Camel :: Coverage
  • Camel :: Docs
  • Camel :: Endpoint DSL
  • Camel :: Endpoint DSL :: Support
  • Camel :: Integration Tests
  • Camel :: JBang :: Core
  • Camel :: JBang :: Integration tests
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Main
  • Camel :: JBang :: Plugin :: Edit
  • Camel :: JBang :: Plugin :: Generate
  • Camel :: JBang :: Plugin :: Kubernetes
  • Camel :: JBang :: Plugin :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Testing
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Kamelet Main
  • Camel :: Launcher
  • Camel :: Launcher :: Container
  • Camel :: YAML DSL
  • Camel :: YAML DSL :: Deserializers
  • Camel :: YAML DSL :: Maven Plugins
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix — the bug is real and the approach (operation-specific exchange properties) is consistent with what chat-completion, responses, moderation and image operations already do. The code changes to the three producers are correct.

Two gaps worth addressing:

1. Missing tests for audio transcription/translation storeFullResponse

The embeddings mock test was updated to assert the response lands under CamelOpenAIEmbeddingsResponse (and not under CamelOpenAIResponse). The same coverage is missing for the two audio operations. Given this PR exists precisely because the wrong property key was silently accepted for a long time, adding storeFullResponse tests to OpenAIAudioTranscriptionMockTest and OpenAIAudioTranslationMockTest would prevent regression on the exact same class of bug.

2. Missing operations doc updates

The upgrade guide is updated (good), but openai-operations.adoc doesn't mention storeFullResponse for embeddings, audio transcription, or audio translation — and the new headers (CamelOpenAIEmbeddingsResponse, CamelOpenAIAudioTranscriptionResponse, CamelOpenAIAudioTranslationResponse) don't appear in the output-headers tables for those sections. The image section at line 722 already documents its storeFullResponse property; the other three operations should get the same treatment.

This review was generated by an AI agent, Hermès, on behalf of @gnodet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants