fix(contrib): repair language model registry and open-ended questionnaire - #296
Open
rootkiller6788 wants to merge 1 commit into
Open
Conversation
…aire - point the gemini_vision registry entry at the renamed gemini_model_multimodal module so language_model_setup no longer fails to import it - register google_aistudio, the api_type used by the example run scripts and the persona generator CLI, which the registry had dropped during the google.genai migration - guard OpenEndedQuestionnaire._process_answer against a missing embedder (defaults to None) so answering a free-text question without an embedder stores the raw text instead of crashing Add regression tests for both fixes.
jzleibo
approved these changes
Aug 30, 2026
copybara-service Bot
pushed a commit
that referenced
this pull request
Sep 4, 2026
-- 621d618 by rootkiller6788 <rootkiller6788@users.noreply.github.com>: fix(contrib): repair language model registry and open-ended questionnaire - point the gemini_vision registry entry at the renamed gemini_model_multimodal module so language_model_setup no longer fails to import it - register google_aistudio, the api_type used by the example run scripts and the persona generator CLI, which the registry had dropped during the google.genai migration - guard OpenEndedQuestionnaire._process_answer against a missing embedder (defaults to None) so answering a free-text question without an embedder stores the raw text instead of crashing Add regression tests for both fixes. COPYBARA_INTEGRATE_REVIEW=#296 from rootkiller6788:fix-lm-registry-and-openended-embedder 621d618 PiperOrigin-RevId: 976275954 Change-Id: I0cd88c00b41d65e97c0776cbd254958a347f72a5
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.
Summary
Fixes two crash/breakage bugs in concordia:
1. Language-model setup registry is stale
language_models._REGISTRYstill mappedgemini_visiontogoogle.gemini_model_vision.GeminiModelVision, but the migration to thegoogle.genaipackage (commit 8b4b156) renamed that module togemini_model_multimodal.py. As a resultlanguage_model_setup(api_type='gemini_vision')failed to import the model and raised a misleading "please install dependencies" error even with everything installed.The same migration dropped the
google_aistudioapi_type from the registry entirely, even though it remains the defaultapi_typein every example run script and in thegenerate_personasCLI. Default invocations therefore crash immediately withValueError: Unrecognized api_type: google_aistudio.2. OpenEndedQuestionnaire crashes when no embedder is provided
OpenEndedQuestionnairedocumentsembedderas optional (defaults toNone), but_process_answercalledself._embedder(...)unconditionally forfree/open-endedquestions, raisingTypeError: 'NoneType' object is not callableon the first answer. The siblingAsynchronousQuestionnairehandles this by falling back to the raw answer text; this change does the same.Test plan
pytest concordia/contrib/language_models/ concordia/components/game_master/open_ended_questionnaire_test.py— pass.pylint --errors-onlyon changed files — clean.pyrefly checkon changed files — 0 errors.