Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Not able to set seed parameter in generation_config #536

Description

@zya

Description of the bug:

Both of the following results in an error.

model = genai.GenerativeModel(
        model_name="models/gemini-1.5-pro-001",
        system_instruction=(...),
        generation_config={
           ...,
           "seed": 1
        }
    )
model = genai.GenerativeModel(
        model_name="models/gemini-1.5-pro-001",
        system_instruction=(...),
        generation_config={
           ...,
        }
    )
model.generate_content(prompt, generation_config={"seed": 1})

Error:

ValueError: Unknown field for GenerationConfig: seed

Seed is mentioned in the docs here:

Actual vs expected behavior:

Actual: Error is thrown when seed is used in generation_config
Expected: seed to be supported and passed to the underlying generate content API.

Any other information you'd like to share?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

component:apiIssues related to the API, not the SDK.type:feature requestNew feature request/enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions