This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit e810887b2296ae475aa6dd7808a5d19d24176e97 Author: Claus Ibsen <[email protected]> AuthorDate: Fri Nov 27 11:04:02 2026 +0100 CAMEL-23832: camel-huggingface - improve the component and option descriptions This commit rewrites the component description and the texts of 19 options (the task path, 17 options that the endpoint and the component share, and the component configuration) and 1 header. The old temperature text gave a range of 0.0-1.0 and the device text listed gpu, which Transformers does not accept; topK applies to text-classification only. The pooling and timeout texts now say what DJL does: one shared Python process or one per request, and the DJL defaults of 240 and 120 seconds. Documentation only, no behavior change. The component JSON, the catalog copy, the doc page header and the DSL are regenerated. camel-huggingface is marked as done in tasks/component-descriptions.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../camel/catalog/components/huggingface.json | 76 +++++----- .../camel/catalog/docs/huggingface-component.adoc | 2 +- .../camel/component/huggingface/huggingface.json | 76 +++++----- .../src/main/docs/huggingface-component.adoc | 2 +- .../huggingface/HuggingFaceComponent.java | 6 +- .../huggingface/HuggingFaceConfiguration.java | 65 ++++++--- .../huggingface/HuggingFaceConstants.java | 5 +- .../component/huggingface/HuggingFaceEndpoint.java | 4 + .../component/ComponentsBuilderFactory.java | 5 +- .../dsl/HuggingfaceComponentBuilderFactory.java | 91 ++++++++---- .../builder/endpoint/EndpointHeaderBuilders.java | 5 +- .../builder/endpoint/StaticEndpointBuilders.java | 20 +-- .../dsl/HuggingFaceEndpointBuilderFactory.java | 155 ++++++++++++++------- tasks/component-descriptions.md | 2 +- 14 files changed, 320 insertions(+), 194 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/huggingface.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/huggingface.json index 1076d1add3a8..9e860ccb5124 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/huggingface.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/huggingface.json @@ -3,7 +3,7 @@ "kind": "component", "name": "huggingface", "title": "Hugging Face", - "description": "Integration with Hugging Face's Model Hub by using the Deep Java Library (DJL) Python bridge", + "description": "Run Hugging Face models for tasks such as text classification, summarization, chat and speech recognition, in a Python process of Deep Java Library (DJL).", "deprecated": false, "firstVersion": "4.19.0", "label": "ai", @@ -24,34 +24,34 @@ "remote": true }, "componentProperties": { - "autoSelect": { "index": 0, "kind": "property", "displayName": "Auto Select", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "If true, auto-select the best label (highest score) for zero-shot classification" }, - "configuration": { "index": 1, "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The configuration." }, - "device": { "index": 2, "kind": "property", "displayName": "Device", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Device for inference (cpu, gpu, auto)" }, + "autoSelect": { "index": 0, "kind": "property", "displayName": "Auto Select", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Whether the zero-shot-classification task returns only the label with the highest score, as [...] + "configuration": { "index": 1, "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The configuration that the endpoints of this component start from. Each endpoint uses a copy, in which its own options replace the values." }, + "device": { "index": 2, "kind": "property", "displayName": "Device", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The device to run the model on, such as auto, cpu, cuda or mps. Most tasks give it to the Transformers pipeline as [...] "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 [...] "maxChatHistories": { "index": 4, "kind": "property", "displayName": "Max Chat Histories", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The maximum number of chat histories, one per memory ID, that the chat task keeps [...] "maxHistoryMessages": { "index": 5, "kind": "property", "displayName": "Max History Messages", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 50, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The maximum number of messages that the chat task keeps in a chat history, besid [...] - "maxTokens": { "index": 6, "kind": "property", "displayName": "Max Tokens", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Max tokens for generation tasks" }, - "memoryIdHeader": { "index": 7, "kind": "property", "displayName": "Memory Id Header", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "CamelChatMemoryId", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Header name for conversation memory ID (for multi-user chats)" }, - "minLength": { "index": 8, "kind": "property", "displayName": "Min Length", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Min tokens for summarization tasks" }, - "modelId": { "index": 9, "kind": "property", "displayName": "Model Id", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Hugging Face model ID (e.g., distilbert-base-uncased-finetuned-sst-2-english)" }, - "modelLoadingTimeout": { "index": 10, "kind": "property", "displayName": "Model Loading Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Model loading timeout in seconds, if negative then use default (240 seconds)" }, - "multiLabel": { "index": 11, "kind": "property", "displayName": "Multi Label", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Allow multi-label classifications for zero-shot tasks" }, - "pooling": { "index": 12, "kind": "property", "displayName": "Pooling", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Whether to pool the predictor (keep the Python process alive) or create a new one for each request" }, - "predictorBean": { "index": 13, "kind": "property", "displayName": "Predictor Bean", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Bean name of a custom TaskPredictor implementation (for tasks not covered by built-in predictors)" }, - "predictTimeout": { "index": 14, "kind": "property", "displayName": "Predict Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Predict timeout in seconds, if negative then use default (120 seconds)" }, - "revision": { "index": 15, "kind": "property", "displayName": "Revision", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Model revision or branch (default: main)" }, - "systemPrompt": { "index": 16, "kind": "property", "displayName": "System Prompt", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Initial system prompt for chat tasks (e.g., 'You are a helpful assistant named Alan.')" }, - "temperature": { "index": 17, "kind": "property", "displayName": "Temperature", "group": "producer", "label": "", "required": false, "type": "number", "javaType": "float", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Temperature for sampling (0.0-1.0)" }, - "topK": { "index": 18, "kind": "property", "displayName": "Top K", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 5, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Top-k parameter for classification tasks" }, - "userRole": { "index": 19, "kind": "property", "displayName": "User Role", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "user", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Role for user messages in chat history (e.g., 'user' or 'human')" }, + "maxTokens": { "index": 6, "kind": "property", "displayName": "Max Tokens", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The maximum number of new tokens that the model generates, as max_new_tokens, for the text-generation, summarization an [...] + "memoryIdHeader": { "index": 7, "kind": "property", "displayName": "Memory Id Header", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "CamelChatMemoryId", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The name of the header that holds the memory ID for the cha [...] + "minLength": { "index": 8, "kind": "property", "displayName": "Min Length", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The minimum length, in tokens, of the summary that the summarization task generates." }, + "modelId": { "index": 9, "kind": "property", "displayName": "Model Id", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The ID of the model on the Hugging Face Hub, for example distilbert-base-uncased-finetuned-sst-2-english or Qwen [...] + "modelLoadingTimeout": { "index": 10, "kind": "property", "displayName": "Model Loading Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The time in seconds that DJL waits for the Python process to start and load the model. With 0 or [...] + "multiLabel": { "index": 11, "kind": "property", "displayName": "Multi Label", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Whether the zero-shot-classification task scores each candidate label on its own, so that [...] + "pooling": { "index": 12, "kind": "property", "displayName": "Pooling", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Whether all requests share one Python process, which loads the model once and runs one request at [...] + "predictorBean": { "index": 13, "kind": "property", "displayName": "Predictor Bean", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The name of a bean of type org.apache.camel.component.huggingface.tasks.TaskPredictor that runs th [...] + "predictTimeout": { "index": 14, "kind": "property", "displayName": "Predict Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The time in seconds that DJL waits for the Python process to answer one request. With 0 or a negative value, [...] + "revision": { "index": 15, "kind": "property", "displayName": "Revision", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The revision of the model on the Hugging Face Hub: a branch name, a tag name or a commit ID." }, + "systemPrompt": { "index": 16, "kind": "property", "displayName": "System Prompt", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The system message that the chat task puts first in a new chat history, for example You are a helpfu [...] + "temperature": { "index": 17, "kind": "property", "displayName": "Temperature", "group": "producer", "label": "", "required": false, "type": "number", "javaType": "float", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The sampling temperature for the text-generation, summarization and chat tasks. A higher value gives more random t [...] + "topK": { "index": 18, "kind": "property", "displayName": "Top K", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 5, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The number of labels with the highest scores that the text-classification task returns." }, + "userRole": { "index": 19, "kind": "property", "displayName": "User Role", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "user", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The role of the message that the chat task adds to the chat history from the message [...] "autowiredEnabled": { "index": 20, "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 [...] "healthCheckConsumerEnabled": { "index": 21, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" }, "healthCheckProducerEnabled": { "index": 22, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on produce [...] - "authToken": { "index": 23, "kind": "property", "displayName": "Auth Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "HF API token for private models" }, + "authToken": { "index": 23, "kind": "property", "displayName": "Auth Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The Hugging Face user access token, needed to download gated or private model [...] "oauthProfile": { "index": 24, "kind": "property", "displayName": "Oauth Profile", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "OAuth profile name for obtaining an access token via the OAuth 2.0 Client Credentials grant. [...] }, "headers": { - "CamelHuggingFaceOutput": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The output from the model", "constantName": "org.apache.camel.component.huggingface.HuggingFaceConstants#OUTPUT" }, + "CamelHuggingFaceOutput": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The result of the task, which the producer sets. It is the raw JSON for text-classification, sentence-embeddings and zero-shot-classification with autoSelect=false, the PNG bytes for text-to-image, the DJL Audio for text-to-speech, and else the same text as the [...] "CamelChatClearHistory": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Boolean", "deprecated": false, "autowired": false, "secret": false, "description": "For the chat task, clears the stored conversation history of the current memory id before the request is built. The memory id is read from the header named by the memoryIdHeader option.", "constantName": "org.apache.camel.component.huggingface.HuggingFac [...] }, "bodyTypes": { @@ -59,27 +59,27 @@ "producerOut": { "carriers": [ "text" ], "dependsOn": [ "predictorBean" ], "byOption": [ { "option": "task", "value": "TEXT_CLASSIFICATION", "carriers": [ "pojo" ], "javaType": "ai.djl.modality.Classifications" }, { "option": "task", "value": "TEXT_GENERATION", "carriers": [ "text" ], "javaType": "java.lang.String" }, { "option": "task", "value": "QUESTION_ANSWERING", "carriers": [ "text" ], "javaType": "java.lang.String" }, { "option": "task", "value": "SUMMARIZATION", "carriers": [ [...] }, "properties": { - "task": { "index": 0, "kind": "path", "displayName": "Task", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.huggingface.tasks.HuggingFaceTask", "enum": [ "TEXT_CLASSIFICATION", "TEXT_GENERATION", "QUESTION_ANSWERING", "SUMMARIZATION", "ZERO_SHOT_CLASSIFICATION", "SENTENCE_EMBEDDINGS", "TEXT_TO_IMAGE", "AUTOMATIC_SPEECH_RECOGNITION", "TEXT_TO_SPEECH", "CHAT", "CUSTOM" ], "deprecated": false, "autowired": false, "secret": fal [...] - "autoSelect": { "index": 1, "kind": "parameter", "displayName": "Auto Select", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "If true, auto-select the best label (highest score) for zero-shot classification" }, - "device": { "index": 2, "kind": "parameter", "displayName": "Device", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Device for inference (cpu, gpu, auto)" }, + "task": { "index": 0, "kind": "path", "displayName": "Task", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.huggingface.tasks.HuggingFaceTask", "enum": [ "TEXT_CLASSIFICATION", "TEXT_GENERATION", "QUESTION_ANSWERING", "SUMMARIZATION", "ZERO_SHOT_CLASSIFICATION", "SENTENCE_EMBEDDINGS", "TEXT_TO_IMAGE", "AUTOMATIC_SPEECH_RECOGNITION", "TEXT_TO_SPEECH", "CHAT", "CUSTOM" ], "deprecated": false, "autowired": false, "secret": fal [...] + "autoSelect": { "index": 1, "kind": "parameter", "displayName": "Auto Select", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Whether the zero-shot-classification task returns only the label with the highest score, a [...] + "device": { "index": 2, "kind": "parameter", "displayName": "Device", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The device to run the model on, such as auto, cpu, cuda or mps. Most tasks give it to the Transformers pipeline a [...] "maxChatHistories": { "index": 3, "kind": "parameter", "displayName": "Max Chat Histories", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The maximum number of chat histories, one per memory ID, that the chat task keeps [...] "maxHistoryMessages": { "index": 4, "kind": "parameter", "displayName": "Max History Messages", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 50, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The maximum number of messages that the chat task keeps in a chat history, besi [...] - "maxTokens": { "index": 5, "kind": "parameter", "displayName": "Max Tokens", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Max tokens for generation tasks" }, - "memoryIdHeader": { "index": 6, "kind": "parameter", "displayName": "Memory Id Header", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "CamelChatMemoryId", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Header name for conversation memory ID (for multi-user chats)" }, - "minLength": { "index": 7, "kind": "parameter", "displayName": "Min Length", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Min tokens for summarization tasks" }, - "modelId": { "index": 8, "kind": "parameter", "displayName": "Model Id", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Hugging Face model ID (e.g., distilbert-base-uncased-finetuned-sst-2-english)" }, - "modelLoadingTimeout": { "index": 9, "kind": "parameter", "displayName": "Model Loading Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Model loading timeout in seconds, if negative then use default (240 seconds)" }, - "multiLabel": { "index": 10, "kind": "parameter", "displayName": "Multi Label", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Allow multi-label classifications for zero-shot tasks" }, - "pooling": { "index": 11, "kind": "parameter", "displayName": "Pooling", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Whether to pool the predictor (keep the Python process alive) or create a new one for each request" }, - "predictorBean": { "index": 12, "kind": "parameter", "displayName": "Predictor Bean", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Bean name of a custom TaskPredictor implementation (for tasks not covered by built-in predictors)" }, - "predictTimeout": { "index": 13, "kind": "parameter", "displayName": "Predict Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Predict timeout in seconds, if negative then use default (120 seconds)" }, - "revision": { "index": 14, "kind": "parameter", "displayName": "Revision", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Model revision or branch (default: main)" }, - "systemPrompt": { "index": 15, "kind": "parameter", "displayName": "System Prompt", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Initial system prompt for chat tasks (e.g., 'You are a helpful assistant named Alan.')" }, - "temperature": { "index": 16, "kind": "parameter", "displayName": "Temperature", "group": "producer", "label": "", "required": false, "type": "number", "javaType": "float", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Temperature for sampling (0.0-1.0)" }, - "topK": { "index": 17, "kind": "parameter", "displayName": "Top K", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 5, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Top-k parameter for classification tasks" }, - "userRole": { "index": 18, "kind": "parameter", "displayName": "User Role", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "user", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Role for user messages in chat history (e.g., 'user' or 'human')" }, + "maxTokens": { "index": 5, "kind": "parameter", "displayName": "Max Tokens", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The maximum number of new tokens that the model generates, as max_new_tokens, for the text-generation, summarization a [...] + "memoryIdHeader": { "index": 6, "kind": "parameter", "displayName": "Memory Id Header", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "CamelChatMemoryId", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The name of the header that holds the memory ID for the ch [...] + "minLength": { "index": 7, "kind": "parameter", "displayName": "Min Length", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The minimum length, in tokens, of the summary that the summarization task generates." }, + "modelId": { "index": 8, "kind": "parameter", "displayName": "Model Id", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The ID of the model on the Hugging Face Hub, for example distilbert-base-uncased-finetuned-sst-2-english or Qwe [...] + "modelLoadingTimeout": { "index": 9, "kind": "parameter", "displayName": "Model Loading Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The time in seconds that DJL waits for the Python process to start and load the model. With 0 or [...] + "multiLabel": { "index": 10, "kind": "parameter", "displayName": "Multi Label", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Whether the zero-shot-classification task scores each candidate label on its own, so tha [...] + "pooling": { "index": 11, "kind": "parameter", "displayName": "Pooling", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Whether all requests share one Python process, which loads the model once and runs one request a [...] + "predictorBean": { "index": 12, "kind": "parameter", "displayName": "Predictor Bean", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The name of a bean of type org.apache.camel.component.huggingface.tasks.TaskPredictor that runs t [...] + "predictTimeout": { "index": 13, "kind": "parameter", "displayName": "Predict Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The time in seconds that DJL waits for the Python process to answer one request. With 0 or a negative value [...] + "revision": { "index": 14, "kind": "parameter", "displayName": "Revision", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The revision of the model on the Hugging Face Hub: a branch name, a tag name or a commit ID." }, + "systemPrompt": { "index": 15, "kind": "parameter", "displayName": "System Prompt", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The system message that the chat task puts first in a new chat history, for example You are a helpf [...] + "temperature": { "index": 16, "kind": "parameter", "displayName": "Temperature", "group": "producer", "label": "", "required": false, "type": "number", "javaType": "float", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The sampling temperature for the text-generation, summarization and chat tasks. A higher value gives more random [...] + "topK": { "index": 17, "kind": "parameter", "displayName": "Top K", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 5, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The number of labels with the highest scores that the text-classification task returns." }, + "userRole": { "index": 18, "kind": "parameter", "displayName": "User Role", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "user", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The role of the message that the chat task adds to the chat history from the messag [...] "lazyStartProducer": { "index": 19, "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 [...] - "authToken": { "index": 20, "kind": "parameter", "displayName": "Auth Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "HF API token for private models" }, + "authToken": { "index": 20, "kind": "parameter", "displayName": "Auth Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The Hugging Face user access token, needed to download gated or private mode [...] "oauthProfile": { "index": 21, "kind": "parameter", "displayName": "Oauth Profile", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "OAuth profile name for obtaining an access token via the OAuth 2.0 Client Credentials grant [...] } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/huggingface-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/huggingface-component.adoc index 8a7c223a4f35..ef3e1097b7b0 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/huggingface-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/huggingface-component.adoc @@ -2,7 +2,7 @@ :doctitle: Hugging Face :shortname: huggingface :artifactid: camel-huggingface -:description: Integration with Hugging Face's Model Hub by using the Deep Java Library (DJL) Python bridge +:description: Run Hugging Face models for tasks such as text classification, summarization, chat and speech recognition, in a Python process of Deep Java Library (DJL). :since: 4.19 :supportlevel: Stable :tabs-sync-option: diff --git a/components/camel-ai/camel-huggingface/src/generated/resources/META-INF/org/apache/camel/component/huggingface/huggingface.json b/components/camel-ai/camel-huggingface/src/generated/resources/META-INF/org/apache/camel/component/huggingface/huggingface.json index 1076d1add3a8..9e860ccb5124 100644 --- a/components/camel-ai/camel-huggingface/src/generated/resources/META-INF/org/apache/camel/component/huggingface/huggingface.json +++ b/components/camel-ai/camel-huggingface/src/generated/resources/META-INF/org/apache/camel/component/huggingface/huggingface.json @@ -3,7 +3,7 @@ "kind": "component", "name": "huggingface", "title": "Hugging Face", - "description": "Integration with Hugging Face's Model Hub by using the Deep Java Library (DJL) Python bridge", + "description": "Run Hugging Face models for tasks such as text classification, summarization, chat and speech recognition, in a Python process of Deep Java Library (DJL).", "deprecated": false, "firstVersion": "4.19.0", "label": "ai", @@ -24,34 +24,34 @@ "remote": true }, "componentProperties": { - "autoSelect": { "index": 0, "kind": "property", "displayName": "Auto Select", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "If true, auto-select the best label (highest score) for zero-shot classification" }, - "configuration": { "index": 1, "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The configuration." }, - "device": { "index": 2, "kind": "property", "displayName": "Device", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Device for inference (cpu, gpu, auto)" }, + "autoSelect": { "index": 0, "kind": "property", "displayName": "Auto Select", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Whether the zero-shot-classification task returns only the label with the highest score, as [...] + "configuration": { "index": 1, "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The configuration that the endpoints of this component start from. Each endpoint uses a copy, in which its own options replace the values." }, + "device": { "index": 2, "kind": "property", "displayName": "Device", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The device to run the model on, such as auto, cpu, cuda or mps. Most tasks give it to the Transformers pipeline as [...] "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 [...] "maxChatHistories": { "index": 4, "kind": "property", "displayName": "Max Chat Histories", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The maximum number of chat histories, one per memory ID, that the chat task keeps [...] "maxHistoryMessages": { "index": 5, "kind": "property", "displayName": "Max History Messages", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 50, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The maximum number of messages that the chat task keeps in a chat history, besid [...] - "maxTokens": { "index": 6, "kind": "property", "displayName": "Max Tokens", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Max tokens for generation tasks" }, - "memoryIdHeader": { "index": 7, "kind": "property", "displayName": "Memory Id Header", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "CamelChatMemoryId", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Header name for conversation memory ID (for multi-user chats)" }, - "minLength": { "index": 8, "kind": "property", "displayName": "Min Length", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Min tokens for summarization tasks" }, - "modelId": { "index": 9, "kind": "property", "displayName": "Model Id", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Hugging Face model ID (e.g., distilbert-base-uncased-finetuned-sst-2-english)" }, - "modelLoadingTimeout": { "index": 10, "kind": "property", "displayName": "Model Loading Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Model loading timeout in seconds, if negative then use default (240 seconds)" }, - "multiLabel": { "index": 11, "kind": "property", "displayName": "Multi Label", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Allow multi-label classifications for zero-shot tasks" }, - "pooling": { "index": 12, "kind": "property", "displayName": "Pooling", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Whether to pool the predictor (keep the Python process alive) or create a new one for each request" }, - "predictorBean": { "index": 13, "kind": "property", "displayName": "Predictor Bean", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Bean name of a custom TaskPredictor implementation (for tasks not covered by built-in predictors)" }, - "predictTimeout": { "index": 14, "kind": "property", "displayName": "Predict Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Predict timeout in seconds, if negative then use default (120 seconds)" }, - "revision": { "index": 15, "kind": "property", "displayName": "Revision", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Model revision or branch (default: main)" }, - "systemPrompt": { "index": 16, "kind": "property", "displayName": "System Prompt", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Initial system prompt for chat tasks (e.g., 'You are a helpful assistant named Alan.')" }, - "temperature": { "index": 17, "kind": "property", "displayName": "Temperature", "group": "producer", "label": "", "required": false, "type": "number", "javaType": "float", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Temperature for sampling (0.0-1.0)" }, - "topK": { "index": 18, "kind": "property", "displayName": "Top K", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 5, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Top-k parameter for classification tasks" }, - "userRole": { "index": 19, "kind": "property", "displayName": "User Role", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "user", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Role for user messages in chat history (e.g., 'user' or 'human')" }, + "maxTokens": { "index": 6, "kind": "property", "displayName": "Max Tokens", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The maximum number of new tokens that the model generates, as max_new_tokens, for the text-generation, summarization an [...] + "memoryIdHeader": { "index": 7, "kind": "property", "displayName": "Memory Id Header", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "CamelChatMemoryId", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The name of the header that holds the memory ID for the cha [...] + "minLength": { "index": 8, "kind": "property", "displayName": "Min Length", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The minimum length, in tokens, of the summary that the summarization task generates." }, + "modelId": { "index": 9, "kind": "property", "displayName": "Model Id", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The ID of the model on the Hugging Face Hub, for example distilbert-base-uncased-finetuned-sst-2-english or Qwen [...] + "modelLoadingTimeout": { "index": 10, "kind": "property", "displayName": "Model Loading Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The time in seconds that DJL waits for the Python process to start and load the model. With 0 or [...] + "multiLabel": { "index": 11, "kind": "property", "displayName": "Multi Label", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Whether the zero-shot-classification task scores each candidate label on its own, so that [...] + "pooling": { "index": 12, "kind": "property", "displayName": "Pooling", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Whether all requests share one Python process, which loads the model once and runs one request at [...] + "predictorBean": { "index": 13, "kind": "property", "displayName": "Predictor Bean", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The name of a bean of type org.apache.camel.component.huggingface.tasks.TaskPredictor that runs th [...] + "predictTimeout": { "index": 14, "kind": "property", "displayName": "Predict Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The time in seconds that DJL waits for the Python process to answer one request. With 0 or a negative value, [...] + "revision": { "index": 15, "kind": "property", "displayName": "Revision", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The revision of the model on the Hugging Face Hub: a branch name, a tag name or a commit ID." }, + "systemPrompt": { "index": 16, "kind": "property", "displayName": "System Prompt", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The system message that the chat task puts first in a new chat history, for example You are a helpfu [...] + "temperature": { "index": 17, "kind": "property", "displayName": "Temperature", "group": "producer", "label": "", "required": false, "type": "number", "javaType": "float", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The sampling temperature for the text-generation, summarization and chat tasks. A higher value gives more random t [...] + "topK": { "index": 18, "kind": "property", "displayName": "Top K", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 5, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The number of labels with the highest scores that the text-classification task returns." }, + "userRole": { "index": 19, "kind": "property", "displayName": "User Role", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "user", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The role of the message that the chat task adds to the chat history from the message [...] "autowiredEnabled": { "index": 20, "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 [...] "healthCheckConsumerEnabled": { "index": 21, "kind": "property", "displayName": "Health Check Consumer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all consumer based health checks from this component" }, "healthCheckProducerEnabled": { "index": 22, "kind": "property", "displayName": "Health Check Producer Enabled", "group": "health", "label": "health", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on produce [...] - "authToken": { "index": 23, "kind": "property", "displayName": "Auth Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "HF API token for private models" }, + "authToken": { "index": 23, "kind": "property", "displayName": "Auth Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The Hugging Face user access token, needed to download gated or private model [...] "oauthProfile": { "index": 24, "kind": "property", "displayName": "Oauth Profile", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "OAuth profile name for obtaining an access token via the OAuth 2.0 Client Credentials grant. [...] }, "headers": { - "CamelHuggingFaceOutput": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The output from the model", "constantName": "org.apache.camel.component.huggingface.HuggingFaceConstants#OUTPUT" }, + "CamelHuggingFaceOutput": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The result of the task, which the producer sets. It is the raw JSON for text-classification, sentence-embeddings and zero-shot-classification with autoSelect=false, the PNG bytes for text-to-image, the DJL Audio for text-to-speech, and else the same text as the [...] "CamelChatClearHistory": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Boolean", "deprecated": false, "autowired": false, "secret": false, "description": "For the chat task, clears the stored conversation history of the current memory id before the request is built. The memory id is read from the header named by the memoryIdHeader option.", "constantName": "org.apache.camel.component.huggingface.HuggingFac [...] }, "bodyTypes": { @@ -59,27 +59,27 @@ "producerOut": { "carriers": [ "text" ], "dependsOn": [ "predictorBean" ], "byOption": [ { "option": "task", "value": "TEXT_CLASSIFICATION", "carriers": [ "pojo" ], "javaType": "ai.djl.modality.Classifications" }, { "option": "task", "value": "TEXT_GENERATION", "carriers": [ "text" ], "javaType": "java.lang.String" }, { "option": "task", "value": "QUESTION_ANSWERING", "carriers": [ "text" ], "javaType": "java.lang.String" }, { "option": "task", "value": "SUMMARIZATION", "carriers": [ [...] }, "properties": { - "task": { "index": 0, "kind": "path", "displayName": "Task", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.huggingface.tasks.HuggingFaceTask", "enum": [ "TEXT_CLASSIFICATION", "TEXT_GENERATION", "QUESTION_ANSWERING", "SUMMARIZATION", "ZERO_SHOT_CLASSIFICATION", "SENTENCE_EMBEDDINGS", "TEXT_TO_IMAGE", "AUTOMATIC_SPEECH_RECOGNITION", "TEXT_TO_SPEECH", "CHAT", "CUSTOM" ], "deprecated": false, "autowired": false, "secret": fal [...] - "autoSelect": { "index": 1, "kind": "parameter", "displayName": "Auto Select", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "If true, auto-select the best label (highest score) for zero-shot classification" }, - "device": { "index": 2, "kind": "parameter", "displayName": "Device", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Device for inference (cpu, gpu, auto)" }, + "task": { "index": 0, "kind": "path", "displayName": "Task", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.huggingface.tasks.HuggingFaceTask", "enum": [ "TEXT_CLASSIFICATION", "TEXT_GENERATION", "QUESTION_ANSWERING", "SUMMARIZATION", "ZERO_SHOT_CLASSIFICATION", "SENTENCE_EMBEDDINGS", "TEXT_TO_IMAGE", "AUTOMATIC_SPEECH_RECOGNITION", "TEXT_TO_SPEECH", "CHAT", "CUSTOM" ], "deprecated": false, "autowired": false, "secret": fal [...] + "autoSelect": { "index": 1, "kind": "parameter", "displayName": "Auto Select", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Whether the zero-shot-classification task returns only the label with the highest score, a [...] + "device": { "index": 2, "kind": "parameter", "displayName": "Device", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The device to run the model on, such as auto, cpu, cuda or mps. Most tasks give it to the Transformers pipeline a [...] "maxChatHistories": { "index": 3, "kind": "parameter", "displayName": "Max Chat Histories", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The maximum number of chat histories, one per memory ID, that the chat task keeps [...] "maxHistoryMessages": { "index": 4, "kind": "parameter", "displayName": "Max History Messages", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 50, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The maximum number of messages that the chat task keeps in a chat history, besi [...] - "maxTokens": { "index": 5, "kind": "parameter", "displayName": "Max Tokens", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Max tokens for generation tasks" }, - "memoryIdHeader": { "index": 6, "kind": "parameter", "displayName": "Memory Id Header", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "CamelChatMemoryId", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Header name for conversation memory ID (for multi-user chats)" }, - "minLength": { "index": 7, "kind": "parameter", "displayName": "Min Length", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Min tokens for summarization tasks" }, - "modelId": { "index": 8, "kind": "parameter", "displayName": "Model Id", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Hugging Face model ID (e.g., distilbert-base-uncased-finetuned-sst-2-english)" }, - "modelLoadingTimeout": { "index": 9, "kind": "parameter", "displayName": "Model Loading Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Model loading timeout in seconds, if negative then use default (240 seconds)" }, - "multiLabel": { "index": 10, "kind": "parameter", "displayName": "Multi Label", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Allow multi-label classifications for zero-shot tasks" }, - "pooling": { "index": 11, "kind": "parameter", "displayName": "Pooling", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Whether to pool the predictor (keep the Python process alive) or create a new one for each request" }, - "predictorBean": { "index": 12, "kind": "parameter", "displayName": "Predictor Bean", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Bean name of a custom TaskPredictor implementation (for tasks not covered by built-in predictors)" }, - "predictTimeout": { "index": 13, "kind": "parameter", "displayName": "Predict Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Predict timeout in seconds, if negative then use default (120 seconds)" }, - "revision": { "index": 14, "kind": "parameter", "displayName": "Revision", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Model revision or branch (default: main)" }, - "systemPrompt": { "index": 15, "kind": "parameter", "displayName": "System Prompt", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Initial system prompt for chat tasks (e.g., 'You are a helpful assistant named Alan.')" }, - "temperature": { "index": 16, "kind": "parameter", "displayName": "Temperature", "group": "producer", "label": "", "required": false, "type": "number", "javaType": "float", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Temperature for sampling (0.0-1.0)" }, - "topK": { "index": 17, "kind": "parameter", "displayName": "Top K", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 5, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Top-k parameter for classification tasks" }, - "userRole": { "index": 18, "kind": "parameter", "displayName": "User Role", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "user", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Role for user messages in chat history (e.g., 'user' or 'human')" }, + "maxTokens": { "index": 5, "kind": "parameter", "displayName": "Max Tokens", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The maximum number of new tokens that the model generates, as max_new_tokens, for the text-generation, summarization a [...] + "memoryIdHeader": { "index": 6, "kind": "parameter", "displayName": "Memory Id Header", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "CamelChatMemoryId", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The name of the header that holds the memory ID for the ch [...] + "minLength": { "index": 7, "kind": "parameter", "displayName": "Min Length", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The minimum length, in tokens, of the summary that the summarization task generates." }, + "modelId": { "index": 8, "kind": "parameter", "displayName": "Model Id", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The ID of the model on the Hugging Face Hub, for example distilbert-base-uncased-finetuned-sst-2-english or Qwe [...] + "modelLoadingTimeout": { "index": 9, "kind": "parameter", "displayName": "Model Loading Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The time in seconds that DJL waits for the Python process to start and load the model. With 0 or [...] + "multiLabel": { "index": 10, "kind": "parameter", "displayName": "Multi Label", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Whether the zero-shot-classification task scores each candidate label on its own, so tha [...] + "pooling": { "index": 11, "kind": "parameter", "displayName": "Pooling", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "Whether all requests share one Python process, which loads the model once and runs one request a [...] + "predictorBean": { "index": 12, "kind": "parameter", "displayName": "Predictor Bean", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The name of a bean of type org.apache.camel.component.huggingface.tasks.TaskPredictor that runs t [...] + "predictTimeout": { "index": 13, "kind": "parameter", "displayName": "Predict Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The time in seconds that DJL waits for the Python process to answer one request. With 0 or a negative value [...] + "revision": { "index": 14, "kind": "parameter", "displayName": "Revision", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The revision of the model on the Hugging Face Hub: a branch name, a tag name or a commit ID." }, + "systemPrompt": { "index": 15, "kind": "parameter", "displayName": "System Prompt", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The system message that the chat task puts first in a new chat history, for example You are a helpf [...] + "temperature": { "index": 16, "kind": "parameter", "displayName": "Temperature", "group": "producer", "label": "", "required": false, "type": "number", "javaType": "float", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The sampling temperature for the text-generation, summarization and chat tasks. A higher value gives more random [...] + "topK": { "index": 17, "kind": "parameter", "displayName": "Top K", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 5, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The number of labels with the highest scores that the text-classification task returns." }, + "userRole": { "index": 18, "kind": "parameter", "displayName": "User Role", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "user", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The role of the message that the chat task adds to the chat history from the messag [...] "lazyStartProducer": { "index": 19, "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 [...] - "authToken": { "index": 20, "kind": "parameter", "displayName": "Auth Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "HF API token for private models" }, + "authToken": { "index": 20, "kind": "parameter", "displayName": "Auth Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "security": "secret", "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "The Hugging Face user access token, needed to download gated or private mode [...] "oauthProfile": { "index": 21, "kind": "parameter", "displayName": "Oauth Profile", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.huggingface.HuggingFaceConfiguration", "configurationField": "configuration", "description": "OAuth profile name for obtaining an access token via the OAuth 2.0 Client Credentials grant [...] } } diff --git a/components/camel-ai/camel-huggingface/src/main/docs/huggingface-component.adoc b/components/camel-ai/camel-huggingface/src/main/docs/huggingface-component.adoc index 8a7c223a4f35..ef3e1097b7b0 100644 --- a/components/camel-ai/camel-huggingface/src/main/docs/huggingface-component.adoc +++ b/components/camel-ai/camel-huggingface/src/main/docs/huggingface-component.adoc @@ -2,7 +2,7 @@ :doctitle: Hugging Face :shortname: huggingface :artifactid: camel-huggingface -:description: Integration with Hugging Face's Model Hub by using the Deep Java Library (DJL) Python bridge +:description: Run Hugging Face models for tasks such as text classification, summarization, chat and speech recognition, in a Python process of Deep Java Library (DJL). :since: 4.19 :supportlevel: Stable :tabs-sync-option: diff --git a/components/camel-ai/camel-huggingface/src/main/java/org/apache/camel/component/huggingface/HuggingFaceComponent.java b/components/camel-ai/camel-huggingface/src/main/java/org/apache/camel/component/huggingface/HuggingFaceComponent.java index 901e373d4983..f5840fcfc4e5 100644 --- a/components/camel-ai/camel-huggingface/src/main/java/org/apache/camel/component/huggingface/HuggingFaceComponent.java +++ b/components/camel-ai/camel-huggingface/src/main/java/org/apache/camel/component/huggingface/HuggingFaceComponent.java @@ -29,7 +29,8 @@ import org.apache.camel.util.ObjectHelper; @Metadata(label = "ai") public class HuggingFaceComponent extends HealthCheckComponent { - @Metadata + @Metadata(description = "The configuration that the endpoints of this component start from. Each endpoint uses a copy," + + " in which its own options replace the values.") private HuggingFaceConfiguration configuration = new HuggingFaceConfiguration(); @Override @@ -59,9 +60,6 @@ public class HuggingFaceComponent extends HealthCheckComponent { return configuration; } - /** - * The configuration. - */ public void setConfiguration(HuggingFaceConfiguration configuration) { this.configuration = configuration; } diff --git a/components/camel-ai/camel-huggingface/src/main/java/org/apache/camel/component/huggingface/HuggingFaceConfiguration.java b/components/camel-ai/camel-huggingface/src/main/java/org/apache/camel/component/huggingface/HuggingFaceConfiguration.java index 5886167c53d0..ef14e07bc6b2 100644 --- a/components/camel-ai/camel-huggingface/src/main/java/org/apache/camel/component/huggingface/HuggingFaceConfiguration.java +++ b/components/camel-ai/camel-huggingface/src/main/java/org/apache/camel/component/huggingface/HuggingFaceConfiguration.java @@ -28,32 +28,43 @@ public class HuggingFaceConfiguration implements Cloneable { @UriPath(name = "task") @Metadata(required = true, - description = "The Hugging Face task to perform (e.g., TEXT_CLASSIFICATION)." - + " CUSTOM, or any other name, runs the predictor bean given by predictorBean.") + description = "The task to run, such as text-classification or chat. The name is case insensitive, and a dash" + + " equals an underscore. CUSTOM, or any other name, needs the predictorBean option, whose bean" + + " then runs the task.") private HuggingFaceTask task; @UriParam - @Metadata(required = true, description = "Hugging Face model ID (e.g., distilbert-base-uncased-finetuned-sst-2-english)") + @Metadata(required = true, + description = "The ID of the model on the Hugging Face Hub, for example" + + " distilbert-base-uncased-finetuned-sst-2-english or Qwen/Qwen2.5-3B-Instruct. The model must" + + " support the task.") private String modelId; @UriParam - @Metadata(description = "Model revision or branch (default: main)") + @Metadata(description = "The revision of the model on the Hugging Face Hub: a branch name, a tag name or a commit ID.") private String revision = "main"; @UriParam - @Metadata(description = "Device for inference (cpu, gpu, auto)") + @Metadata(description = "The device to run the model on, such as auto, cpu, cuda or mps. Most tasks give it to the" + + " Transformers pipeline as device_map, where auto spreads the model over the available devices." + + " sentence-embeddings uses cuda for auto when it is available, else cpu, and text-to-image moves" + + " the pipeline to this device.") private String device = "auto"; @UriParam - @Metadata(description = "Max tokens for generation tasks") + @Metadata(description = "The maximum number of new tokens that the model generates, as max_new_tokens, for the" + + " text-generation, summarization and chat tasks.") private int maxTokens = 512; @UriParam - @Metadata(description = "Temperature for sampling (0.0-1.0)") + @Metadata(description = "The sampling temperature for the text-generation, summarization and chat tasks. A higher value" + + " gives more random text. A value of 0 or less turns sampling off, so the model picks the most" + + " likely token each time.") private float temperature = 1.0f; @UriParam(label = "security", security = "secret") - @Metadata(description = "HF API token for private models") + @Metadata(description = "The Hugging Face user access token, needed to download gated or private models. When the" + + " oauthProfile option is set, the token that it obtains replaces this option.") private String authToken; @UriParam(label = "security") @@ -63,22 +74,29 @@ public class HuggingFaceConfiguration implements Cloneable { private String oauthProfile; @UriParam - @Metadata(description = "Min tokens for summarization tasks") + @Metadata(description = "The minimum length, in tokens, of the summary that the summarization task generates.") private int minLength = 30; @UriParam - @Metadata(description = "Allow multi-label classifications for zero-shot tasks") + @Metadata(description = "Whether the zero-shot-classification task scores each candidate label on its own, so that" + + " several labels can be true. If false, the scores of all the labels add up to 1.") private boolean multiLabel = false; @UriParam - @Metadata(description = "Model loading timeout in seconds, if negative then use default (240 seconds)") + @Metadata(description = "The time in seconds that DJL waits for the Python process to start and load the model. With 0" + + " or a negative value, DJL uses the MODEL_LOADING_TIMEOUT environment variable, or else 240" + + " seconds.") private int modelLoadingTimeout = -1; @UriParam - @Metadata(description = "Predict timeout in seconds, if negative then use default (120 seconds)") + @Metadata(description = "The time in seconds that DJL waits for the Python process to answer one request. With 0 or a" + + " negative value, DJL uses the PREDICT_TIMEOUT environment variable, or else 120 seconds.") private int predictTimeout = -1; - @UriParam(defaultValue = "CamelChatMemoryId", description = "Header name for conversation memory ID (for multi-user chats)") + @UriParam(defaultValue = "CamelChatMemoryId", + description = "The name of the header that holds the memory ID for the chat task. Each memory ID has its own" + + " chat history, so that several users can chat at the same time. A message without this" + + " header uses the memory ID default.") private String memoryIdHeader = "CamelChatMemoryId"; @UriParam(defaultValue = "1000", @@ -94,26 +112,35 @@ public class HuggingFaceConfiguration implements Cloneable { + " values are rejected, as they would keep no reply") private int maxHistoryMessages = 50; - @UriParam(defaultValue = "user", description = "Role for user messages in chat history (e.g., 'user' or 'human')") + @UriParam(defaultValue = "user", + description = "The role of the message that the chat task adds to the chat history from the message body. Set" + + " it to the role that the chat template of the model expects, for example human.") private String userRole = "user"; @UriParam - @Metadata(description = "Initial system prompt for chat tasks (e.g., 'You are a helpful assistant named Alan.')") + @Metadata(description = "The system message that the chat task puts first in a new chat history, for example You are a" + + " helpful assistant named Alan.") private String systemPrompt; @UriParam(defaultValue = "true", - description = "If true, auto-select the best label (highest score) for zero-shot classification") + description = "Whether the zero-shot-classification task returns only the label with the highest score, as a" + + " String. If false, it returns a DJL Classifications with all the labels and their scores.") private boolean autoSelect = true; @UriParam - @Metadata(description = "Bean name of a custom TaskPredictor implementation (for tasks not covered by built-in predictors)") + @Metadata(description = "The name of a bean of type org.apache.camel.component.huggingface.tasks.TaskPredictor that" + + " runs the task instead of a built-in predictor. It is required for a task that is not built in." + + " The producer fails to start if the registry has no such bean.") private String predictorBean; - @UriParam(defaultValue = "5", description = "Top-k parameter for classification tasks") + @UriParam(defaultValue = "5", + description = "The number of labels with the highest scores that the text-classification task returns.") private int topK = 5; @UriParam(defaultValue = "true", - description = "Whether to pool the predictor (keep the Python process alive) or create a new one for each request") + description = "Whether all requests share one Python process, which loads the model once and runs one request" + + " at a time. If false, each request starts a new Python process, which loads the model again," + + " and stops it afterwards.") private boolean pooling = true; public boolean isPooling() { diff --git a/components/camel-ai/camel-huggingface/src/main/java/org/apache/camel/component/huggingface/HuggingFaceConstants.java b/components/camel-ai/camel-huggingface/src/main/java/org/apache/camel/component/huggingface/HuggingFaceConstants.java index 9326a1bf7522..81397a551d66 100644 --- a/components/camel-ai/camel-huggingface/src/main/java/org/apache/camel/component/huggingface/HuggingFaceConstants.java +++ b/components/camel-ai/camel-huggingface/src/main/java/org/apache/camel/component/huggingface/HuggingFaceConstants.java @@ -20,7 +20,10 @@ import org.apache.camel.spi.Metadata; public interface HuggingFaceConstants { - @Metadata(description = "The output from the model", javaType = "String") + @Metadata(description = "The result of the task, which the producer sets. It is the raw JSON for text-classification," + + " sentence-embeddings and zero-shot-classification with autoSelect=false, the PNG bytes for" + + " text-to-image, the DJL Audio for text-to-speech, and else the same text as the body.", + javaType = "String") String OUTPUT = "CamelHuggingFaceOutput"; @Metadata(label = "producer", diff --git a/components/camel-ai/camel-huggingface/src/main/java/org/apache/camel/component/huggingface/HuggingFaceEndpoint.java b/components/camel-ai/camel-huggingface/src/main/java/org/apache/camel/component/huggingface/HuggingFaceEndpoint.java index 750cd897ad1a..fd47c57bcd07 100644 --- a/components/camel-ai/camel-huggingface/src/main/java/org/apache/camel/component/huggingface/HuggingFaceEndpoint.java +++ b/components/camel-ai/camel-huggingface/src/main/java/org/apache/camel/component/huggingface/HuggingFaceEndpoint.java @@ -29,6 +29,10 @@ import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; import org.apache.camel.support.DefaultEndpoint; +/** + * Run Hugging Face models for tasks such as text classification, summarization, chat and speech recognition, in a + * Python process of Deep Java Library (DJL). + */ @UriEndpoint(firstVersion = "4.19.0", scheme = "huggingface", title = "Hugging Face", syntax = "huggingface:task", producerOnly = true, category = { Category.AI }, headersClass = HuggingFaceConstants.class) diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java index ca6c9e7d0b13..1875469b6205 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java @@ -2476,8 +2476,9 @@ public interface ComponentsBuilderFactory { } /** * Hugging Face (camel-huggingface) - * Integration with Hugging Face's Model Hub by using the Deep Java Library - * (DJL) Python bridge + * Run Hugging Face models for tasks such as text classification, + * summarization, chat and speech recognition, in a Python process of Deep + * Java Library (DJL). * * Category: ai * Since: 4.19 diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HuggingfaceComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HuggingfaceComponentBuilderFactory.java index b0eb7330f5cd..ef7275028eee 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HuggingfaceComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HuggingfaceComponentBuilderFactory.java @@ -24,8 +24,8 @@ import org.apache.camel.builder.component.ComponentBuilder; import org.apache.camel.component.huggingface.HuggingFaceComponent; /** - * Integration with Hugging Face's Model Hub by using the Deep Java Library - * (DJL) Python bridge + * Run Hugging Face models for tasks such as text classification, summarization, + * chat and speech recognition, in a Python process of Deep Java Library (DJL). * * Generated by camel build tools - do NOT edit this file! */ @@ -34,8 +34,9 @@ public interface HuggingfaceComponentBuilderFactory { /** * Hugging Face (camel-huggingface) - * Integration with Hugging Face's Model Hub by using the Deep Java Library - * (DJL) Python bridge + * Run Hugging Face models for tasks such as text classification, + * summarization, chat and speech recognition, in a Python process of Deep + * Java Library (DJL). * * Category: ai * Since: 4.19 @@ -54,8 +55,9 @@ public interface HuggingfaceComponentBuilderFactory { /** - * If true, auto-select the best label (highest score) for zero-shot - * classification. + * Whether the zero-shot-classification task returns only the label with + * the highest score, as a String. If false, it returns a DJL + * Classifications with all the labels and their scores. * * The option is a: <code>boolean</code> type. * @@ -71,7 +73,9 @@ public interface HuggingfaceComponentBuilderFactory { } /** - * The configuration. + * The configuration that the endpoints of this component start from. + * Each endpoint uses a copy, in which its own options replace the + * values. * * The option is a: * <code>org.apache.camel.component.huggingface.HuggingFaceConfiguration</code> type. @@ -87,7 +91,11 @@ public interface HuggingfaceComponentBuilderFactory { } /** - * Device for inference (cpu, gpu, auto). + * The device to run the model on, such as auto, cpu, cuda or mps. Most + * tasks give it to the Transformers pipeline as device_map, where auto + * spreads the model over the available devices. sentence-embeddings + * uses cuda for auto when it is available, else cpu, and text-to-image + * moves the pipeline to this device. * * The option is a: <code>java.lang.String</code> type. * @@ -168,7 +176,9 @@ public interface HuggingfaceComponentBuilderFactory { } /** - * Max tokens for generation tasks. + * The maximum number of new tokens that the model generates, as + * max_new_tokens, for the text-generation, summarization and chat + * tasks. * * The option is a: <code>int</code> type. * @@ -184,7 +194,10 @@ public interface HuggingfaceComponentBuilderFactory { /** - * Header name for conversation memory ID (for multi-user chats). + * The name of the header that holds the memory ID for the chat task. + * Each memory ID has its own chat history, so that several users can + * chat at the same time. A message without this header uses the memory + * ID default. * * The option is a: <code>java.lang.String</code> type. * @@ -200,7 +213,8 @@ public interface HuggingfaceComponentBuilderFactory { } /** - * Min tokens for summarization tasks. + * The minimum length, in tokens, of the summary that the summarization + * task generates. * * The option is a: <code>int</code> type. * @@ -215,8 +229,9 @@ public interface HuggingfaceComponentBuilderFactory { } /** - * Hugging Face model ID (e.g., - * distilbert-base-uncased-finetuned-sst-2-english). + * The ID of the model on the Hugging Face Hub, for example + * distilbert-base-uncased-finetuned-sst-2-english or + * Qwen/Qwen2.5-3B-Instruct. The model must support the task. * * The option is a: <code>java.lang.String</code> type. * @@ -231,8 +246,9 @@ public interface HuggingfaceComponentBuilderFactory { } /** - * Model loading timeout in seconds, if negative then use default (240 - * seconds). + * The time in seconds that DJL waits for the Python process to start + * and load the model. With 0 or a negative value, DJL uses the + * MODEL_LOADING_TIMEOUT environment variable, or else 240 seconds. * * The option is a: <code>int</code> type. * @@ -248,7 +264,9 @@ public interface HuggingfaceComponentBuilderFactory { /** - * Allow multi-label classifications for zero-shot tasks. + * Whether the zero-shot-classification task scores each candidate label + * on its own, so that several labels can be true. If false, the scores + * of all the labels add up to 1. * * The option is a: <code>boolean</code> type. * @@ -265,8 +283,10 @@ public interface HuggingfaceComponentBuilderFactory { /** - * Whether to pool the predictor (keep the Python process alive) or - * create a new one for each request. + * Whether all requests share one Python process, which loads the model + * once and runs one request at a time. If false, each request starts a + * new Python process, which loads the model again, and stops it + * afterwards. * * The option is a: <code>boolean</code> type. * @@ -282,8 +302,11 @@ public interface HuggingfaceComponentBuilderFactory { } /** - * Bean name of a custom TaskPredictor implementation (for tasks not - * covered by built-in predictors). + * The name of a bean of type + * org.apache.camel.component.huggingface.tasks.TaskPredictor that runs + * the task instead of a built-in predictor. It is required for a task + * that is not built in. The producer fails to start if the registry has + * no such bean. * * The option is a: <code>java.lang.String</code> type. * @@ -298,8 +321,9 @@ public interface HuggingfaceComponentBuilderFactory { } /** - * Predict timeout in seconds, if negative then use default (120 - * seconds). + * The time in seconds that DJL waits for the Python process to answer + * one request. With 0 or a negative value, DJL uses the PREDICT_TIMEOUT + * environment variable, or else 120 seconds. * * The option is a: <code>int</code> type. * @@ -314,7 +338,8 @@ public interface HuggingfaceComponentBuilderFactory { } /** - * Model revision or branch (default: main). + * The revision of the model on the Hugging Face Hub: a branch name, a + * tag name or a commit ID. * * The option is a: <code>java.lang.String</code> type. * @@ -329,8 +354,8 @@ public interface HuggingfaceComponentBuilderFactory { } /** - * Initial system prompt for chat tasks (e.g., 'You are a helpful - * assistant named Alan.'). + * The system message that the chat task puts first in a new chat + * history, for example You are a helpful assistant named Alan. * * The option is a: <code>java.lang.String</code> type. * @@ -345,7 +370,10 @@ public interface HuggingfaceComponentBuilderFactory { } /** - * Temperature for sampling (0.0-1.0). + * The sampling temperature for the text-generation, summarization and + * chat tasks. A higher value gives more random text. A value of 0 or + * less turns sampling off, so the model picks the most likely token + * each time. * * The option is a: <code>float</code> type. * @@ -361,7 +389,8 @@ public interface HuggingfaceComponentBuilderFactory { /** - * Top-k parameter for classification tasks. + * The number of labels with the highest scores that the + * text-classification task returns. * * The option is a: <code>int</code> type. * @@ -378,7 +407,9 @@ public interface HuggingfaceComponentBuilderFactory { /** - * Role for user messages in chat history (e.g., 'user' or 'human'). + * The role of the message that the chat task adds to the chat history + * from the message body. Set it to the role that the chat template of + * the model expects, for example human. * * The option is a: <code>java.lang.String</code> type. * @@ -454,7 +485,9 @@ public interface HuggingfaceComponentBuilderFactory { } /** - * HF API token for private models. + * The Hugging Face user access token, needed to download gated or + * private models. When the oauthProfile option is set, the token that + * it obtains replaces this option. * * The option is a: <code>java.lang.String</code> type. * diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java index ebc67e2c379e..a49ed73e5e3f 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointHeaderBuilders.java @@ -1987,8 +1987,9 @@ public class EndpointHeaderBuilders { } /** * Hugging Face (camel-huggingface) - * Integration with Hugging Face's Model Hub by using the Deep Java Library - * (DJL) Python bridge + * Run Hugging Face models for tasks such as text classification, + * summarization, chat and speech recognition, in a Python process of Deep + * Java Library (DJL). * * Category: ai * Since: 4.19 diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java index 91812e145217..05c487e4330c 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java @@ -8196,8 +8196,9 @@ public class StaticEndpointBuilders { } /** * Hugging Face (camel-huggingface) - * Integration with Hugging Face's Model Hub by using the Deep Java Library - * (DJL) Python bridge + * Run Hugging Face models for tasks such as text classification, + * summarization, chat and speech recognition, in a Python process of Deep + * Java Library (DJL). * * Category: ai * Since: 4.19 @@ -8206,8 +8207,9 @@ public class StaticEndpointBuilders { * Syntax: <code>huggingface:task</code> * * Path parameter: task (required) - * The Hugging Face task to perform (e.g., TEXT_CLASSIFICATION). CUSTOM, or - * any other name, runs the predictor bean given by predictorBean. + * The task to run, such as text-classification or chat. The name is case + * insensitive, and a dash equals an underscore. CUSTOM, or any other name, + * needs the predictorBean option, whose bean then runs the task. * There are 11 enums and the value can be one of: TEXT_CLASSIFICATION, * TEXT_GENERATION, QUESTION_ANSWERING, SUMMARIZATION, * ZERO_SHOT_CLASSIFICATION, SENTENCE_EMBEDDINGS, TEXT_TO_IMAGE, @@ -8221,8 +8223,9 @@ public class StaticEndpointBuilders { } /** * Hugging Face (camel-huggingface) - * Integration with Hugging Face's Model Hub by using the Deep Java Library - * (DJL) Python bridge + * Run Hugging Face models for tasks such as text classification, + * summarization, chat and speech recognition, in a Python process of Deep + * Java Library (DJL). * * Category: ai * Since: 4.19 @@ -8231,8 +8234,9 @@ public class StaticEndpointBuilders { * Syntax: <code>huggingface:task</code> * * Path parameter: task (required) - * The Hugging Face task to perform (e.g., TEXT_CLASSIFICATION). CUSTOM, or - * any other name, runs the predictor bean given by predictorBean. + * The task to run, such as text-classification or chat. The name is case + * insensitive, and a dash equals an underscore. CUSTOM, or any other name, + * needs the predictorBean option, whose bean then runs the task. * There are 11 enums and the value can be one of: TEXT_CLASSIFICATION, * TEXT_GENERATION, QUESTION_ANSWERING, SUMMARIZATION, * ZERO_SHOT_CLASSIFICATION, SENTENCE_EMBEDDINGS, TEXT_TO_IMAGE, diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HuggingFaceEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HuggingFaceEndpointBuilderFactory.java index f21876899156..0114823e1549 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HuggingFaceEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HuggingFaceEndpointBuilderFactory.java @@ -27,8 +27,8 @@ import org.apache.camel.builder.EndpointProducerBuilder; import org.apache.camel.builder.endpoint.AbstractEndpointBuilder; /** - * Integration with Hugging Face's Model Hub by using the Deep Java Library - * (DJL) Python bridge + * Run Hugging Face models for tasks such as text classification, summarization, + * chat and speech recognition, in a Python process of Deep Java Library (DJL). * * Generated by camel build tools - do NOT edit this file! */ @@ -46,8 +46,9 @@ public interface HuggingFaceEndpointBuilderFactory { } /** - * If true, auto-select the best label (highest score) for zero-shot - * classification. + * Whether the zero-shot-classification task returns only the label with + * the highest score, as a String. If false, it returns a DJL + * Classifications with all the labels and their scores. * * The option is a: <code>boolean</code> type. * @@ -62,8 +63,9 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * If true, auto-select the best label (highest score) for zero-shot - * classification. + * Whether the zero-shot-classification task returns only the label with + * the highest score, as a String. If false, it returns a DJL + * Classifications with all the labels and their scores. * * The option will be converted to a <code>boolean</code> type. * @@ -78,7 +80,11 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Device for inference (cpu, gpu, auto). + * The device to run the model on, such as auto, cpu, cuda or mps. Most + * tasks give it to the Transformers pipeline as device_map, where auto + * spreads the model over the available devices. sentence-embeddings + * uses cuda for auto when it is available, else cpu, and text-to-image + * moves the pipeline to this device. * * The option is a: <code>java.lang.String</code> type. * @@ -166,7 +172,9 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Max tokens for generation tasks. + * The maximum number of new tokens that the model generates, as + * max_new_tokens, for the text-generation, summarization and chat + * tasks. * * The option is a: <code>int</code> type. * @@ -180,7 +188,9 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Max tokens for generation tasks. + * The maximum number of new tokens that the model generates, as + * max_new_tokens, for the text-generation, summarization and chat + * tasks. * * The option will be converted to a <code>int</code> type. * @@ -194,7 +204,10 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Header name for conversation memory ID (for multi-user chats). + * The name of the header that holds the memory ID for the chat task. + * Each memory ID has its own chat history, so that several users can + * chat at the same time. A message without this header uses the memory + * ID default. * * The option is a: <code>java.lang.String</code> type. * @@ -209,7 +222,8 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Min tokens for summarization tasks. + * The minimum length, in tokens, of the summary that the summarization + * task generates. * * The option is a: <code>int</code> type. * @@ -223,7 +237,8 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Min tokens for summarization tasks. + * The minimum length, in tokens, of the summary that the summarization + * task generates. * * The option will be converted to a <code>int</code> type. * @@ -237,8 +252,9 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Hugging Face model ID (e.g., - * distilbert-base-uncased-finetuned-sst-2-english). + * The ID of the model on the Hugging Face Hub, for example + * distilbert-base-uncased-finetuned-sst-2-english or + * Qwen/Qwen2.5-3B-Instruct. The model must support the task. * * The option is a: <code>java.lang.String</code> type. * @@ -253,8 +269,9 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Model loading timeout in seconds, if negative then use default (240 - * seconds). + * The time in seconds that DJL waits for the Python process to start + * and load the model. With 0 or a negative value, DJL uses the + * MODEL_LOADING_TIMEOUT environment variable, or else 240 seconds. * * The option is a: <code>int</code> type. * @@ -268,8 +285,9 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Model loading timeout in seconds, if negative then use default (240 - * seconds). + * The time in seconds that DJL waits for the Python process to start + * and load the model. With 0 or a negative value, DJL uses the + * MODEL_LOADING_TIMEOUT environment variable, or else 240 seconds. * * The option will be converted to a <code>int</code> type. * @@ -283,7 +301,9 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Allow multi-label classifications for zero-shot tasks. + * Whether the zero-shot-classification task scores each candidate label + * on its own, so that several labels can be true. If false, the scores + * of all the labels add up to 1. * * The option is a: <code>boolean</code> type. * @@ -298,7 +318,9 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Allow multi-label classifications for zero-shot tasks. + * Whether the zero-shot-classification task scores each candidate label + * on its own, so that several labels can be true. If false, the scores + * of all the labels add up to 1. * * The option will be converted to a <code>boolean</code> type. * @@ -313,8 +335,10 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Whether to pool the predictor (keep the Python process alive) or - * create a new one for each request. + * Whether all requests share one Python process, which loads the model + * once and runs one request at a time. If false, each request starts a + * new Python process, which loads the model again, and stops it + * afterwards. * * The option is a: <code>boolean</code> type. * @@ -329,8 +353,10 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Whether to pool the predictor (keep the Python process alive) or - * create a new one for each request. + * Whether all requests share one Python process, which loads the model + * once and runs one request at a time. If false, each request starts a + * new Python process, which loads the model again, and stops it + * afterwards. * * The option will be converted to a <code>boolean</code> type. * @@ -345,8 +371,11 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Bean name of a custom TaskPredictor implementation (for tasks not - * covered by built-in predictors). + * The name of a bean of type + * org.apache.camel.component.huggingface.tasks.TaskPredictor that runs + * the task instead of a built-in predictor. It is required for a task + * that is not built in. The producer fails to start if the registry has + * no such bean. * * The option is a: <code>java.lang.String</code> type. * @@ -360,8 +389,9 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Predict timeout in seconds, if negative then use default (120 - * seconds). + * The time in seconds that DJL waits for the Python process to answer + * one request. With 0 or a negative value, DJL uses the PREDICT_TIMEOUT + * environment variable, or else 120 seconds. * * The option is a: <code>int</code> type. * @@ -375,8 +405,9 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Predict timeout in seconds, if negative then use default (120 - * seconds). + * The time in seconds that DJL waits for the Python process to answer + * one request. With 0 or a negative value, DJL uses the PREDICT_TIMEOUT + * environment variable, or else 120 seconds. * * The option will be converted to a <code>int</code> type. * @@ -390,7 +421,8 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Model revision or branch (default: main). + * The revision of the model on the Hugging Face Hub: a branch name, a + * tag name or a commit ID. * * The option is a: <code>java.lang.String</code> type. * @@ -404,8 +436,8 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Initial system prompt for chat tasks (e.g., 'You are a helpful - * assistant named Alan.'). + * The system message that the chat task puts first in a new chat + * history, for example You are a helpful assistant named Alan. * * The option is a: <code>java.lang.String</code> type. * @@ -419,7 +451,10 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Temperature for sampling (0.0-1.0). + * The sampling temperature for the text-generation, summarization and + * chat tasks. A higher value gives more random text. A value of 0 or + * less turns sampling off, so the model picks the most likely token + * each time. * * The option is a: <code>float</code> type. * @@ -433,7 +468,10 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Temperature for sampling (0.0-1.0). + * The sampling temperature for the text-generation, summarization and + * chat tasks. A higher value gives more random text. A value of 0 or + * less turns sampling off, so the model picks the most likely token + * each time. * * The option will be converted to a <code>float</code> type. * @@ -447,7 +485,8 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Top-k parameter for classification tasks. + * The number of labels with the highest scores that the + * text-classification task returns. * * The option is a: <code>int</code> type. * @@ -462,7 +501,8 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Top-k parameter for classification tasks. + * The number of labels with the highest scores that the + * text-classification task returns. * * The option will be converted to a <code>int</code> type. * @@ -477,7 +517,9 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * Role for user messages in chat history (e.g., 'user' or 'human'). + * The role of the message that the chat task adds to the chat history + * from the message body. Set it to the role that the chat template of + * the model expects, for example human. * * The option is a: <code>java.lang.String</code> type. * @@ -492,7 +534,9 @@ public interface HuggingFaceEndpointBuilderFactory { return this; } /** - * HF API token for private models. + * The Hugging Face user access token, needed to download gated or + * private models. When the oauthProfile option is set, the token that + * it obtains replaces this option. * * The option is a: <code>java.lang.String</code> type. * @@ -585,8 +629,9 @@ public interface HuggingFaceEndpointBuilderFactory { public interface HuggingFaceBuilders { /** * Hugging Face (camel-huggingface) - * Integration with Hugging Face's Model Hub by using the Deep Java - * Library (DJL) Python bridge + * Run Hugging Face models for tasks such as text classification, + * summarization, chat and speech recognition, in a Python process of + * Deep Java Library (DJL). * * Category: ai * Since: 4.19 @@ -599,8 +644,9 @@ public interface HuggingFaceEndpointBuilderFactory { } /** * Hugging Face (camel-huggingface) - * Integration with Hugging Face's Model Hub by using the Deep Java - * Library (DJL) Python bridge + * Run Hugging Face models for tasks such as text classification, + * summarization, chat and speech recognition, in a Python process of + * Deep Java Library (DJL). * * Category: ai * Since: 4.19 @@ -609,8 +655,10 @@ public interface HuggingFaceEndpointBuilderFactory { * Syntax: <code>huggingface:task</code> * * Path parameter: task (required) - * The Hugging Face task to perform (e.g., TEXT_CLASSIFICATION). CUSTOM, - * or any other name, runs the predictor bean given by predictorBean. + * The task to run, such as text-classification or chat. The name is + * case insensitive, and a dash equals an underscore. CUSTOM, or any + * other name, needs the predictorBean option, whose bean then runs the + * task. * There are 11 enums and the value can be one of: TEXT_CLASSIFICATION, * TEXT_GENERATION, QUESTION_ANSWERING, SUMMARIZATION, * ZERO_SHOT_CLASSIFICATION, SENTENCE_EMBEDDINGS, TEXT_TO_IMAGE, @@ -624,8 +672,9 @@ public interface HuggingFaceEndpointBuilderFactory { } /** * Hugging Face (camel-huggingface) - * Integration with Hugging Face's Model Hub by using the Deep Java - * Library (DJL) Python bridge + * Run Hugging Face models for tasks such as text classification, + * summarization, chat and speech recognition, in a Python process of + * Deep Java Library (DJL). * * Category: ai * Since: 4.19 @@ -634,8 +683,10 @@ public interface HuggingFaceEndpointBuilderFactory { * Syntax: <code>huggingface:task</code> * * Path parameter: task (required) - * The Hugging Face task to perform (e.g., TEXT_CLASSIFICATION). CUSTOM, - * or any other name, runs the predictor bean given by predictorBean. + * The task to run, such as text-classification or chat. The name is + * case insensitive, and a dash equals an underscore. CUSTOM, or any + * other name, needs the predictorBean option, whose bean then runs the + * task. * There are 11 enums and the value can be one of: TEXT_CLASSIFICATION, * TEXT_GENERATION, QUESTION_ANSWERING, SUMMARIZATION, * ZERO_SHOT_CLASSIFICATION, SENTENCE_EMBEDDINGS, TEXT_TO_IMAGE, @@ -662,7 +713,11 @@ public interface HuggingFaceEndpointBuilderFactory { public static final HuggingFaceHeaderNameBuilder INSTANCE = new HuggingFaceHeaderNameBuilder(); /** - * The output from the model. + * The result of the task, which the producer sets. It is the raw JSON + * for text-classification, sentence-embeddings and + * zero-shot-classification with autoSelect=false, the PNG bytes for + * text-to-image, the DJL Audio for text-to-speech, and else the same + * text as the body. * * The option is a: {@code String} type. * diff --git a/tasks/component-descriptions.md b/tasks/component-descriptions.md index d28e616546b7..59d8e005f995 100644 --- a/tasks/component-descriptions.md +++ b/tasks/component-descriptions.md @@ -211,7 +211,7 @@ or removes its row. | camel-huaweicloud-imagerecognition | hwcloud-imagerecognition | yes | | camel-huaweicloud-obs | hwcloud-obs | | | camel-huaweicloud-smn | hwcloud-smn | | -| camel-huggingface | huggingface | | +| camel-huggingface | huggingface | yes | | camel-ibm-cos | ibm-cos | | | camel-ibm-secrets-manager | ibm-secrets-manager | | | camel-ibm-watson-discovery | ibm-watson-discovery | |
