Regular (non-partial) Iterable streaming does not support validation_context
/context
#1290
Open
3 of 8 tasks
Labels
bug
Something isn't working
What Model are you using?
Describe the bug
When using iterable streaming,
context
/validation_context
is not passed through to field or model validators on the pydantic model.To Reproduce
Expected behavior
Given no mention of the lack of support on the Stream Iterable docs or the Validation docs, I expected the validation context to get passed through.
I see that instructor does not pass the context into
from_streaming_response
.I'm not versed in the inner-workings of either
instructor
orpydantic
, but I do see the following call stackwhich seems to me that pydantic validation is happening. Given the below screenshot, there's clearly some technical limitation as to why validation context isn't supported, but it's not clear that it's not supported for non-partial
Iterable
streaming.Screenshots
There is a note on the Stream Partial docs that validator support is limited, but it was not immediately clear that this affected BOTH partial and non-partial streaming.
Next Steps
A. Support validation context for non-partial
Iterable
streamingOR
B. Docs should be made clear that validation context is not supported for non-partial
Iterable
streaming in addition to partialIterable
streamingHappy to do either (or at least attempt A) once we know the correct course of action.
The text was updated successfully, but these errors were encountered: