pouluo commited on
Commit
8c6bcef
·
1 Parent(s): 3cf7437

fix: thinking mode was hardcoded to always-on for all models

Browse files
Files changed (1) hide show
  1. gemini_web2api.py +10 -8
gemini_web2api.py CHANGED
@@ -74,29 +74,30 @@ MODEL_HEADER_KEY = "x-goog-ext-525001261-jspb"
74
 
75
  GEMINI_MODELS = {
76
  # Internal model name → routing info
 
77
  "gemini-3-pro": {
78
- "id": "9d8ca3786ebdfbea", "capacity": 1,
79
  "desc": "Pro model (free tier)",
80
  },
81
  "gemini-3-flash": {
82
- "id": "fbb127bbb056c959", "capacity": 1,
83
  "desc": "Fast general-purpose model",
84
  },
85
  "gemini-3-flash-thinking": {
86
- "id": "5bf011840784117a", "capacity": 1,
87
  "desc": "Deep thinking mode",
88
  },
89
  # Pro-only (paid tier) models
90
  "gemini-3-pro-plus": {
91
- "id": "e6fa609c3fa255c0", "capacity": 4,
92
  "desc": "Pro+ model (requires subscription)",
93
  },
94
  "gemini-3-flash-plus": {
95
- "id": "56fdd199312815e2", "capacity": 4,
96
  "desc": "Flash+ model (requires subscription)",
97
  },
98
  "gemini-3-flash-thinking-plus": {
99
- "id": "e051ce1aa80aa576", "capacity": 4,
100
  "desc": "Thinking+ model (requires subscription)",
101
  },
102
  }
@@ -391,8 +392,9 @@ def gemini_stream_generate(prompt: str, model_info: dict) -> str:
391
  inner[10] = 1
392
  inner[11] = 0
393
  # Think mode: 0 = thinking enabled, 4 = thinking disabled
394
- # For thinking models, we enable thinking; for others, disable
395
- inner[17] = [[0]] # Default: thinking enabled
 
396
  inner[18] = 0
397
  inner[27] = 1
398
  inner[30] = [4]
 
74
 
75
  GEMINI_MODELS = {
76
  # Internal model name → routing info
77
+ # think: 0 = thinking enabled (for thinking models), 4 = thinking disabled (for standard models)
78
  "gemini-3-pro": {
79
+ "id": "9d8ca3786ebdfbea", "capacity": 1, "think": 4,
80
  "desc": "Pro model (free tier)",
81
  },
82
  "gemini-3-flash": {
83
+ "id": "fbb127bbb056c959", "capacity": 1, "think": 4,
84
  "desc": "Fast general-purpose model",
85
  },
86
  "gemini-3-flash-thinking": {
87
+ "id": "5bf011840784117a", "capacity": 1, "think": 0,
88
  "desc": "Deep thinking mode",
89
  },
90
  # Pro-only (paid tier) models
91
  "gemini-3-pro-plus": {
92
+ "id": "e6fa609c3fa255c0", "capacity": 4, "think": 4,
93
  "desc": "Pro+ model (requires subscription)",
94
  },
95
  "gemini-3-flash-plus": {
96
+ "id": "56fdd199312815e2", "capacity": 4, "think": 4,
97
  "desc": "Flash+ model (requires subscription)",
98
  },
99
  "gemini-3-flash-thinking-plus": {
100
+ "id": "e051ce1aa80aa576", "capacity": 4, "think": 0,
101
  "desc": "Thinking+ model (requires subscription)",
102
  },
103
  }
 
392
  inner[10] = 1
393
  inner[11] = 0
394
  # Think mode: 0 = thinking enabled, 4 = thinking disabled
395
+ # Each model carries its own think value
396
+ think_mode = model_info.get("think", 4)
397
+ inner[17] = [[think_mode]]
398
  inner[18] = 0
399
  inner[27] = 1
400
  inner[30] = [4]