mirror of
https://github.com/Nezumi-2711/astrbot_plugin_qq_group_daily_analysis.git
synced 2026-09-22 13:38:43 +00:00
[fix] (llm_analyzer) 修正确保使用当前 Provider
This commit is contained in:
@@ -78,7 +78,11 @@ class LLMAnalyzer:
|
||||
raw_completion = response_json
|
||||
return CustomResponse()
|
||||
else:
|
||||
logger.info(f"使用默认LLM provider: {provider}")
|
||||
# 确保使用当前指定的模型
|
||||
if provider is None:
|
||||
provider = self.context.get_using_provider()
|
||||
|
||||
logger.info(f"使用LLM provider: {provider}")
|
||||
coro = provider.text_chat(prompt=prompt, max_tokens=max_tokens, temperature=temperature)
|
||||
return await asyncio.wait_for(coro, timeout=timeout)
|
||||
except asyncio.TimeoutError as e:
|
||||
|
||||
+8
-16
@@ -24,29 +24,21 @@ class BotManager:
|
||||
"""设置bot实例"""
|
||||
if bot_instance:
|
||||
self._bot_instance = bot_instance
|
||||
try:
|
||||
logger.info(f"Bot实例已设置: {type(bot_instance).__name__}")
|
||||
except ImportError:
|
||||
print(f"Bot实例已设置: {type(bot_instance).__name__}")
|
||||
|
||||
logger.info(f"Bot实例已设置: {type(bot_instance).__name__}")
|
||||
else:
|
||||
try:
|
||||
logger.warning("尝试设置空的bot实例")
|
||||
except ImportError:
|
||||
print("尝试设置空的bot实例")
|
||||
logger.warning("尝试设置空的bot实例")
|
||||
|
||||
|
||||
def set_bot_qq_id(self, bot_qq_id: str):
|
||||
"""设置bot QQ号"""
|
||||
if bot_qq_id:
|
||||
self._bot_qq_id = str(bot_qq_id)
|
||||
try:
|
||||
logger.info(f"Bot QQ号已设置: {self._bot_qq_id}")
|
||||
except ImportError:
|
||||
print(f"Bot QQ号已设置: {self._bot_qq_id}")
|
||||
logger.info(f"Bot QQ号已设置: {self._bot_qq_id}")
|
||||
|
||||
else:
|
||||
try:
|
||||
logger.warning("尝试设置空的bot QQ号")
|
||||
except ImportError:
|
||||
print("尝试设置空的bot QQ号")
|
||||
logger.warning("尝试设置空的bot QQ号")
|
||||
|
||||
|
||||
def get_bot_instance(self):
|
||||
"""获取当前bot实例"""
|
||||
|
||||
Reference in New Issue
Block a user