feat(models): support doubao-seed-2.1 series

This commit is contained in:
zhayujie
2026-06-25 11:53:24 +08:00
parent 5c67e970d1
commit 7047b30e27
21 changed files with 42 additions and 37 deletions

View File

@@ -9,6 +9,7 @@ from models.bot import Bot
from models.session_manager import SessionManager
from bridge.context import ContextType
from bridge.reply import Reply, ReplyType
from common import const
from common.log import logger
from config import conf, load_config
from .doubao_session import DoubaoSession
@@ -18,8 +19,8 @@ from .doubao_session import DoubaoSession
class DoubaoBot(Bot):
def __init__(self):
super().__init__()
self.sessions = SessionManager(DoubaoSession, model=conf().get("model") or "doubao-seed-2-0-pro-260215")
model = conf().get("model") or "doubao-seed-2-0-pro-260215"
self.sessions = SessionManager(DoubaoSession, model=conf().get("model") or const.DOUBAO_SEED_2_1_PRO)
model = conf().get("model") or const.DOUBAO_SEED_2_1_PRO
self.args = {
"model": model,
"temperature": conf().get("temperature", 0.8),
@@ -153,7 +154,7 @@ class DoubaoBot(Bot):
max_tokens: int = 1000) -> dict:
"""Analyze an image using Doubao (Volcengine Ark) OpenAI-compatible API."""
try:
vision_model = model or self.args.get("model", "doubao-seed-2-0-pro-260215")
vision_model = model or self.args.get("model", const.DOUBAO_SEED_2_1_PRO)
payload = {
"model": vision_model,
"max_tokens": max_tokens,

View File

@@ -1,9 +1,10 @@
from models.session_manager import Session
from common import const
from common.log import logger
class DoubaoSession(Session):
def __init__(self, session_id, system_prompt=None, model="doubao-seed-2-0-pro-260215"):
def __init__(self, session_id, system_prompt=None, model=const.DOUBAO_SEED_2_1_PRO):
super().__init__(session_id, system_prompt)
self.model = model
self.reset()