Skip to content

Not able to set seed parameter in generation_config #536

Open
@zya

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

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