Skip to content

docling-langchain4j-rag and ocsf reference a chatModel bean that no file declares #92

Description

@davsclaus

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:

- 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.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions