Skip to content

pydantic version issue ? #8

@WindyOrgUK

Description

@WindyOrgUK

Hi Kenny,

Does the library need a particular version of pydantic to work with extra parameters ?

With:
result = api.generate(prompt="Hello World", options=dict(num_tokens=10), format="json")

I get:
Extra inputs are not permitted [type=extra_forbidden, input_value=10, input_type=int]
For further information visit https://errors.pydantic.dev/2.9/v/extra_forbidden

The url mentions:
This error is raised when the input value contains extra fields, but model_config['extra'] == 'forbid':

Can this be somehow set from ollama-python library ?

Regards
Peter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions