Skip to content

Fix: Disable reasoning on Gemini 2.5 Flash by default - #10477

Merged
KevinHuSh merged 6 commits into
infiniflow:mainfrom
glu000:fix--10474
Oct 11, 2025
Merged

KevinHuSh merged 6 commits into
infiniflow:mainfrom
glu000:fix--10474

Conversation

@glu000

@glu000 glu000 commented Oct 10, 2025 •

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Gemini 2.5 Flash Models use reasoning by default. There is currently no way to disable this behaviour. This leads to very long response times (> 1min). The default behaviour should be, that reasoning is disabled and configurable

issue #10474

Type of change

  • Bug Fix (non-breaking change which fixes an issue)

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. 🐞 bug Something isn't working, pull request that fix bug. labels Oct 10, 2025
@KevinHuSh KevinHuSh added the ci Continue Integration label Oct 11, 2025
@yingfeng yingfeng changed the title Fix 10474 Fix: Disable reasoning on Gemini 2.5 Flash by default Oct 11, 2025
@KevinHuSh
KevinHuSh merged commit fee757e into infiniflow:main Oct 11, 2025
@KevinHuSh KevinHuSh mentioned this pull request Oct 11, 2025
1 task done
glu000 added a commit to glu000/ragflow that referenced this pull request Oct 11, 2025
…nai SDK

This PR migrates the Gemini/Vertex AI integration from the deprecated
vertexai.generative_models API to the new unified google-genai SDK,
building upon PR infiniflow#10477 which added ThinkingConfig support.

Why this migration is necessary:
- The vertexai.generative_models API is being phased out
- The new google-genai SDK provides unified access to Vertex AI and AI Studio
- Better support for new features like ThinkingConfig
- Type-safe message handling with Content/Part objects

Key changes:
1. Client initialization migrated to genai.Client(vertexai=True, ...)
2. Messages converted to Content objects with Part arrays (fixes Pydantic validation)
3. Configuration handled via GenerateContentConfig instead of dict parameters
4. Streaming uses explicit generate_content_stream() method
5. ThinkingConfig integrated into GenerateContentConfig (replaces _get_thinking_config)

Dependencies updated:
- vertexai: 1.64.0 → 1.70.0 (required for compatibility)
- google-genai: Added >=1.41.0,<2.0.0 (new unified SDK)

Supersedes the old _get_thinking_config() approach from PR infiniflow#10477 with
the new SDK's native ThinkingConfig support, maintaining the same
default behavior (thinking_budget=0 disabled by default).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
yngvarhuang pushed a commit to yngvarhuang/ragflow that referenced this pull request Oct 13, 2025
* main: (36 commits)
  Feat: Merge title splitter and token splitter into chunker category infiniflow#9869 (infiniflow#10517)
  Fix: Optimized the login page and fixed some known issues. infiniflow#9869 (infiniflow#10514)
  Fix: The Context Generator(Transformer) node can only be followed by a Tokenizer(Indexer) and a Context Generator(Transformer). infiniflow#9869 (infiniflow#10515)
  Fix: Update lm studio models support, refer to infiniflow#8116 (infiniflow#10509)
  Feat: add trino support (infiniflow#10512)
  Fix: maintain backward compatibility for KB tasks (infiniflow#10508)
  fix: decode before format to json (infiniflow#10506)
  Feat: Modify the background color of the canvas infiniflow#9869 (infiniflow#10507)
  Fix: Mcp reset error, infiniflow#10497 (infiniflow#10498)
  Feat: ​​OpenSearch's support for newly embedding models​​ (infiniflow#10494)
  Fix: remove lang for autio. (infiniflow#10496)
  Fix: incorrect agent template infiniflow#10393 (infiniflow#10491)
  Feat: add support for multi-column PDF parsing (infiniflow#10475)
  Fix: Added table of contents extraction functionality and optimized form item layout infiniflow#9869 (infiniflow#10492)
  Feat: Modify the default style of the agent node anchor infiniflow#9869 (infiniflow#10489)
  Feat: debugging toc part. (infiniflow#10486)
  Feat:  include author, journal name, volume, issue, page, and DOI in PubMed search results (infiniflow#10481)
  feat(login): Refactor the login page and add dynamic background and highlight effects infiniflow#9869 (infiniflow#10482)
  Fix: Fixed the issue where the connection lines of placeholder nodes in the agent canvas could not be displayed infiniflow#9869 (infiniflow#10485)
  Fix: Disable reasoning on Gemini 2.5 Flash by default (infiniflow#10477)
  ...
KevinHuSh pushed a commit that referenced this pull request Oct 15, 2025
…dditional fix to issue #10474 (#10502)

### What problem does this PR solve?

Issue #10474  -  Update to PR #10477 

### Type of change

- [X] Bug Fix (non-breaking change which fixes an issue)
clifftseng pushed a commit to clifftseng/ragflow that referenced this pull request Feb 9, 2026
### What problem does this PR solve?

Gemini 2.5 Flash Models use reasoning by default. There is currently no
way to disable this behaviour. This leads to very long response times (>
1min). The default behaviour should be, that reasoning is disabled and
configurable

issue infiniflow#10474 

### Type of change

- [X] Bug Fix (non-breaking change which fixes an issue)
clifftseng pushed a commit to clifftseng/ragflow that referenced this pull request Feb 9, 2026
…dditional fix to issue infiniflow#10474 (infiniflow#10502)

### What problem does this PR solve?

Issue infiniflow#10474  -  Update to PR infiniflow#10477 

### Type of change

- [X] Bug Fix (non-breaking change which fixes an issue)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants