feat(eval): expose user_simulator_config in generate_responses#5733
Open
primenko-v wants to merge 7 commits into
Open
feat(eval): expose user_simulator_config in generate_responses#5733primenko-v wants to merge 7 commits into
primenko-v wants to merge 7 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
N/A
2. Or, if no issue exists, describe the change:
Problem:
EvaluationGenerator.generate_responsesconstructs aUserSimulatorProvider()with no arguments, so the LLM-backed path always runs with the defaultBaseUserSimulatorConfig. There is no way for a caller to override the user-simulation model, max-allowed invocations, or custom instructions when driving multi-turn conversations throughLlmBackedUserSimulator.Solution:
Add an optional
user_simulator_configparameter togenerate_responsesand forward it toUserSimulatorProvider(...). Callers can now pass anLlmBackedUserSimulatorConfigto customize the LLM-backed simulator.The behavior is backward compatible:
UserSimulatorProviderfalls back toBaseUserSimulatorConfig()exactly as before.StaticUserSimulator.Testing Plan
Unit Tests:
A unit test for the proposed change was added to
tests/unittests/evaluation/test_evaluation_generator.py:TestGenerateResponses::test_generate_responses_forwards_llm_backed_user_simulator_configAll tests pass:
The skipped test is not related to this change — it skips on
mainas well.Manual End-to-End (E2E) Tests:
A reference setup lives at https://github.com/primenko-v/adk-x-mlflow (tag
pr-demo/user-simulator-config).It loads an
LlmBackedUserSimulatorConfigfrom YAML and forwards it toEvaluationGenerator.generate_responsesvia the newuser_simulator_configparameter — seesrc/mlflow_adk/simulate.py.To reproduce (requires GOOGLE_CLOUD_PROJECT and ADC via
gcloud auth application-default login):git clone --recurse-submodules --branch pr-demo/user-simulator-config \ https://github.com/primenko-v/adk-x-mlflow.git cd adk-x-mlflow cp .env.example .env # fill in GOOGLE_CLOUD_PROJECT uv sync uv run python -m mlflow_adk.simulate --no-mlflow --output-traces traces.jsonlChecklist