Skip to content

feat(models): allow labels in Gemini API generate_content#2307

Open
MukundaKatta wants to merge 2 commits intogoogleapis:mainfrom
MukundaKatta:codex/python-genai-mldev-labels
Open

feat(models): allow labels in Gemini API generate_content#2307
MukundaKatta wants to merge 2 commits intogoogleapis:mainfrom
MukundaKatta:codex/python-genai-mldev-labels

Conversation

@MukundaKatta
Copy link
Copy Markdown

Summary

  • allow GenerateContentConfig.labels to flow through the Gemini Developer API request mapper instead of raising a hardcoded error
  • add a focused regression test for _GenerateContentConfig_to_mldev() label serialization

Testing

  • python3 -m py_compile google/genai/models.py google/genai/tests/models/test_generate_content.py
  • tried GOOGLE_GENAI_REPLAYS_DIRECTORY=/tmp/python-genai-replays python3 -m pytest google/genai/tests/models/test_generate_content.py -k generate_content_labels_are_serialized_for_mldev
  • local pytest import was blocked because this environment is missing google-auth (ModuleNotFoundError: No module named 'google')

@Venkaiahbabuneelam Venkaiahbabuneelam self-assigned this Apr 20, 2026
@Venkaiahbabuneelam Venkaiahbabuneelam added the size:M Code changes between 10-40 lines label Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M Code changes between 10-40 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants