2525
2626from google import genai
2727from google .genai import errors
28- from google .genai .types import HttpOptions
2928from google .genai .types import Part
3029from PIL .Image import Image
3130
@@ -109,7 +108,6 @@ def __init__(
109108 api_key : Optional [str ] = None ,
110109 project : Optional [str ] = None ,
111110 location : Optional [str ] = None ,
112- use_vertex_flex_api : Optional [bool ] = False ,
113111 * ,
114112 min_batch_size : Optional [int ] = None ,
115113 max_batch_size : Optional [int ] = None ,
@@ -139,7 +137,6 @@ def __init__(
139137 location: the GCP project to use for Vertex AI requests. Setting this
140138 parameter routes requests to Vertex AI. If this paramter is provided,
141139 project must also be provided and api_key should not be set.
142- use_vertex_flex_api: if true, use the Vertex Flex API.
143140 min_batch_size: optional. the minimum batch size to use when batching
144141 inputs.
145142 max_batch_size: optional. the maximum batch size to use when batching
@@ -172,8 +169,6 @@ def __init__(
172169 self .location = location
173170 self .use_vertex = True
174171
175- self .use_vertex_flex_api = use_vertex_flex_api
176-
177172 super ().__init__ (
178173 namespace = 'GeminiModelHandler' ,
179174 retry_filter = _retry_on_appropriate_service_error ,
@@ -185,19 +180,8 @@ def create_client(self) -> genai.Client:
185180 provided when the GeminiModelHandler class is instantiated.
186181 """
187182 if self .use_vertex :
188- if self .use_vertex_flex_api :
189- return genai .Client (
190- vertexai = True ,
191- project = self .project ,
192- location = self .location ,
193- http_options = HttpOptions (
194- api_version = "v1" ,
195- headers = {"X-Vertex-AI-LLM-Request-Type" : "flex" },
196- # Set timeout in the unit of millisecond.
197- timeout = 600000 ))
198- else :
199- return genai .Client (
200- vertexai = True , project = self .project , location = self .location )
183+ return genai .Client (
184+ vertexai = True , project = self .project , location = self .location )
201185 return genai .Client (api_key = self .api_key )
202186
203187 def request (
0 commit comments