davsclaus opened a new issue, #92:
URL: https://github.com/apache/camel-jbang-examples/issues/92
`ai/docling-langchain4j-rag/docling-langchain4j-rag.yaml` and
`security/ocsf/ocsf.camel.yaml` send to `langchain4j-chat` with `chatModel:
"#chatModel"`, but neither example declares a bean named `chatModel` any more:
not in the YAML, not in `application.properties`. Starting either fails when
the endpoint looks the bean up.
The bean was lost on May 21 in 60a70d8 ("normalize REST DSL,
routeConfiguration, and beans examples to canonical form"). Both files were
rewritten by the YAML round-trip, and the `beans:` block at the top of each, a
Groovy script building the model, did not survive:
```yaml
- beans:
- name: chatModel
type: "#class:dev.langchain4j.model.ollama.OllamaChatModel"
scriptLanguage: groovy
script: |
import dev.langchain4j.model.ollama.OllamaChatModel
import static java.time.Duration.ofSeconds
return OllamaChatModel.builder()
.baseUrl("{{ollama.base.url}}")
.modelName("{{ollama.model.name}}")
.temperature(0.3)
.timeout(ofSeconds(120))
.build()
```
Nobody noticed because neither example runs in CI: both are `bundled: false`
and need Ollama (and Docling for the RAG one).
Fix on 4.22: put the bean back in both files, in the builder form the
`ai/langchain4j-chat` example uses (`type`, `builderClass`, `builderMethod`,
`properties`) rather than the Groovy script, so it matches the rest of the
group. The RAG README's "Using OpenAI instead of Ollama" section shows the
Groovy form and should follow.
On 4.23 the bean goes away again in favour of the provider options, see #91;
this issue is about making the examples run now.
Worth a check: `pqc-secure-file-transfer` also references `#kemKeyPair`, but
it binds that in a script step, so it is fine. A CI check that every `"#name"`
reference in an example has a declaration would have caught this.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj
--
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]