Skip to content

Commit a274f2b

Browse files
fix: extract model string for LlmRequest in simulator and per-turn evaluator
LlmRequest.model expects str but self._config.model and self._llm_options.judge_model can now be BaseLlm instances. Extract .model string before passing to LlmRequest.
1 parent d3e7e2e commit a274f2b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/google/adk/evaluation/simulation/llm_backed_user_simulator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,10 @@ async def _get_llm_response(
180180
user_persona=self._user_persona,
181181
)
182182

183+
config_model = self._config.model
184+
model_str = config_model if isinstance(config_model, str) else config_model.model
183185
llm_request = LlmRequest(
184-
model=self._config.model,
186+
model=model_str,
185187
config=self._config.model_configuration,
186188
contents=[
187189
genai_types.Content(

src/google/adk/evaluation/simulation/per_turn_user_simulator_quality_v1.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,10 @@ async def _evaluate_intermediate_turn(
327327
previous_invocations=invocation_history,
328328
)
329329

330+
judge_model = self._llm_options.judge_model
331+
model_str = judge_model if isinstance(judge_model, str) else judge_model.model
330332
llm_request = LlmRequest(
331-
model=self._llm_options.judge_model,
333+
model=model_str,
332334
contents=[
333335
genai_types.Content(
334336
parts=[genai_types.Part(text=auto_rater_prompt)],

0 commit comments

Comments
 (0)