Skip to content

Skip field at run-time #1436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
edge7 opened this issue Mar 20, 2025 · 0 comments
Open

Skip field at run-time #1436

edge7 opened this issue Mar 20, 2025 · 0 comments
Labels
enhancement New feature or request python Pull requests that update python code question Further information is requested

Comments

@edge7
Copy link

edge7 commented Mar 20, 2025

Hi,
Let's say I have class model with some fields in it:

class Response(BaseModel):
    field_1: str
    field_2: str

I am trying to update those fields while the conversation proceeds, I'd like to exclude the already populated fields just to try to populate the missing ones.
For instance, after a bit, I'd like to pass something like:

class Response(BaseModel):
   field_1: str

as field_2 was already populated in the previous part of the conversation.

I've seen there is the possibility to skip fields like this:

class Response(BaseModel):
    question: str
    answer: str
    private_field: SkipJsonSchema[Union[str, None]] = None

how can I dynamically achieve something like that?
Thank you!

@github-actions github-actions bot added enhancement New feature or request python Pull requests that update python code question Further information is requested labels Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python Pull requests that update python code question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant