fix: 补充合并后遗漏的 from __future__ import annotations

合并 fix/python314-upgrade 后,部分文件仍使用 Optional/Dict 等旧式类型
但未添加 future annotations 导入,导致运行时 NameError。
This commit is contained in:
fawney19
2026-01-30 13:01:50 +08:00
parent cd1b103223
commit 041a61f89c
9 changed files with 19 additions and 2 deletions

View File

@@ -2,6 +2,8 @@
ProviderEndpoint 相关的 API 模型定义
"""
from __future__ import annotations
import re
from datetime import datetime
from typing import Any, Literal
@@ -171,7 +173,7 @@ class EndpointAPIKeyCreate(BaseModel):
default="api_key",
description="认证类型api_key标准 API Key或 vertex_aiVertex AI Service Account"
)
auth_config: Optional[Dict[str, Any]] = Field(
auth_config: dict[str, Any] | None = Field(
default=None,
description="认证配置JSONvertex_ai 时存储完整 Service Account JSON"
)

View File

@@ -5,6 +5,8 @@ Google Gemini API 请求/响应模型
作为 API 网关,采用宽松类型定义以支持 API 新特性透传
"""
from __future__ import annotations
from typing import Any
from pydantic import BaseModel, ConfigDict, Field