xidu commited on
Commit
c9b006a
·
verified ·
1 Parent(s): 5aa2fed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -31,7 +31,7 @@ GEMINI_MODELS = {
31
  "gemini-2.5-flash-preview-05-20": "gemini-2.5-flash-preview-05-20",
32
  "gemini-2.5-flash": "gemini-2.5-flash",
33
  "gemini-2.5-flash-preview-04-17": "gemini-2.5-flash-preview-04-17",
34
- "gemini-2.5-pro": "gemini-2.5-pro",
35
  }
36
 
37
  # 支持的模型列表
@@ -81,6 +81,7 @@ SUPPORTED_MODELS = [
81
 
82
  def get_model_name(requested_model: str) -> str:
83
  """获取实际的Gemini模型名称"""
 
84
  return GEMINI_MODELS.get(requested_model, "gemini-2.5-flash")
85
 
86
 
@@ -263,7 +264,6 @@ async def chat_completions(request: Request):
263
  temperature = body.get('temperature', 1.2)
264
  top_p = body.get('top_p', 0.0)
265
  requested_model = body.get('model', 'gemini-2.5-flash')
266
-
267
  model_name = get_model_name(requested_model)
268
  content_parts, system_instruction = convert_messages(messages)
269
 
 
31
  "gemini-2.5-flash-preview-05-20": "gemini-2.5-flash-preview-05-20",
32
  "gemini-2.5-flash": "gemini-2.5-flash",
33
  "gemini-2.5-flash-preview-04-17": "gemini-2.5-flash-preview-04-17",
34
+ "gemini-2.5-pro": "gemini-2.5-pro"
35
  }
36
 
37
  # 支持的模型列表
 
81
 
82
  def get_model_name(requested_model: str) -> str:
83
  """获取实际的Gemini模型名称"""
84
+ print("实际模型名称:{GEMINI_MODELS.get(requested_model, "gemini-2.5-flash")}")
85
  return GEMINI_MODELS.get(requested_model, "gemini-2.5-flash")
86
 
87
 
 
264
  temperature = body.get('temperature', 1.2)
265
  top_p = body.get('top_p', 0.0)
266
  requested_model = body.get('model', 'gemini-2.5-flash')
 
267
  model_name = get_model_name(requested_model)
268
  content_parts, system_instruction = convert_messages(messages)
269