mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 09:20:22 +08:00
fix: 补充合并后遗漏的 from __future__ import annotations
合并 fix/python314-upgrade 后,部分文件仍使用 Optional/Dict 等旧式类型 但未添加 future annotations 导入,导致运行时 NameError。
This commit is contained in:
@@ -16,6 +16,8 @@ Chat Adapter 通用基类
|
||||
- compute_total_input_context(): 可选覆盖总输入上下文计算(用于阶梯计费判定)
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import time
|
||||
import traceback
|
||||
from abc import abstractmethod
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
payload, headers = builder.build(original_body, original_headers, endpoint, key)
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from abc import ABC, abstractmethod
|
||||
@@ -316,7 +317,7 @@ def build_passthrough_request(
|
||||
async def get_provider_auth(
|
||||
endpoint: "ProviderEndpoint",
|
||||
key: "ProviderAPIKey",
|
||||
) -> Optional[ProviderAuthInfo]:
|
||||
) -> ProviderAuthInfo | None:
|
||||
"""
|
||||
获取 Provider 的认证信息
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ Gemini Chat Adapter
|
||||
处理 Gemini API 格式的请求适配
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
import httpx
|
||||
|
||||
@@ -4,6 +4,8 @@ Gemini Chat Handler
|
||||
处理 Gemini API 格式的请求
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from src.api.handlers.base.chat_handler_base import ChatHandlerBase
|
||||
|
||||
@@ -17,6 +17,8 @@ Gemini Files API 代理端点
|
||||
https://ai.google.dev/api/files
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Dict, Optional, Tuple
|
||||
from urllib.parse import urlencode
|
||||
|
||||
|
||||
Reference in New Issue
Block a user