instructor icon indicating copy to clipboard operation
instructor copied to clipboard

Skip field at run-time

Open edge7 opened this issue 9 months ago • 1 comments

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!

edge7 avatar Mar 20 '25 09:03 edge7

I am also interested in this feature!

BrendanRitter avatar Oct 29 '25 01:10 BrendanRitter