From 3fc29a6327dc8e9ee3928dbb185a066df4007332 Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Sat, 11 Apr 2026 20:43:23 +0800 Subject: [PATCH] fix(provider): add missing ClassVar import in gemini_source ClassVar was used but not imported, causing all Gemini provider adapters to fail loading with NameError. --- astrbot/core/provider/sources/gemini_source.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/astrbot/core/provider/sources/gemini_source.py b/astrbot/core/provider/sources/gemini_source.py index e6c66bb09..5e5bd8449 100644 --- a/astrbot/core/provider/sources/gemini_source.py +++ b/astrbot/core/provider/sources/gemini_source.py @@ -6,7 +6,7 @@ import random import uuid from collections.abc import AsyncGenerator from pathlib import Path -from typing import Literal +from typing import ClassVar, Literal from urllib.parse import urlparse import aiofiles @@ -22,11 +22,11 @@ from astrbot.core.exceptions import EmptyModelOutputError from astrbot.core.message.message_event_result import MessageChain from astrbot.core.provider.entities import LLMResponse, TokenUsage from astrbot.core.provider.func_tool_manager import ToolSet +from astrbot.core.provider.register import register_provider_adapter from astrbot.core.utils.astrbot_path import get_astrbot_temp_path from astrbot.core.utils.io import download_file, download_image_by_url from astrbot.core.utils.media_utils import ensure_wav from astrbot.core.utils.network_utils import is_connection_error, log_connection_failure -from astrbot.core.provider.register import register_provider_adapter class SuppressNonTextPartsWarning(logging.Filter):