Skip to content

GenerateContentResponse.parsed type should support list[pydantic.BaseModel] #882

@Vandivier

Description

@Vandivier

"response_schema": list[Recipe] as a value in Structured output configuration totally works functionally, but mypy type checking breaks in the response because parsed: Optional[Union[pydantic.BaseModel, dict[Any, Any], Enum]] does not allow a list type.

this is true as of "google-genai>=1.16.1"

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p2Moderately-important priority. Fix may not be included in next release.status:awaiting user responsestatus:staletype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions