File tree Expand file tree Collapse file tree
c2rust-postprocess/postprocess Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99from collections .abc import Sequence
1010from pathlib import Path
1111
12- from google .genai import types
13-
1412from postprocess .cache import DirectoryCache , FrozenCache
1513from postprocess .exclude_list import IdentifierExcludeList
1614from postprocess .models import api_key_from_env , get_model_by_id
1715from postprocess .models .gpt import GPTModel
1816from postprocess .models .mock import MockGenerativeModel
1917from postprocess .transforms import get_transform_by_id
2018from postprocess .transforms .base import TransformError
21- from postprocess .transforms .comments import (
22- SYSTEM_INSTRUCTION ,
23- AbstractGenerativeModel ,
24- )
19+ from postprocess .transforms .comments import AbstractGenerativeModel
2520from postprocess .utils import existing_file
2621
2722DEFAULT_LLM_MODEL = "gemini-3.5-flash"
@@ -169,15 +164,7 @@ def get_model(model_id: str) -> AbstractGenerativeModel:
169164 )
170165 return MockGenerativeModel ()
171166
172- # TODO: remove google specific API bits
173- return get_model_by_id (
174- model_id ,
175- generation_config = {
176- "system_instruction" : types .Content (
177- role = "system" , parts = [types .Part .from_text (text = SYSTEM_INSTRUCTION )]
178- )
179- },
180- )
167+ return get_model_by_id (model_id )
181168
182169
183170def main (argv : Sequence [str ] | None = None ):
Original file line number Diff line number Diff line change @@ -14,10 +14,10 @@ def api_key_from_env(model_id: str) -> str | None:
1414 return None
1515
1616
17- def get_model_by_id (id : str , generation_config : dict | None ) -> AbstractGenerativeModel :
17+ def get_model_by_id (id : str ) -> AbstractGenerativeModel :
1818 """Factory function to get model instance by ID."""
1919 if id .startswith ("gemini" ):
20- return GoogleGenerativeModel (id = id , generation_config = generation_config )
20+ return GoogleGenerativeModel (id = id )
2121 elif id .startswith ("gpt" ):
2222 return GPTModel (id = id )
2323
Original file line number Diff line number Diff line change @@ -17,13 +17,9 @@ def __init__(
1717 self ,
1818 id : str = "gemini-2.5-flash" ,
1919 api_key : str | None = None ,
20- generation_config : dict [str , Any ] | None = None ,
2120 ):
2221 super ().__init__ (id )
2322 self .client = genai .Client (api_key = api_key )
24- if generation_config is None :
25- generation_config = {}
26- self ._generation_config = generation_config
2723
2824 def generate_with_tools (
2925 self ,
@@ -40,7 +36,6 @@ def generate_with_tools(
4036 disable = False ,
4137 maximum_remote_calls = max_tool_loops , # Enforces the loop limit natively
4238 ),
43- ** self ._generation_config ,
4439 )
4540
4641 response = self .client .models .generate_content (
You can’t perform that action at this time.
0 commit comments