(client: OpenAI)
| 60 | |
| 61 | |
| 62 | def test_response_parse_custom_stream(client: OpenAI) -> None: |
| 63 | response = LegacyAPIResponse( |
| 64 | raw=httpx.Response(200, content=b"foo"), |
| 65 | client=client, |
| 66 | stream=True, |
| 67 | stream_cls=None, |
| 68 | cast_to=str, |
| 69 | options=FinalRequestOptions.construct(method="get", url="/foo"), |
| 70 | ) |
| 71 | |
| 72 | stream = response.parse(to=Stream[int]) |
| 73 | assert stream._cast_to == int |
| 74 | |
| 75 | |
| 76 | class CustomModel(BaseModel): |
nothing calls this directly
no test coverage detected