ragflow/rag/llm
Philipp Heyken Soares 1c06ec39ca
fix cohere rerank base_url default (#11353)
### What problem does this PR solve?

**Cohere rerank base_url default handling**

- Background: When no rerank base URL is configured, the settings
pipeline was passing an empty string through RERANK_CFG →
TenantLLMService → CoHereRerank, so the Cohere client received
base_url="" and produced “missing protocol” errors during rerank calls.

- What changed: The CoHereRerank constructor now only forwards base_url
to the Cohere client when it isn’t empty/whitespace, causing the client
to fall back to its default API endpoint otherwise.

- Why it matters: This prevents invalid URL construction in the rerank
workflow and keeps tests/sanity checks that rely on the default Cohere
endpoint from failing when no custom base URL is specified.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

Co-authored-by: Philipp Heyken Soares <philipp.heyken-soares@am.ai>
2025-11-20 09:46:39 +08:00
..
__init__.py feat: add new LLM provider Jiekou.AI (#11300) 2025-11-17 19:47:46 +08:00
chat_model.py feat: add new LLM provider Jiekou.AI (#11300) 2025-11-17 19:47:46 +08:00
cv_model.py Feat: add Gemini 3 Pro preview (#11361) 2025-11-19 13:17:22 +08:00
embedding_model.py feat: add new LLM provider Jiekou.AI (#11300) 2025-11-17 19:47:46 +08:00
rerank_model.py fix cohere rerank base_url default (#11353) 2025-11-20 09:46:39 +08:00
sequence2txt_model.py Move token related functions to common (#10942) 2025-11-03 08:50:05 +08:00
tts_model.py Move token related functions to common (#10942) 2025-11-03 08:50:05 +08:00