Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions google/genai/_gaos/_hooks/google_genai_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def before_request(
security = _resolve_security(hook_ctx.security_source)

_apply_default_headers(security, request)
_apply_api_revision(hook_ctx, request)
_apply_user_project(hook_ctx, request)
_apply_auth(security, request)

Expand Down Expand Up @@ -105,15 +104,6 @@ def _apply_default_headers(
request.headers[key] = value


def _apply_api_revision(
hook_ctx: BeforeRequestContext, request: httpx.Request
) -> None:
if request.headers.get("Api-Revision") is not None:
return

api_revision = hook_ctx.config.globals.api_revision
request.headers["Api-Revision"] = api_revision or GOOGLE_GENAI_API_REVISION


def _apply_user_project(
hook_ctx: BeforeRequestContext, request: httpx.Request
Expand Down
11 changes: 1 addition & 10 deletions google/genai/_gaos/models/internal/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
class GlobalsTypedDict(TypedDict):
api_version: NotRequired[str]
r"""Which version of the API to use."""
api_revision: NotRequired[str]
r"""API revision header to send with Google GenAI API requests."""
user_project: NotRequired[str]
r"""Quota project header to send with Google GenAI API requests."""

Expand All @@ -41,13 +39,6 @@ class Globals(BaseModel):
] = None
r"""Which version of the API to use."""

api_revision: Annotated[
Optional[str],
pydantic.Field(alias="Api-Revision"),
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
] = None
r"""API revision header to send with Google GenAI API requests."""

user_project: Annotated[
Optional[str],
pydantic.Field(alias="x-goog-user-project"),
Expand All @@ -57,7 +48,7 @@ class Globals(BaseModel):

@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(["api_version", "api_revision", "user_project"])
optional_fields = set(["api_version", "user_project"])
serialized = handler(self)
m = {}

Expand Down
10 changes: 0 additions & 10 deletions google/genai/_gaos/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def __init__(
self,
security: Optional[Union[types.Security, Callable[[], types.Security]]] = None,
api_version: Optional[str] = None,
api_revision: Optional[str] = None,
user_project: Optional[str] = None,
server_idx: Optional[int] = None,
url_params: Optional[Dict[str, str]] = None,
Expand All @@ -81,7 +80,6 @@ def __init__(

:param security: The security details required for authentication
:param api_version: Configures the api_version parameter for all supported operations
:param api_revision: Configures the api_revision parameter for all supported operations
:param user_project: Configures the user_project parameter for all supported operations
:param server_idx: The index of the server to use for all methods
:param server_url: The server URL to use for all methods
Expand Down Expand Up @@ -110,9 +108,6 @@ def __init__(
api_version=utils.get_global_from_env(
api_version, "GOOGLE_GENAI_API_VERSION", str
),
api_revision=utils.get_global_from_env(
api_revision, "GOOGLE_GENAI_API_REVISION", str
),
user_project=utils.get_global_from_env(
user_project, "GOOGLE_GENAI_USER_PROJECT", str
),
Expand Down Expand Up @@ -263,7 +258,6 @@ def __init__(
self,
security: Optional[Union[types.Security, Callable[[], types.Security]]] = None,
api_version: Optional[str] = None,
api_revision: Optional[str] = None,
user_project: Optional[str] = None,
server_idx: Optional[int] = None,
url_params: Optional[Dict[str, str]] = None,
Expand All @@ -277,7 +271,6 @@ def __init__(

:param security: The security details required for authentication
:param api_version: Configures the api_version parameter for all supported operations
:param api_revision: Configures the api_revision parameter for all supported operations
:param user_project: Configures the user_project parameter for all supported operations
:param server_idx: The index of the server to use for all methods
:param server_url: The server URL to use for all methods
Expand All @@ -304,9 +297,6 @@ def __init__(
api_version=utils.get_global_from_env(
api_version, "GOOGLE_GENAI_API_VERSION", str
),
api_revision=utils.get_global_from_env(
api_revision, "GOOGLE_GENAI_API_REVISION", str
),
user_project=utils.get_global_from_env(
user_project, "GOOGLE_GENAI_USER_PROJECT", str
),
Expand Down
Loading