瀏覽代碼

update gemini model

master
6vision 4 月之前
父節點
當前提交
87525bb383
共有 2 個檔案被更改,包括 8 行新增3 行删除
  1. +2
    -0
      bot/gemini/google_gemini_bot.py
  2. +6
    -3
      common/const.py

+ 2
- 0
bot/gemini/google_gemini_bot.py 查看文件

@@ -25,6 +25,8 @@ class GoogleGeminiBot(Bot):
# 复用文心的token计算方式 # 复用文心的token计算方式
self.sessions = SessionManager(BaiduWenxinSession, model=conf().get("model") or "gpt-3.5-turbo") self.sessions = SessionManager(BaiduWenxinSession, model=conf().get("model") or "gpt-3.5-turbo")
self.model = conf().get("model") or "gemini-pro" self.model = conf().get("model") or "gemini-pro"
if self.model == "gemini":
self.model = "gemini-pro"
def reply(self, query, context: Context = None) -> Reply: def reply(self, query, context: Context = None) -> Reply:
try: try:
if context.type != ContextType.TEXT: if context.type != ContextType.TEXT:


+ 6
- 3
common/const.py 查看文件

@@ -11,7 +11,7 @@ QWEN = "qwen" # 旧版通义模型
QWEN_DASHSCOPE = "dashscope" # 通义新版sdk和api key QWEN_DASHSCOPE = "dashscope" # 通义新版sdk和api key




GEMINI = "gemini"
GEMINI = "gemini" # gemini-1.0-pro
ZHIPU_AI = "glm-4" ZHIPU_AI = "glm-4"
MOONSHOT = "moonshot" MOONSHOT = "moonshot"
MiniMax = "minimax" MiniMax = "minimax"
@@ -51,16 +51,19 @@ LINKAI_35 = "linkai-3.5"
LINKAI_4_TURBO = "linkai-4-turbo" LINKAI_4_TURBO = "linkai-4-turbo"
LINKAI_4o = "linkai-4o" LINKAI_4o = "linkai-4o"


GEMINI_PRO = "gemini-1.0-pro"
GEMINI_15_flash = "gemini-1.5-flash"
GEMINI_15_PRO = "gemini-1.5-pro"


MODEL_LIST = [ MODEL_LIST = [
GPT35, GPT35_0125, GPT35_1106, "gpt-3.5-turbo-16k", GPT35, GPT35_0125, GPT35_1106, "gpt-3.5-turbo-16k",
GPT_4o, GPT4_TURBO, GPT4_TURBO_PREVIEW, GPT4_TURBO_01_25, GPT4_TURBO_11_06, GPT4, GPT4_32k, GPT4_06_13, GPT4_32k_06_13, GPT_4o, GPT4_TURBO, GPT4_TURBO_PREVIEW, GPT4_TURBO_01_25, GPT4_TURBO_11_06, GPT4, GPT4_32k, GPT4_06_13, GPT4_32k_06_13,
WEN_XIN, WEN_XIN_4, WEN_XIN, WEN_XIN_4,
XUNFEI, GEMINI, ZHIPU_AI, MOONSHOT,
XUNFEI, ZHIPU_AI, MOONSHOT, MiniMax,
GEMINI, GEMINI_PRO, GEMINI_15_flash, GEMINI_15_PRO,
"claude", "claude-3-haiku", "claude-3-sonnet", "claude-3-opus", "claude-3-opus-20240229", "claude", "claude-3-haiku", "claude-3-sonnet", "claude-3-opus", "claude-3-opus-20240229",
"moonshot-v1-8k", "moonshot-v1-32k", "moonshot-v1-128k", "moonshot-v1-8k", "moonshot-v1-32k", "moonshot-v1-128k",
QWEN, QWEN_TURBO, QWEN_PLUS, QWEN_MAX, QWEN, QWEN_TURBO, QWEN_PLUS, QWEN_MAX,
MiniMax,
LINKAI_35, LINKAI_4_TURBO, LINKAI_4o LINKAI_35, LINKAI_4_TURBO, LINKAI_4o
] ]




Loading…
取消
儲存