googleapis / googleapis/python-genai

Unify the BaseModel classes

Open
#2,465 2 comments 0 reactions 1 assignee Assigned to @MarkDaoust View on GitHub
priority: p3 type: feature request
Dominant language
Python
Stars
4k
Forks
1k
Avg merge
2d 11h
Merged PRs (30d)
40

Description

**Is your feature request related to a problem? Please describe.**
Compare the two base models:

* https://github.com/googleapis/python-genai/blob/610059bf6a425ef95f280f60c7803230a7ce7980/google/genai/_common.py#L549
* https://github.com/googleapis/python-genai/blob/610059bf6a425ef95f280f60c7803230a7ce7980/google/genai/_interactions/_models.py#L113

and those couldn't be any more different.

As a start, the former has `model_config` that sets reasonable defaults, like alias generation, serialization etc; however the latter does not, which makes it that much harder to use.

**Describe the solution you'd like**
Have either a single BaseModel, or multiple, but with the reasonable defaults (alias generation, serialization etc).

**Describe alternatives you've considered**
The only alternative is to sub the hell out of everything and add a model config for each class, which is hardly the best solution.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.