MCPcopy Index your code
hub / github.com/openai/openai-python / test_response_parse_custom_stream

Function test_response_parse_custom_stream

tests/test_legacy_response.py:62–73  ·  view source on GitHub ↗
(client: OpenAI)

Source from the content-addressed store, hash-verified

60
61
62def 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
76class CustomModel(BaseModel):

Callers

nothing calls this directly

Calls 3

parseMethod · 0.95
LegacyAPIResponseClass · 0.90
constructMethod · 0.45

Tested by

no test coverage detected