luigidemasi opened a new pull request, #27602:
URL: https://github.com/apache/camel/pull/27602
# Description
Adds a Semantic screen to Camel TUI so users can inspect configured
definitions, understand expert contracts and reuse, and explicitly try an
expert from the same interface. Source completion also uses the selected
expert's declared operations instead of assuming that every expert supports
boolean, choice, and score.
- **Definitions, Experts, and Relationships:** coordinated selection,
structured parameter display, an explicit operation selector, and a diagram
grouping definitions that share an expert operation.
- **Evaluation:** typed parameter controls for direct expert calls, sample
exchange evaluation for named definitions, an explicit prefill action, and
retained drafts and results. Shared output shows result meaning, probabilities,
confidence, and readable failures. Browsing metadata does not instantiate or
invoke an expert.
- **Runtime support:** `semantic-metadata` and `semantic-evaluate` developer
consoles, CLI connector integration, and isolated request files for concurrent
or late responses. Direct evaluation uses the semantic abstraction and does not
send a message through a route.
- **Score semantics:** optional `SemanticOperation.scoreLevelsParameter`
metadata links a score to an ordered `List<String>` parameter. The TypeSafe AI
adapter declares this relationship for `criteria`. The TUI derives the
effective range, labels probability bars with level descriptions, and explains
fractional scores. Labels remain tied to the submitted input when the draft
changes; experts without this metadata retain their existing presentation.
Includes regression tests, TUI help and documentation, and generated console
catalog descriptors. No new dependencies.
# Validation
Clean module builds with tests on the rebased commit:
```sh
./mvnw -B -ntp \
-pl
components/camel-ai/camel-semantic,components/camel-ai/camel-typesafe-ai,dsl/camel-cli-connector,dsl/camel-jbang/camel-jbang-plugin-tui
\
-Dmaven.build.cache.enabled=false clean install
```
Results: 2,352 tests across the four modules, zero final failures/errors and
one skipped TUI test.
`LocalCliConnectorJfrActionTest.reportsAnErrorWhenTheJfrConsoleIsNotOnTheClasspath`
timed out on its first attempt and passed its automatic retry. The unmodified
upstream connector suite and a focused run of the metadata/JFR tests in one JVM
both passed with retries disabled; the intermittent full-suite timeout remains
unexplained.
Catalog generation/package and rendering checks at 144×40, 88×24, and 200×50
were also performed. The final validation does not include a root reactor build
or live provider inference.
# Target
- [x] Targets `main`; rebased onto upstream commit `1dda2b175d7b`.
# Tracking
- [x] Follow-up to
[CAMEL-25382](https://issues.apache.org/jira/browse/CAMEL-25382), which
introduced the expert-owned contracts. This PR adds tooling and the score-level
metadata relationship.
# Apache Camel coding standards and style
- [x] Commit has a meaningful subject and body.
- [x] Ran clean installs for the affected modules, including
formatting/import sorting, and committed the applicable generated files.
# AI-assisted contributions
- [x] Commit includes AI co-authorship attribution.
_AI-assisted with OpenAI 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]