mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-03-18 12:40:06 +08:00
Merge pull request #2692 from 6vision/master
update:Adjust bot_type resolution priority in Agent mode
This commit is contained in:
@@ -97,11 +97,14 @@ class AgentLLMModel(LLMModel):
|
|||||||
def _resolve_bot_type(self, model_name: str) -> str:
|
def _resolve_bot_type(self, model_name: str) -> str:
|
||||||
"""Resolve bot type from model name, matching Bridge.__init__ logic."""
|
"""Resolve bot type from model name, matching Bridge.__init__ logic."""
|
||||||
from config import conf
|
from config import conf
|
||||||
|
|
||||||
|
if conf().get("use_linkai", False) and conf().get("linkai_api_key"):
|
||||||
|
return const.LINKAI
|
||||||
|
# Support custom bot type configuration
|
||||||
configured_bot_type = conf().get("bot_type")
|
configured_bot_type = conf().get("bot_type")
|
||||||
if configured_bot_type:
|
if configured_bot_type:
|
||||||
return configured_bot_type
|
return configured_bot_type
|
||||||
if conf().get("use_linkai", False) and conf().get("linkai_api_key"):
|
|
||||||
return const.LINKAI
|
|
||||||
if not model_name or not isinstance(model_name, str):
|
if not model_name or not isinstance(model_name, str):
|
||||||
return const.CHATGPT
|
return const.CHATGPT
|
||||||
if model_name in self._MODEL_BOT_TYPE_MAP:
|
if model_name in self._MODEL_BOT_TYPE_MAP:
|
||||||
|
|||||||
Reference in New Issue
Block a user