fix(optional): convert Optional[T] returns to T | None syntax; regen type registry
This commit is contained in:
@@ -30,7 +30,7 @@ Auto-generated from source. 6 struct(s) defined in this module.
|
||||
## `src\openai_schemas.py::OpenAICompatibleRequest`
|
||||
|
||||
**Kind:** `dataclass`
|
||||
**Defined at:** line 120
|
||||
**Defined at:** line 97
|
||||
|
||||
**Fields:**
|
||||
- `messages: list[ChatMessage]`
|
||||
|
||||
@@ -5,7 +5,7 @@ Auto-generated from source. 1 struct(s) defined in this module.
|
||||
## `src\provider_state.py::ProviderHistory`
|
||||
|
||||
**Kind:** `dataclass`
|
||||
**Defined at:** line 26
|
||||
**Defined at:** line 27
|
||||
|
||||
**Fields:**
|
||||
- `messages: list[HistoryMessage]`
|
||||
|
||||
+5
-6
@@ -726,17 +726,16 @@ def _gemini_tool_declaration_result() -> Result[types.Tool]:
|
||||
return Result(data=None, errors=[ErrorInfo(kind=ErrorKind.NOT_FOUND, message="No tool declarations to build", source="ai_client._gemini_tool_declaration_result")])
|
||||
return Result(data=types.Tool(function_declarations=declarations))
|
||||
|
||||
def _gemini_tool_declaration_result_legacy_compat() -> Optional[types.Tool]:
|
||||
def _gemini_tool_declaration_result_legacy_compat() -> types.Tool | None:
|
||||
"""
|
||||
LEGACY: prefer _gemini_tool_declaration_result() (returns Result[types.Tool]).
|
||||
This wrapper is retained for tests that call _gemini_tool_declaration() directly;
|
||||
it returns Optional[types.Tool] for backward compat only.
|
||||
This wrapper is retained for tests that call _gemini_tool_declaration() directly.
|
||||
[C: tests/test_tool_access_exclusion.py:test_gemini_tool_declaration_excludes_disabled]
|
||||
"""
|
||||
r = _gemini_tool_declaration_result()
|
||||
return r.data if r.ok else None
|
||||
|
||||
def _gemini_tool_declaration() -> Optional[types.Tool]:
|
||||
def _gemini_tool_declaration() -> types.Tool | None:
|
||||
"""Backward-compat alias for _gemini_tool_declaration_result_legacy_compat."""
|
||||
return _gemini_tool_declaration_result_legacy_compat()
|
||||
|
||||
@@ -3120,12 +3119,12 @@ def _run_tier4_patch_callback_result(stderr: str, base_dir: str) -> Result[str]:
|
||||
)
|
||||
|
||||
|
||||
def run_tier4_patch_callback_legacy_compat(stderr: str, base_dir: str) -> Optional[str]:
|
||||
def run_tier4_patch_callback_legacy_compat(stderr: str, base_dir: str) -> str | None:
|
||||
"""LEGACY: prefer _run_tier4_patch_callback_result() (returns Result[str])."""
|
||||
r = _run_tier4_patch_callback_result(stderr, base_dir)
|
||||
return r.data if r.ok and r.data else None
|
||||
|
||||
def run_tier4_patch_callback(stderr: str, base_dir: str) -> Optional[str]:
|
||||
def run_tier4_patch_callback(stderr: str, base_dir: str) -> str | None:
|
||||
"""Backward-compat alias for run_tier4_patch_callback_legacy_compat."""
|
||||
return run_tier4_patch_callback_legacy_compat(stderr, base_dir)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user