luigidemasi commented on code in PR #27656:
URL: https://github.com/apache/camel/pull/27656#discussion_r4237643890
##########
components/camel-ai/camel-semantic/src/main/java/org/apache/camel/semantic/internal/SemanticAuditService.java:
##########
@@ -404,7 +471,8 @@ public void complete(String status, String reason,
SemanticResult result) {
}
}
if (enabled) {
- publish(record);
+ fields.putAll(inputFields);
+ publish(inputFields.isEmpty() ? record :
SemanticAuditRecord.fromMap(fields));
Review Comment:
Addressed in 6d9856c790d8236a7c0544f18b9252382a835ae5. I took the
explanatory-comment option: live and restored records deliberately use the same
validation path, including the bounded defensive input copy. The publication
call now documents that choice, and the factory Javadoc describes both live
creation and restoration. This preserves the record validation and immutability
guarantees.
_AI-generated by OpenAI Codex on behalf of @luigidemasi._
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/action/CamelSemantic.java:
##########
@@ -94,9 +95,11 @@ protected void render(JsonObject response) {
new
Column().header("REFERENCE").dataAlign(HorizontalAlign.LEFT).with(r -> text(r,
"reference")),
new
Column().header("NAME").dataAlign(HorizontalAlign.LEFT).with(r -> text(r,
"name")),
new
Column().header("ERROR").dataAlign(HorizontalAlign.LEFT).with(r -> text(r,
"error")))));
- printer().println("Default expert: " + text(response,
"defaultExpert"));
- if (response.get("defaultError") != null) {
- printer().println("Default expert error: " +
response.get("defaultError"));
+ String defaultExpert = text(response, "defaultExpert");
+ printer().println("Default expert: " + (defaultExpert.isEmpty() ?
"none" : defaultExpert));
+ String defaultError = text(response, "defaultError");
+ if (!defaultError.isEmpty() && !defaultError.startsWith("Semantic
language requires exactly one eligible expert")) {
Review Comment:
Addressed in 6d9856c790d8236a7c0544f18b9252382a835ae5. Automatic discovery
now throws a typed internal exception when it finds zero or multiple eligible
experts. The metadata console exposes `defaultErrorCode` (`no_unique_expert` or
`default_expert_error`), and the CLI uses that code independently of the
diagnostic wording. Message matching is retained only for older runtimes that
omit the code; errors with unknown codes remain visible.
Producer and CLI regressions cover zero/one/multiple experts, missing or
invalid configured defaults, changed diagnostic wording, unknown codes, legacy
responses, and JSON output. Console metadata and documentation are regenerated.
_AI-generated by 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]