Claus Ibsen created CAMEL-27608:
-----------------------------------

             Summary: camel-langchain4j-web-search: no component options, 
required options that have defaults
                 Key: CAMEL-27608
                 URL: https://issues.apache.org/jira/browse/CAMEL-27608
             Project: Camel
          Issue Type: Bug
          Components: camel-langchain4j-web-search
            Reporter: Claus Ibsen
             Fix For: 4.24.0


Found while improving the option descriptions of camel-langchain4j-web-search 
for CAMEL-23832 (PR https://github.com/apache/camel/pull/30940).
These are separate problems of the component; the descriptions PR only 
documents the current behavior.

h4. 1. The options cannot be set on the component
{{LangChain4jWebSearchComponent}} has a {{configuration}} field with 
{{@Metadata}}, but only a getter and no {{setConfiguration()}}. The package 
plugin therefore generates no component options from 
{{LangChain4jWebSearchConfiguration}}: the component JSON lists only 
{{lazyStartProducer}} and {{autowiredEnabled}}, and 
{{LangChain4jWebSearchComponentConfigurer}} configures only those two. 
{{createEndpoint()}} copies the component configuration into each endpoint, but 
nothing can fill it, so 
{{camel.component.langchain4j-web-search.webSearchEngine}}, {{maxResults}} and 
the other search options cannot be set for all endpoints. The user must set 
them on every endpoint URI.
Proposed change: add {{setConfiguration()}} and expose the configuration 
options at component level, as the other camel-langchain4j components do, so 
the copy in {{createEndpoint()}} has a purpose.

h4. 2. maxResults and resultType are required although they have a default
In {{LangChain4jWebSearchConfiguration}}, {{maxResults}} ({{defaultValue = 
"1"}}) and {{resultType}} ({{defaultValue = "CONTENT"}}) are marked 
{{@Metadata(required = true)}}. Both fields are initialized with their default, 
so a user never has to set them. Tools that read the catalog (the docs, Kaoto, 
the Camel CLI) still show them as required.
Proposed change: remove {{required = true}} from these two options.

_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to