File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 569569 "dangerous_content" : "BLOCK_MEDIUM_AND_ABOVE" ,
570570 },
571571 "gm_thinking_config" : {
572- "enable" : False ,
573572 "budget" : 0 ,
574573 },
575574 },
809808 "description" : "Gemini思考设置" ,
810809 "type" : "object" ,
811810 "items" : {
812- "enable" : {
813- "description" : "启用思考" ,
814- "type" : "bool" ,
815- "hint" : "启用后,模型将在可用时输出思考过程" ,
816- },
817811 "budget" : {
818812 "description" : "思考预算" ,
819813 "type" : "int" ,
820- "hint" : "模型应该生成的思考Token的数量" ,
814+ "hint" : "模型应该生成的思考Token的数量,设为0关闭思考。除gemini-2.5-flash外的模型会静默忽略此参数。 " ,
821815 },
822816 },
823817 },
Original file line number Diff line number Diff line change @@ -179,13 +179,17 @@ async def _prepare_query_config(
179179 tools = tool_list ,
180180 safety_settings = self .safety_settings if self .safety_settings else None ,
181181 thinking_config = types .ThinkingConfig (
182- include_thoughts = self .provider_config .get ("gm_thinking_config" , {}).get (
183- "enable" , False
184- ),
185- thinking_budget = self .provider_config .get ("gm_thinking_config" , {}).get (
186- "budget" , 0
182+ thinking_budget = min (
183+ int (
184+ self .provider_config .get ("gm_thinking_config" , {}).get (
185+ "budget" , 0
186+ )
187+ ),
188+ 24576 ,
187189 ),
188- ),
190+ )
191+ if "gemini-2.5-flash" in self .get_model ()
192+ else None ,
189193 automatic_function_calling = types .AutomaticFunctionCallingConfig (
190194 disable = True
191195 ),
You can’t perform that action at this time.
0 commit comments