Skip to content

[FEATURE] Support binding classes on Pydantic Models to CocoIndex Struct #795

@badmonster0

Description

@badmonster0

Pydantic is widely used in Python to describe schema. Currently we support dataclass and NamedTuple for structs. We want to add support for Pydantic Models, i.e. users can bind CocoIndex Struct to a Pydantic model.

This will unlock extra benefits later, e.g. Pydantic supports field-level descriptions (which Python docstring doesn't support) - it's very helpful in describing the schema and pass to LLM. To leverage this, we'll need to add extra field on related structs on the engine side (Rust). So we'll create separate issues for these additional features. The current feature request focus on basic support on Pydantic models, and cover existing properties in existing CocoIndex data types.


❤️ Contributors, please refer to 📙Contributing Guide.
Unless the PR can be sent immediately (e.g. just a few lines of code), we recommend you to leave a comment on the issue like I'm working on it or Can I work on this issue? to avoid duplicating work. Our Discord server is always open and friendly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededpython-sdkCocoIndex Python SDK

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions