Skip to content

ai - the LangChain4j chat model is configured by provider instead of a bean of the model class - #128

Merged
davsclaus merged 3 commits into
mainfrom
langchain4j-provider
Oct 20, 2026
Merged

davsclaus merged 3 commits into
mainfrom
langchain4j-provider

Conversation

@davsclaus

Copy link
Copy Markdown
Contributor

Closes #91. Stacked on #126; retarget to main once that is merged.

Camel 4.23 creates the langchain4j-chat model from a provider (CAMEL-24820), and camel run downloads the provider's LangChain4j module, so the OllamaChatModel builder beans go:

  • ai/langchain4j-chat and ai/ticket-classifier: provider: ollama, baseUrl, modelName and temperature on the endpoint. Their Citrus tests pass only ollama.base.url and ollama.model, not application.properties, so options on the endpoint keep the tests unchanged.
  • ai/docling-langchain4j-rag (four endpoints) and security/ocsf: camel.component.langchain4j-chat.provider=ollama and friends in application.properties.
  • The READMEs, the log line numbers they show, the catalog descriptions and the ai group table say the model is configured by provider. The RAG README explains switching to OpenAI with provider=openai and an api-key. The "Using OpenAI instead of Ollama" section with the Groovy bean, mentioned in the issue, was already gone.

Since the issue was filed, #93 and #103 brought the bean back in the RAG and OCSF examples, so they were no longer broken; this replaces those beans too. ai/ticket-classifier was added after the issue (#119) and gets the same change.

Tested locally with Camel 4.23.0 against a local Ollama (granite4:3b):

  • langchain4j-chat writes the three notifications. The route also works without application.properties, as its Citrus test runs it.
  • ticket-classifier files the three tickets.
  • ocsf's /api/ocsf/detection-finding/summarize answers with the model's summary.
  • The RAG example starts (the Docling service was not running, so documents were not processed).
  • camel validate yaml --canonical succeeds for all four route files.

I did not run the two Citrus tests: they start their own Ollama container and pull a 2.5 GB model.

Claude Code on behalf of davsclaus

🤖 Generated with Claude Code

davsclaus and others added 3 commits October 20, 2026 09:53
…p-server and contracts/openapi-server use what it brings

CI pins Camel 4.23.0 for the CLI and for the integrations the Citrus tests start, as camel@apache/camel defaults to
the latest LTS release (4.22.0). ai/mcp-server sets the server title, description and instructions, its README says
that the server serves ai-resource routes next to the tools, and the log lines it shows are those of 4.23.0.
contracts/openapi-server keeps its /api base path, but its README no longer says the servers entry must have a path:
on 4.23 an entry without one serves the operations at the root.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…assifier writes at runtime

The catalog was generated in a directory where the example had run, so it listed tickets-out/*/T-*.json, which are
not in the repository; fetching them from GitHub answers 404.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…a bean of the model class

Camel 4.23 creates the langchain4j-chat model from a provider and the options every provider has (CAMEL-24820), and
camel run downloads the provider's LangChain4j module. ai/langchain4j-chat and ai/ticket-classifier set provider,
baseUrl, modelName and temperature on the endpoint, so their Citrus tests, which pass only the URL and the model
name, need no change. ai/docling-langchain4j-rag (four endpoints) and security/ocsf set them as component options in
application.properties. The OllamaChatModel builder beans are gone, and the READMEs, the log line numbers they show
and the catalog descriptions say the model is configured by provider. Closes #91.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Base automatically changed from camel-4.23-upgrade to main October 20, 2026 10:55
@davsclaus
davsclaus merged commit a9a70f5 into main Oct 20, 2026
36 checks passed
@davsclaus
davsclaus deleted the langchain4j-provider branch October 20, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Declare the LangChain4j chat model by provider once Camel 4.23 is out (CAMEL-24820)

1 participant