4141@pytest .mark .respx (base_url = base_url )
4242def test_parse_nothing (client : OpenAI , respx_mock : MockRouter , monkeypatch : pytest .MonkeyPatch ) -> None :
4343 listener = _make_stream_snapshot_request (
44- lambda c : c .beta . chat .completions .stream (
44+ lambda c : c .chat .completions .stream (
4545 model = "gpt-4o-2024-08-06" ,
4646 messages = [
4747 {
@@ -103,7 +103,7 @@ def on_event(stream: ChatCompletionStream[Location], event: ChatCompletionStream
103103 done_snapshots .append (model_copy (stream .current_completion_snapshot , deep = True ))
104104
105105 listener = _make_stream_snapshot_request (
106- lambda c : c .beta . chat .completions .stream (
106+ lambda c : c .chat .completions .stream (
107107 model = "gpt-4o-2024-08-06" ,
108108 messages = [
109109 {
@@ -195,7 +195,7 @@ class Location(BaseModel):
195195 units : Literal ["c" , "f" ]
196196
197197 listener = _make_stream_snapshot_request (
198- lambda c : c .beta . chat .completions .stream (
198+ lambda c : c .chat .completions .stream (
199199 model = "gpt-4o-2024-08-06" ,
200200 messages = [
201201 {
@@ -374,7 +374,7 @@ class Location(BaseModel):
374374
375375 with pytest .raises (openai .LengthFinishReasonError ):
376376 _make_stream_snapshot_request (
377- lambda c : c .beta . chat .completions .stream (
377+ lambda c : c .chat .completions .stream (
378378 model = "gpt-4o-2024-08-06" ,
379379 messages = [
380380 {
@@ -399,7 +399,7 @@ class Location(BaseModel):
399399 units : Literal ["c" , "f" ]
400400
401401 listener = _make_stream_snapshot_request (
402- lambda c : c .beta . chat .completions .stream (
402+ lambda c : c .chat .completions .stream (
403403 model = "gpt-4o-2024-08-06" ,
404404 messages = [
405405 {
@@ -444,7 +444,7 @@ class Location(BaseModel):
444444@pytest .mark .respx (base_url = base_url )
445445def test_content_logprobs_events (client : OpenAI , respx_mock : MockRouter , monkeypatch : pytest .MonkeyPatch ) -> None :
446446 listener = _make_stream_snapshot_request (
447- lambda c : c .beta . chat .completions .stream (
447+ lambda c : c .chat .completions .stream (
448448 model = "gpt-4o-2024-08-06" ,
449449 messages = [
450450 {
@@ -523,7 +523,7 @@ class Location(BaseModel):
523523 units : Literal ["c" , "f" ]
524524
525525 listener = _make_stream_snapshot_request (
526- lambda c : c .beta . chat .completions .stream (
526+ lambda c : c .chat .completions .stream (
527527 model = "gpt-4o-2024-08-06" ,
528528 messages = [
529529 {
@@ -635,7 +635,7 @@ class GetWeatherArgs(BaseModel):
635635 units : Literal ["c" , "f" ] = "c"
636636
637637 listener = _make_stream_snapshot_request (
638- lambda c : c .beta . chat .completions .stream (
638+ lambda c : c .chat .completions .stream (
639639 model = "gpt-4o-2024-08-06" ,
640640 messages = [
641641 {
@@ -733,7 +733,7 @@ class GetStockPrice(BaseModel):
733733 exchange : str
734734
735735 listener = _make_stream_snapshot_request (
736- lambda c : c .beta . chat .completions .stream (
736+ lambda c : c .chat .completions .stream (
737737 model = "gpt-4o-2024-08-06" ,
738738 messages = [
739739 {
@@ -831,7 +831,7 @@ class GetStockPrice(BaseModel):
831831@pytest .mark .respx (base_url = base_url )
832832def test_parse_strict_tools (client : OpenAI , respx_mock : MockRouter , monkeypatch : pytest .MonkeyPatch ) -> None :
833833 listener = _make_stream_snapshot_request (
834- lambda c : c .beta . chat .completions .stream (
834+ lambda c : c .chat .completions .stream (
835835 model = "gpt-4o-2024-08-06" ,
836836 messages = [
837837 {
@@ -903,7 +903,7 @@ def test_parse_strict_tools(client: OpenAI, respx_mock: MockRouter, monkeypatch:
903903@pytest .mark .respx (base_url = base_url )
904904def test_non_pydantic_response_format (client : OpenAI , respx_mock : MockRouter , monkeypatch : pytest .MonkeyPatch ) -> None :
905905 listener = _make_stream_snapshot_request (
906- lambda c : c .beta . chat .completions .stream (
906+ lambda c : c .chat .completions .stream (
907907 model = "gpt-4o-2024-08-06" ,
908908 messages = [
909909 {
@@ -951,7 +951,7 @@ def test_allows_non_strict_tools_but_no_parsing(
951951 client : OpenAI , respx_mock : MockRouter , monkeypatch : pytest .MonkeyPatch
952952) -> None :
953953 listener = _make_stream_snapshot_request (
954- lambda c : c .beta . chat .completions .stream (
954+ lambda c : c .chat .completions .stream (
955955 model = "gpt-4o-2024-08-06" ,
956956 messages = [{"role" : "user" , "content" : "what's the weather in NYC?" }],
957957 tools = [
@@ -1069,7 +1069,7 @@ def test_stream_method_in_sync(sync: bool, client: OpenAI, async_client: AsyncOp
10691069
10701070 assert_signatures_in_sync (
10711071 checking_client .chat .completions .create ,
1072- checking_client .beta . chat .completions .stream ,
1072+ checking_client .chat .completions .stream ,
10731073 exclude_params = {"response_format" , "stream" },
10741074 )
10751075
0 commit comments