File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,7 +45,9 @@ class LlmRequest(BaseModel):
4545 contents : list [types .Content ] = Field (default_factory = list )
4646 """The contents to send to the model."""
4747
48- config : Optional [types .GenerateContentConfig ] = None
48+ config : types .GenerateContentConfig = Field (
49+ default_factory = types .GenerateContentConfig
50+ )
4951 live_connect_config : types .LiveConnectConfig = types .LiveConnectConfig ()
5052 """Additional config for the generate content request.
5153
Original file line number Diff line number Diff line change @@ -1505,7 +1505,6 @@ async def test_computer_use_with_no_config():
15051505 contents = [
15061506 types .Content (role = "user" , parts = [types .Part .from_text (text = "Hello" )])
15071507 ],
1508- config = None ,
15091508 )
15101509
15111510 # Should not raise an exception
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ async def test_process_llm_request_no_declaration():
6262 tool_context = tool_context , llm_request = llm_request
6363 )
6464
65- assert llm_request .config is None
65+ assert llm_request .config == types . GenerateContentConfig ()
6666
6767
6868@pytest .mark .asyncio
Original file line number Diff line number Diff line change @@ -322,12 +322,12 @@ async def test_process_llm_request_with_empty_model_raises_error(self):
322322 )
323323
324324 @pytest .mark .asyncio
325- async def test_process_llm_request_with_none_config (self ):
325+ async def test_process_llm_request_with_no_config (self ):
326326 """Test processing LLM request with None config."""
327327 tool = GoogleSearchTool ()
328328 tool_context = await _create_tool_context ()
329329
330- llm_request = LlmRequest (model = 'gemini-2.0-flash' , config = None )
330+ llm_request = LlmRequest (model = 'gemini-2.0-flash' )
331331
332332 await tool .process_llm_request (
333333 tool_context = tool_context , llm_request = llm_request
Original file line number Diff line number Diff line change @@ -242,12 +242,12 @@ async def test_process_llm_request_with_empty_model_raises_error(self):
242242 )
243243
244244 @pytest .mark .asyncio
245- async def test_process_llm_request_with_none_config (self ):
245+ async def test_process_llm_request_with_no_config (self ):
246246 """Test processing LLM request with None config."""
247247 tool = UrlContextTool ()
248248 tool_context = await _create_tool_context ()
249249
250- llm_request = LlmRequest (model = 'gemini-2.0-flash' , config = None )
250+ llm_request = LlmRequest (model = 'gemini-2.0-flash' )
251251
252252 await tool .process_llm_request (
253253 tool_context = tool_context , llm_request = llm_request
You can’t perform that action at this time.
0 commit comments