Commit ·
8e357d9
1
Parent(s): fc56b2e
2.5 flash lite support and bug fixes
Browse files- app/api_helpers.py +1 -1
- app/routes/chat_api.py +5 -0
app/api_helpers.py
CHANGED
|
@@ -130,7 +130,7 @@ def create_generation_config(request: OpenAIRequest) -> Dict[str, Any]:
|
|
| 130 |
types.SafetySetting(category="HARM_CATEGORY_HARASSMENT", threshold="OFF"),
|
| 131 |
types.SafetySetting(category="HARM_CATEGORY_CIVIC_INTEGRITY", threshold="OFF")
|
| 132 |
]
|
| 133 |
-
config["thinking_config"] = {"include_thoughts": True}
|
| 134 |
|
| 135 |
# 1. Add tools (function declarations)
|
| 136 |
function_declarations = []
|
|
|
|
| 130 |
types.SafetySetting(category="HARM_CATEGORY_HARASSMENT", threshold="OFF"),
|
| 131 |
types.SafetySetting(category="HARM_CATEGORY_CIVIC_INTEGRITY", threshold="OFF")
|
| 132 |
]
|
| 133 |
+
# config["thinking_config"] = {"include_thoughts": True}
|
| 134 |
|
| 135 |
# 1. Add tools (function declarations)
|
| 136 |
function_declarations = []
|
app/routes/chat_api.py
CHANGED
|
@@ -97,6 +97,11 @@ async def chat_completions(fastapi_request: Request, request: OpenAIRequest, api
|
|
| 97 |
# This will now be a dictionary
|
| 98 |
gen_config_dict = create_generation_config(request)
|
| 99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
if "gemini-2.5-flash-lite" in base_model_name:
|
| 101 |
gen_config_dict["thinking_config"]["include_thoughts"] = False
|
| 102 |
|
|
|
|
| 97 |
# This will now be a dictionary
|
| 98 |
gen_config_dict = create_generation_config(request)
|
| 99 |
|
| 100 |
+
if "gemini-2.5-flash" in base_model_name or "gemini-2.5-pro" in base_model_name:
|
| 101 |
+
if "thinking_config" not in gen_config_dict:
|
| 102 |
+
gen_config_dict["thinking_config"] = {}
|
| 103 |
+
gen_config_dict["thinking_config"]["include_thoughts"] = True
|
| 104 |
+
|
| 105 |
if "gemini-2.5-flash-lite" in base_model_name:
|
| 106 |
gen_config_dict["thinking_config"]["include_thoughts"] = False
|
| 107 |
|