luigidemasi opened a new pull request, #27373: URL: https://github.com/apache/camel/pull/27373
# Description Semantic questions currently share one adapter and must supply instructions, which prevents mixing general question answering with fixed-purpose models. This change lets each question select a named expert and validates it against that adapter's runtime capabilities before evaluation. - Add component-local `SemanticExpert` metadata and `SemanticCapabilities`, with a compatible default `SemanticAdapter.capabilities()` method. TypeSafe AI declares its supported operations and limits through this contract. - Support expert selection in Java, XML and YAML. Resolve explicit names, defaults and automatic selection deterministically; reject unknown experts without fallback and include the expert in diagnostics. - Group batches by expert instance, preserve requested result order and publish results only when every group succeeds. Validate all selected inputs before inference and prepare declarations before starting discovered providers. - Validate reloads against live expressions and the complete candidate declaration snapshot before publication. Failed validation preserves the previous declarations; weak registrations avoid retaining abandoned expressions and providers. - Regenerate existing YAML schemas and their catalog mirror, and synchronize the semantic documentation mirror. The catalog model/API and shared SPI annotation are unchanged; capability discovery stays within the semantic components. A separate commit fixes the YAML validator rejecting runtime-supported numeric placeholders and quoted numbers in schema alternatives, including semantic `threshold` values. Alternative selection now respects the YAML instance location and convertible scalar errors while preserving genuine required-field errors. The documentation explains the existing YAML reload limitation: replacement declarations validate before beans in that reload are prepared. A newly selected expert must already be registered; applications can register it before reloading, keep expert beans outside the reloaded resource, or restart when changing both together. Validation: - `camel-semantic`: 194 tests passed. - `camel-typesafe-ai`: 187 tests passed. - YAML `SemanticQuestionTest`: 31 tests passed. - YAML validator: 199 tests passed. - Source formatting/import checks passed for the changed runtime modules and validator. - Full root `mvnd -B -ntp -Dmaven.build.cache.enabled=false clean install -DskipTests`: all 698 modules succeeded. Generated files are committed. # Target - [x] Targets `main` (Camel 4). # Tracking - [x] Tracked by [CAMEL-25310](https://issues.apache.org/jira/browse/CAMEL-25310), whose scope now reflects runtime capability discovery. # Apache Camel coding standards and style - [x] Each commit has a meaningful subject and body; the YAML validator fix is a separate commit. - [x] Ran the full root build with tests skipped and committed the generated changes. # AI-assisted contributions - [x] AI-assisted commits include co-authorship attribution. _Generated by Codex on behalf of @luigidemasi._ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
