Skip to content

[Bug]intern模型调用失败(WebChat) #4948

@no-teasy

Description

@no-teasy

What happened / 发生了什么

使用intern模型时会调用失败 包括不限于

  • ModelScope-InternS1-Pro 空回复
  • Intern 报错
    AstrBot 请求失败。
    错误类型: AssertionError
    错误信息:
    
    请在平台日志查看和分享错误详情。
    

使用WebChat无法使用 Aiocq(Onebot11)正常

Reproduce / 如何复现?

Intern免费API https://internlm.intern-ai.org.cn/api
ModelScope API https://www.modelscope.cn/models/Shanghai_AI_Laboratory/Intern-S1-Pro

调用webchat发送信息

AstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器

版本:V14.3
适配器:WebChat

OS

Windows

Logs / 报错日志

Intern官方接口

 [20:18:15] [Core] [DBUG] [pipeline.scheduler:88]: pipeline 执行完毕。   [20:18:35] [Core] [DBUG] [webchat.webchat_adapter:207]: WebChatAdapter: [Plain(type=<ComponentType.Plain: 'Plain'>, text='你是谁', convert=True)]   [20:18:35] [Core] [INFO] [core.event_bus:59]: [default] [webchat(webchat)] astrbot/astrbot: 你是谁    [20:18:35] [Core] [DBUG] [waking_check.stage:157]: enabled_plugins_name: ['*']   [20:18:35] [Core] [DBUG] [method.star_request:44]: plugin -> session_controller - handle_session_control_agent   [20:18:35] [Core] [DBUG] [method.star_request:44]: plugin -> session_controller - handle_empty_mention   [20:18:35] [Core] [DBUG] [agent_sub_stages.internal:150]: ready to request llm provider   [20:18:35] [Core] [DBUG] [agent_sub_stages.internal:155]: acquired session lock for llm request   [20:18:35] [Core] [DBUG] [core.astr_main_agent:423]: Tool set for persona 默认: ['web_search', 'fetch_url', 'web_search_tavily', 'tavily_extract_web_page']   [20:18:35] [Core] [DBUG] [core.astr_main_agent_resources:415]: [知识库] 使用全局配置,知识库数量: 0   [20:18:35] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMRequestEvent) -> astrbot - decorate_llm_req   [20:18:35] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMRequestEvent) -> astrbot-web-searcher - edit_web_search_tools   [20:18:35] [Core] [INFO] [respond.stage:168]: Prepare to send - astrbot/astrbot:    [20:18:35] [Core] [INFO] [respond.stage:184]: 应用流式输出(webchat)   [20:18:35] [Core] [DBUG] [runners.base:64]: Agent state transition: AgentState.IDLE -> AgentState.RUNNING   [20:18:39] [Core] [ERRO] [v4.14.4] [core.astr_agent_run_util:136]: Traceback (most recent call last):
  File "/www/AstrBot/astrbot/core/astr_agent_run_util.py", line 52, in run_agent
    async for resp in agent_runner.step():
  File "/www/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 183, in step
    async for llm_response in self._iter_llm_responses():
  File "/www/AstrBot/astrbot/core/agent/runners/tool_loop_agent_runner.py", line 154, in _iter_llm_responses
    async for resp in stream:  # type: ignore
  File "/www/AstrBot/astrbot/core/provider/sources/openai_source.py", line 576, in text_chat_stream
    ) = await self._handle_api_error(
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/www/AstrBot/astrbot/core/provider/sources/openai_source.py", line 465, in _handle_api_error
    raise e
  File "/www/AstrBot/astrbot/core/provider/sources/openai_source.py", line 564, in text_chat_stream
    async for response in self._query_stream(payloads, func_tool):
  File "/www/AstrBot/astrbot/core/provider/sources/openai_source.py", line 200, in _query_stream
    final_completion = state.get_final_completion()
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/www/AstrBot/astrbot-venv/lib/python3.12/site-packages/openai/lib/streaming/chat/_completions.py", line 334, in get_final_completion
    chat_completion=self.current_completion_snapshot,
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/www/AstrBot/astrbot-venv/lib/python3.12/site-packages/openai/lib/streaming/chat/_completions.py", line 341, in current_completion_snapshot
    assert self.__current_completion_snapshot is not None
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

ModelScope

[20:19:37] [Core] [DBUG] [webchat.webchat_adapter:207]: WebChatAdapter: [Plain(type=<ComponentType.Plain: 'Plain'>, text='你是谁', convert=True)] 
 [20:19:37] [Core] [INFO] [core.event_bus:59]: [default] [webchat(webchat)] astrbot/astrbot: 你是谁  
 [20:19:37] [Core] [DBUG] [waking_check.stage:157]: enabled_plugins_name: ['*'] 
 [20:19:37] [Core] [DBUG] [method.star_request:44]: plugin -> session_controller - handle_session_control_agent 
 [20:19:37] [Core] [DBUG] [method.star_request:44]: plugin -> session_controller - handle_empty_mention 
 [20:19:37] [Core] [DBUG] [agent_sub_stages.internal:150]: ready to request llm provider 
 [20:19:37] [Core] [DBUG] [agent_sub_stages.internal:155]: acquired session lock for llm request 
 [20:19:37] [Core] [DBUG] [core.astr_main_agent:423]: Tool set for persona 默认: ['web_search', 'fetch_url', 'web_search_tavily', 'tavily_extract_web_page'] 
 [20:19:37] [Core] [DBUG] [core.astr_main_agent_resources:415]: [知识库] 使用全局配置,知识库数量: 0 
 [20:19:37] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMRequestEvent) -> astrbot - decorate_llm_req 
 [20:19:37] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMRequestEvent) -> astrbot-web-searcher - edit_web_search_tools 
 [20:19:37] [Core] [INFO] [respond.stage:168]: Prepare to send - astrbot/astrbot:  
 [20:19:37] [Core] [INFO] [respond.stage:184]: 应用流式输出(webchat) 
 [20:19:37] [Core] [DBUG] [runners.base:64]: Agent state transition: AgentState.IDLE -> AgentState.RUNNING 
 [20:19:40] [Core] [DBUG] [runners.base:64]: Agent state transition: AgentState.RUNNING -> AgentState.DONE 
 [20:19:40] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnLLMResponseEvent) -> astrbot - record_llm_resp_to_ltm 
 [20:19:40] [Core] [DBUG] [agent_sub_stages.internal:349]: LLM 响应为空,不保存记录。 
 [20:19:40] [Core] [INFO] [result_decorate.stage:189]: 流式输出已启用,跳过结果装饰阶段 
 [20:19:40] [Core] [DBUG] [pipeline.scheduler:88]: pipeline 执行完毕。 

Are you willing to submit a PR? / 你愿意提交 PR 吗?

  • [√] Yes!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:providerThe bug / feature is about AI Provider, Models, LLM Agent, LLM Agent Runner.bugSomething isn't workingfeature:chatuiThe bug / feature is about astrbot's chatui, webchatplugin-cate:genaiBased on generative AI models such as LLMs or diffusion models.(only startswith [Plugin])priority: p0will fix asap

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions