Claus Ibsen created CAMEL-24804:
-----------------------------------

             Summary: camel-jbang - camel_catalog_doc for simple: an 
optionsFilter that names a function group returns exactly that group, not every 
function whose description mentions the word
                 Key: CAMEL-24804
                 URL: https://issues.apache.org/jira/browse/CAMEL-24804
             Project: Camel
          Issue Type: Improvement
          Components: camel-knative
            Reporter: Claus Ibsen


{{camel_catalog_doc}} for the {{simple}} language answers without a filter with 
the function count and the names by group (ai, attachment, base64, collection, 
condition, core, date, function, html, json, number, other, string, xml; 152 
functions), and tells the model: "optionsFilter with a function name, a group 
above or a word from its description returns the matching functions with their 
parameters and examples".

But the filter is one substring match over the name, the display name, the 
description and the group ({{CatalogDocs.addLanguageFunctions}} with 
{{matchesOptionFilter}}). So a model that follows the hint and asks for the 
group it was just shown gets more than the group:
* {{optionsFilter=date}} returns the date group plus every function whose 
description mentions a date;
* {{optionsFilter=string}} returns the string group plus most of the catalog, 
since many descriptions say "string";
* {{optionsFilter=core}} and {{optionsFilter=other}} match descriptions too.

For a small local model that is the difference between a few functions with 
examples and a page of them that pushes the answer out of its context 
(CAMEL-24796 compaction).

Proposed:
* when the filter equals a group name (case-insensitive), return the functions 
of that group only, and say so ({{"group": "date"}});
* when the filter equals a function name, return that function first (exact 
match), then the substring matches;
* the substring match over descriptions stays for everything else.

Same for the operators, whose filter also matches the operator kind.

Tests in {{CatalogDocsTest}}: {{date}} returns the date group exactly, 
{{string}} does not return the whole catalog, an exact function name comes 
first.

Context: the simple support for local models in the TUI AI panel (Sept 2026); 
the observed failure was a 14B model listing functions it could not count and 
writing {{$\{header.username ?: 'Guest'\}}} after seeing the correct example.

_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to