mirror of
https://github.com/Nezumi-2711/astrbot_plugin_qq_group_daily_analysis.git
synced 2026-09-22 13:38:43 +00:00
[docs] (llm_analyzer) _call_provider_with_retry 说明
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
sourcery-ai[bot]
parent
de12e8253a
commit
5d4f517401
@@ -20,7 +20,21 @@ class LLMAnalyzer:
|
|||||||
self.config_manager = config_manager
|
self.config_manager = config_manager
|
||||||
|
|
||||||
async def _call_provider_with_retry(self, provider, prompt: str, max_tokens: int, temperature: float, umo: str = None):
|
async def _call_provider_with_retry(self, provider, prompt: str, max_tokens: int, temperature: float, umo: str = None):
|
||||||
"""调用LLM提供者,带超时、重试与退避。支持自定义服务商。"""
|
"""
|
||||||
|
调用LLM提供者,带超时、重试与退避。支持自定义服务商。
|
||||||
|
|
||||||
|
Args:
|
||||||
|
provider: LLM服务商实例或None。
|
||||||
|
prompt (str): 输入的提示语。
|
||||||
|
max_tokens (int): 最大生成token数。
|
||||||
|
temperature (float): 采样温度。
|
||||||
|
umo (str, optional): 指定使用的模型唯一标识符(Unique Model Object),
|
||||||
|
用于选择特定的LLM服务商或模型。格式通常为字符串,例如 "gpt-3.5-turbo"。
|
||||||
|
如果为None,则使用默认模型。
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
LLM生成的结果。
|
||||||
|
"""
|
||||||
timeout = self.config_manager.get_llm_timeout()
|
timeout = self.config_manager.get_llm_timeout()
|
||||||
retries = self.config_manager.get_llm_retries()
|
retries = self.config_manager.get_llm_retries()
|
||||||
backoff = self.config_manager.get_llm_backoff()
|
backoff = self.config_manager.get_llm_backoff()
|
||||||
|
|||||||
Reference in New Issue
Block a user