Croway opened a new pull request, #30727:
URL: https://github.com/apache/camel/pull/30727

   ## Summary
   
   The camel-spring-ai-chat integration tests could only run on Ollama. 
`OllamaTestSupport` always built an `OllamaChatModel`, and the vector store 
tests always built an `OllamaEmbeddingModel`, even with 
`-Dollama.instance.type=openai`. The camel-openai, langchain4j and mcp-server 
tests already support that switch.
   
   With `-Dollama.instance.type=openai`, `OllamaTestSupport` now builds Spring 
AI's `OpenAiChatModel` and `OpenAiEmbeddingModel` from `openai.endpoint`, 
`openai.model`, `openai.embedding.model` and `openai.api.key`, so the tests run 
on vLLM, LiteLLM, LM Studio, Ollama's `/v1` endpoint or OpenAI.
   
   - **Thinking off:** the tests send `reasoning_effort: none` and 
`chat_template_kwargs` (`enable_thinking: false`), as `disableThinking()` does 
on Ollama.
     - Ollama's OpenAI API reads `reasoning_effort`, and vLLM reads both.
     - Neither field is sent to the OpenAI platform, detected by its host.
     - `-Dopenai.disable.thinking=false` leaves both out, for servers that 
reject `reasoning_effort: none` (vLLM before 0.18, GPT-OSS models).
   - **Vector store tests:** `SpringAiChatVectorStoreIT` and 
`SpringAiChatVectorMemoryIT` take their embedding model from the support class.
   - **Docs:** the camel-spring-ai test guide has a new "Any OpenAI-compatible 
server" section. It covers properties, passing the key through 
`OPENAI_API_KEY`, skipping the vector ITs on chat-only servers, and vLLM 
tool-calling flags.
   - **Scope:** test-only. `spring-ai-openai` is added with test scope, and 
without the system property nothing changes.
   
   ## Testing
   
   - **Five ITs against a local Ollama** (`qwen3:4b-instruct`): 
`SpringAiChatOllamaIT`, `ToolsIntegrationIT`, `StructuredOutputIT`, `MemoryIT` 
and `MultipleMessagesIT`.
     - 27/27 in the default mode, whose logs show `OllamaChatOptions`.
     - 27/27 with `-Dollama.instance.type=openai 
-Dopenai.endpoint=http://localhost:11434/v1`, whose logs show 
`OpenAiChatOptions`.
   - **Request bodies, captured with a fake server:** both thinking fields are 
present by default and absent with `-Dopenai.disable.thinking=false`. Host 
detection was checked for `api.openai.com`, `API.OPENAI.COM`, 
`eu.api.openai.com`, a local URL and a proxy path.
   - **Gateway run:** an earlier version of the change ran the 81 chat ITs 
against six models behind a vLLM/LiteLLM gateway. On the fast models, 78 to 80 
of 81 passed; the failures were model answers, not the setup.
   - **Not run:** the vector store ITs in OpenAI mode, because no embedding 
model was available on the servers used.
   
   _Claude Code on behalf of Croway_
   


-- 
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]

Reply via email to