camel-ai fixes backport to camel-4.22.x (CAMEL-24527, CAMEL-24540, CAMEL-24533) - #25996
Conversation
…task, not only chat The authToken option (and the token resolved from an OAuth profile) was honoured only by the chat task predictor, which passed it as an explicit token= kwarg to transformers.pipeline(). The other nine task predictors — text generation, summarization, question answering, classification, sentence embeddings, ASR, TTS, text-to-image and zero-shot classification — never received it, so loading a gated or private model failed with HTTP 401 even when a token was configured. Apply the token centrally in AbstractTaskPredictor.loadModel() by exporting it as the standard HF_TOKEN environment variable at the top of the generated handler script, which transformers/huggingface_hub read automatically. This covers all ten tasks in one place instead of threading a token clause through each predictor's Python template, and removes the now-redundant per-task clause from ChatPredictor. The token value is escaped when interpolated into the script to prevent breaking out of the Python string literal, and the generated script is logged at DEBUG before the token line is prepended so the token itself is never written to the log. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Closes apache#25899 (cherry picked from commit e65d869)
…ce-embeddings and text-to-image, and set the text-to-image OUTPUT header Two small correctness gaps in the task predictors: - The configured model revision was dropped by SentenceEmbeddingsPredictor and TextToImagePredictor; the other eight tasks pass config.getRevision() into their Python script, so pinning a revision silently had no effect for these two. Pass the revision into sentence_embeddings.py (SentenceTransformer) and text_to_image.py (StableDiffusionPipeline.from_pretrained). - TextToImagePredictor set the image bytes as the body but never set the OUTPUT header, although its Javadoc documents it. Set HuggingFaceConstants.OUTPUT to the image bytes alongside the body. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Andrea Cosentino <ancosen@gmail.com> (cherry picked from commit 674c0e0)
…roperties on CREATE/UPDATE WeaviateEmbeddingsDataTypeTransformer set the message body to the embedding vector and only wrote the optional id into the Weaviate object properties; the embedded text (the TextSegment body) was never written under textFieldName, so the source passage was silently lost. For a RAG pipeline this means the store cannot return the text that produced a match. The Milvus sibling transformer already stores the text correctly. Write the text under textFieldName into the properties for CREATE and UPDATE_BY_ID via a shared setProperties helper, merging into any PROPERTIES header the caller already set rather than replacing it. Also correct the default-branch error message, which claimed only create and updatebyid were supported although query is handled too. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Closes apache#25900 (cherry picked from commit b4c20cb)
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
gnodet
left a comment
There was a problem hiding this comment.
Verified straight cherry-pick backport of three camel-ai fixes (#25899, #25933, #25900) to camel-4.22.x — all 338 change lines are identical to the combined originals. All three original PRs (CAMEL-24527, CAMEL-24540, CAMEL-24533) were already reviewed and approved on main. CI is green.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of Guillaume Nodet
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 12 tested, 29 compile-only — current: 12 all testedMaveniverse Scalpel detected 41 affected modules (current approach: 12).
|
Straight cherry-pick backport to
camel-4.22.xof three camel-ai fixes already reviewed and merged onmain:HF_TOKENexport (was chat-only → 401 on gated/private models)Each commit is a clean cherry-pick of the merged main commit (no manual conflict resolution). The affected code is present on
camel-4.22.x, and the added tests compile and pass on this branch.Claude Code on behalf of oscerd