This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-jbang-examples.git


The following commit(s) were added to refs/heads/main by this push:
     new f7b2110  ocsf: declare the chatModel bean again, run with camel run 
(#103)
f7b2110 is described below

commit f7b2110a69b128e488fa5c59bf9899ac326f8bfc
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu Oct 8 08:56:49 2026 +0200

    ocsf: declare the chatModel bean again, run with camel run (#103)
    
    The summarize route sends to langchain4j-chat with chatModel: "#chatModel",
    but the beans block that built the model was lost when the file was
    rewritten to the canonical YAML form, so the endpoint failed on the
    missing bean. Declare it again in the builder form of the
    langchain4j-chat example.
    
    The README ran the example from a 4.18.0-SNAPSHOT build; camel-ocsf is
    released, so it runs with camel run, which adds the dependencies.
    
    Fixes #92
    
    
    Claude-Session: https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m
    
    Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
---
 security/ocsf/README.md       | 12 +++---------
 security/ocsf/ocsf.camel.yaml | 10 ++++++++++
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/security/ocsf/README.md b/security/ocsf/README.md
index 0e451a2..c7258fc 100644
--- a/security/ocsf/README.md
+++ b/security/ocsf/README.md
@@ -8,20 +8,14 @@ The example exposes REST endpoints that receive OCSF events 
as JSON, unmarshal t
 
 The `camel-ocsf` module requires Camel 4.18.0 or later.
 
-If you're working with a SNAPSHOT build:
-
-```shell
-cd /path/to/camel
-mvn clean install -pl components/camel-ocsf -am -DskipTests
-mvn clean install -pl dsl/camel-jbang -am -DskipTests
-```
-
 ## Running the Example
 
 ```shell
-jbang -Dcamel.jbang.version=4.18.0-SNAPSHOT camel@apache/camel run --port 8081 
--properties=application.properties --dep camel:ocsf --dep 
camel:langchain4j-chat --dep=mvn:dev.langchain4j:langchain4j-ollama:1.10.0 
ocsf.camel.yaml
+camel run ocsf.camel.yaml application.properties --port 8081
 ```
 
+`camel run` adds the dependencies by itself: camel-ocsf, 
camel-langchain4j-chat and the LangChain4j Ollama model of the `chatModel` bean.
+
 The server starts on port 8081. Check the health endpoint to verify:
 
 ```shell
diff --git a/security/ocsf/ocsf.camel.yaml b/security/ocsf/ocsf.camel.yaml
index 42b2a36..b2d4d3c 100644
--- a/security/ocsf/ocsf.camel.yaml
+++ b/security/ocsf/ocsf.camel.yaml
@@ -1,3 +1,13 @@
+- beans:
+    - name: chatModel
+      type: dev.langchain4j.model.ollama.OllamaChatModel
+      builderClass: 
dev.langchain4j.model.ollama.OllamaChatModel$OllamaChatModelBuilder
+      builderMethod: build
+      properties:
+        baseUrl: "{{ollama.base.url}}"
+        modelName: "{{ollama.model.name}}"
+        temperature: 0.3
+
 - route:
     id: ocsf-detection-finding-receiver
     from:

Reply via email to