[
https://issues.apache.org/jira/browse/CAMEL-27752?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18153092#comment-18153092
]
Guillaume Nodet commented on CAMEL-27752:
-----------------------------------------
Note regarding the scope of the fix in PR
[#31106|https://github.com/apache/camel/pull/31106]:
*camel-huggingface required no code change.* The OAuth token for Hugging Face
is only used during model download in {{doStart()}} (passed as {{HF_TOKEN}} to
the DJL Python process). Once the model is loaded, inference runs locally with
no further HTTP calls to Hugging Face, so the token expiring after startup does
not affect running exchanges. Startup-time resolution is correct and sufficient
for this component.
The fix and per-request token resolution apply to *camel-docling* only.
> camel-docling, camel-huggingface: oauthProfile token resolved once at
> startup, should be per-request
> ----------------------------------------------------------------------------------------------------
>
> Key: CAMEL-27752
> URL: https://issues.apache.org/jira/browse/CAMEL-27752
> Project: Camel
> Issue Type: Bug
> Reporter: Guillaume Nodet
> Assignee: Guillaume Nodet
> Priority: Major
> Fix For: 4.25.0
>
>
> The {{oauthProfile}} option in {{camel-docling}} and {{camel-huggingface}}
> still resolves the OAuth token once
> at startup (in {{doStart()}}), and stores the string in the configuration.
> After the token expires, all requests fail with HTTP 401
> until the route is restarted.
> CAMEL-27125 fixed the same problem in {{camel-openai}},
> {{camel-langchain4j-agent}}, and {{camel-spring-ai-chat}} by switching to
> per-request supplier lambdas. The same approach should be applied to these
> two components:
> * {{DoclingProducer.resolveOAuthToken()}} (called from {{doStart()}}) — move
> to a per-request supplier
> * {{HuggingFaceProducer.resolveOAuthToken()}} (called from {{doStart()}}) —
> move to a per-request supplier
> Noted in CAMEL-27125 review as a deferred follow-up: camel-ibm-watsonx-ai and
> camel-ibm-watsonx-data were handled by
> CAMEL-27570 and CAMEL-27575 respectively.
> See: https://github.com/apache/camel/pull/30707
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)