4444def invoke_agent (payload : dict ):
4545 base_url = payload ["_rollout" ]["base_url" ]
4646 model_id = payload ["_rollout" ]["model_id" ]
47- agent_type = payload .get ("agent_type " , "baseline" )
47+ prompt_type = payload .get ("prompt_type " , "baseline" )
4848 params = payload ["_rollout" ].get ("sampling_params" , {})
4949 tools = [shell , editor ]
5050
@@ -54,7 +54,7 @@ def invoke_agent(payload: dict):
5454 prompt += (
5555 "\n You should update all dependencies in the `pom.xml` file to their latest versions that support Java 17."
5656 )
57- if agent_type == "rag" :
57+ if prompt_type == "rag" :
5858 prompt += (
5959 "\n You have access to a dependency version lookup tool. When updating dependencies "
6060 "in pom.xml:\n "
@@ -65,14 +65,16 @@ def invoke_agent(payload: dict):
6565 "3. Update all dependencies to their Java 17 compatible versions"
6666 )
6767 tools .append (search_dependency_version )
68- elif agent_type == "hybrid" :
68+ elif prompt_type == "hybrid" :
6969 prompt += (
7070 "\n Dependencies in the `pom.xml` file have been updated to their "
7171 "latest versions that support Java 17, but these changes might introduce "
7272 "compatibility issues in the codebase. Please fix any such issues in your "
7373 "migration. Do not downgrade the dependency versions back to their JDK 8 "
7474 "compatible versions."
7575 )
76+ elif prompt_type != "baseline" :
77+ logger .warning (f"Unavailable prompt_type: { prompt_type } . Set to default prompt_type baseline." )
7678
7779 model = OpenAIModel (client_args = {"api_key" : "EMPTY" , "base_url" : base_url }, model_id = model_id , params = params )
7880
@@ -90,7 +92,7 @@ def invoke_agent(payload: dict):
9092 logger .info (f"Loaded repo into: { repo_path } (took { load_duration :.2f} s)" )
9193
9294 start_time = time .time ()
93- setup_repo_environment (repo_path , agent_type )
95+ setup_repo_environment (repo_path , prompt_type )
9496 setup_duration = time .time () - start_time
9597 logger .info (f"Finished repo setup for: { repo_path } (took { setup_duration :.2f} s)" )
9698
0 commit comments