Private
Public Access
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`
|
## `src\openai_schemas.py::OpenAICompatibleRequest`
|
||||||
|
|
||||||
**Kind:** `dataclass`
|
**Kind:** `dataclass`
|
||||||
**Defined at:** line 120
|
**Defined at:** line 97
|
||||||
|
|
||||||
**Fields:**
|
**Fields:**
|
||||||
- `messages: list[ChatMessage]`
|
- `messages: list[ChatMessage]`
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Auto-generated from source. 1 struct(s) defined in this module.
|
|||||||
## `src\provider_state.py::ProviderHistory`
|
## `src\provider_state.py::ProviderHistory`
|
||||||
|
|
||||||
**Kind:** `dataclass`
|
**Kind:** `dataclass`
|
||||||
**Defined at:** line 26
|
**Defined at:** line 27
|
||||||
|
|
||||||
**Fields:**
|
**Fields:**
|
||||||
- `messages: list[HistoryMessage]`
|
- `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=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))
|
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]).
|
LEGACY: prefer _gemini_tool_declaration_result() (returns Result[types.Tool]).
|
||||||
This wrapper is retained for tests that call _gemini_tool_declaration() directly;
|
This wrapper is retained for tests that call _gemini_tool_declaration() directly.
|
||||||
it returns Optional[types.Tool] for backward compat only.
|
|
||||||
[C: tests/test_tool_access_exclusion.py:test_gemini_tool_declaration_excludes_disabled]
|
[C: tests/test_tool_access_exclusion.py:test_gemini_tool_declaration_excludes_disabled]
|
||||||
"""
|
"""
|
||||||
r = _gemini_tool_declaration_result()
|
r = _gemini_tool_declaration_result()
|
||||||
return r.data if r.ok else None
|
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."""
|
"""Backward-compat alias for _gemini_tool_declaration_result_legacy_compat."""
|
||||||
return _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])."""
|
"""LEGACY: prefer _run_tier4_patch_callback_result() (returns Result[str])."""
|
||||||
r = _run_tier4_patch_callback_result(stderr, base_dir)
|
r = _run_tier4_patch_callback_result(stderr, base_dir)
|
||||||
return r.data if r.ok and r.data else None
|
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."""
|
"""Backward-compat alias for run_tier4_patch_callback_legacy_compat."""
|
||||||
return run_tier4_patch_callback_legacy_compat(stderr, base_dir)
|
return run_tier4_patch_callback_legacy_compat(stderr, base_dir)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user