xidu commited on
Commit
c56758c
·
verified ·
1 Parent(s): c6b0f55

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -1
app.py CHANGED
@@ -25,12 +25,15 @@ logging.basicConfig(
25
  )
26
  logger = logging.getLogger(__name__)
27
 
 
 
28
  # 模型配置
29
  GEMINI_MODELS = {
30
  "gemini-2.0-flash-exp": "gemini-2.0-flash-exp",
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
  }
35
 
36
  # 支持的模型列表
@@ -64,15 +67,27 @@ SUPPORTED_MODELS = [
64
  "root": "gemini-2.5-flash",
65
  "parent": None,
66
  "description": "gemini-2.5-flash稳定经典专业模型"
 
 
 
 
 
 
 
 
 
 
67
  }
68
  ]
69
 
70
 
71
  def get_model_name(requested_model: str) -> str:
72
  """获取实际的Gemini模型名称"""
 
73
  return GEMINI_MODELS.get(requested_model, "gemini-2.5-flash")
74
 
75
 
 
76
  def convert_messages(messages):
77
  content_parts = []
78
  system_instruction = None
 
25
  )
26
  logger = logging.getLogger(__name__)
27
 
28
+ # 模型配置
29
+
30
  # 模型配置
31
  GEMINI_MODELS = {
32
  "gemini-2.0-flash-exp": "gemini-2.0-flash-exp",
33
  "gemini-2.5-flash-preview-05-20": "gemini-2.5-flash-preview-05-20",
34
  "gemini-2.5-flash": "gemini-2.5-flash",
35
+ "gemini-2.5-flash-preview-04-17": "gemini-2.5-flash-preview-04-17",
36
+ "gemini-2.5-pro": "gemini-2.5-pro"
37
  }
38
 
39
  # 支持的模型列表
 
67
  "root": "gemini-2.5-flash",
68
  "parent": None,
69
  "description": "gemini-2.5-flash稳定经典专业模型"
70
+ },
71
+ {
72
+ "id": "gemini-2.5-pro",
73
+ "object": "model",
74
+ "created": int(time.time()),
75
+ "owned_by": "google",
76
+ "permission": [],
77
+ "root": "gemini-2.5-pro",
78
+ "parent": None,
79
+ "description": "gemini-2.5-pro稳定经典专业模型"
80
  }
81
  ]
82
 
83
 
84
  def get_model_name(requested_model: str) -> str:
85
  """获取实际的Gemini模型名称"""
86
+ print(f"实际模型名称:{GEMINI_MODELS.get(requested_model)}")
87
  return GEMINI_MODELS.get(requested_model, "gemini-2.5-flash")
88
 
89
 
90
+
91
  def convert_messages(messages):
92
  content_parts = []
93
  system_instruction = None