新增 Gemini 模型配置及初始化逻辑,更新配置文件以支持 Gemini 的 API 密钥和历史消息数设置,同时优化 ChatType 枚举以包含 Gemini 类型,提升代码的可扩展性和灵活性。

This commit is contained in:
Zylan
2025-04-24 18:27:19 +08:00
parent da9e387b10
commit cc2922c2f3
6 changed files with 308 additions and 3 deletions

View File

@@ -6,13 +6,15 @@ class ChatType(IntEnum):
# UnKnown = 0 # 未知, 即未设置
CHATGPT = 1 # ChatGPT
DEEPSEEK = 2 # DeepSeek
PERPLEXITY = 3 # Perplexity
GEMINI = 3 # Gemini
PERPLEXITY = 4 # Perplexity
@staticmethod
def is_in_chat_types(chat_type: int) -> bool:
if chat_type in [ChatType.CHATGPT.value,
ChatType.DEEPSEEK.value,
ChatType.PERPLEXITY.value]:
ChatType.PERPLEXITY.value,
ChatType.GEMINI.value]:
return True
return False