fix(vertex_ai): freeze the merged tool mapping to satisfy LIT002

The dict literal introduced by the previous commit is mutable-collection
construction, which put LIT002 one over its ceiling in the type-discipline gate.
Wrapping it in MappingProxyType keeps the one-shot construction Greptile asked
for while staying inside the budget: a literal passed straight to a freezing
wrapper is exempt, and ** unpacking accepts any mapping.
This commit is contained in:
Mohammad Ali Farhan 2026-08-08 13:49:40 +05:30
parent 8ef6f755c9
commit d873c194db

View file

@ -6,6 +6,7 @@ import time
from collections.abc import Callable, Mapping
from copy import deepcopy
from functools import partial
from types import MappingProxyType
from typing import TYPE_CHECKING, Any, Final, Literal, Optional, Union, cast
import httpx
@ -606,7 +607,7 @@ class VertexGeminiConfig(VertexAIBaseConfig, BaseConfig):
elif "name" in tool: # functions list
_input_schema = tool.get("input_schema") if tool.get("parameters") is None else None
_named_tool = (
{**tool, "parameters": _build_vertex_schema(_input_schema)}
MappingProxyType({**tool, "parameters": _build_vertex_schema(_input_schema)})
if isinstance(_input_schema, dict)
else tool
)