diff --git a/tests/api_resources/audio/test_speech.py b/tests/api_resources/audio/test_speech.py index 781ebeceb9..5b5dc24156 100644 --- a/tests/api_resources/audio/test_speech.py +++ b/tests/api_resources/audio/test_speech.py @@ -26,7 +26,7 @@ class TestSpeech: def test_method_create(self, client: OpenAI, respx_mock: MockRouter) -> None: respx_mock.post("/audio/speech").mock(return_value=httpx.Response(200, json={"foo": "bar"})) speech = client.audio.speech.create( - input="string", + input="input", model="string", voice="alloy", ) @@ -38,7 +38,7 @@ def test_method_create(self, client: OpenAI, respx_mock: MockRouter) -> None: def test_method_create_with_all_params(self, client: OpenAI, respx_mock: MockRouter) -> None: respx_mock.post("/audio/speech").mock(return_value=httpx.Response(200, json={"foo": "bar"})) speech = client.audio.speech.create( - input="string", + input="input", model="string", voice="alloy", response_format="mp3", @@ -53,7 +53,7 @@ def test_raw_response_create(self, client: OpenAI, respx_mock: MockRouter) -> No respx_mock.post("/audio/speech").mock(return_value=httpx.Response(200, json={"foo": "bar"})) response = client.audio.speech.with_raw_response.create( - input="string", + input="input", model="string", voice="alloy", ) @@ -68,7 +68,7 @@ def test_raw_response_create(self, client: OpenAI, respx_mock: MockRouter) -> No def test_streaming_response_create(self, client: OpenAI, respx_mock: MockRouter) -> None: respx_mock.post("/audio/speech").mock(return_value=httpx.Response(200, json={"foo": "bar"})) with client.audio.speech.with_streaming_response.create( - input="string", + input="input", model="string", voice="alloy", ) as response: @@ -89,7 +89,7 @@ class TestAsyncSpeech: async def test_method_create(self, async_client: AsyncOpenAI, respx_mock: MockRouter) -> None: respx_mock.post("/audio/speech").mock(return_value=httpx.Response(200, json={"foo": "bar"})) speech = await async_client.audio.speech.create( - input="string", + input="input", model="string", voice="alloy", ) @@ -101,7 +101,7 @@ async def test_method_create(self, async_client: AsyncOpenAI, respx_mock: MockRo async def test_method_create_with_all_params(self, async_client: AsyncOpenAI, respx_mock: MockRouter) -> None: respx_mock.post("/audio/speech").mock(return_value=httpx.Response(200, json={"foo": "bar"})) speech = await async_client.audio.speech.create( - input="string", + input="input", model="string", voice="alloy", response_format="mp3", @@ -116,7 +116,7 @@ async def test_raw_response_create(self, async_client: AsyncOpenAI, respx_mock: respx_mock.post("/audio/speech").mock(return_value=httpx.Response(200, json={"foo": "bar"})) response = await async_client.audio.speech.with_raw_response.create( - input="string", + input="input", model="string", voice="alloy", ) @@ -131,7 +131,7 @@ async def test_raw_response_create(self, async_client: AsyncOpenAI, respx_mock: async def test_streaming_response_create(self, async_client: AsyncOpenAI, respx_mock: MockRouter) -> None: respx_mock.post("/audio/speech").mock(return_value=httpx.Response(200, json={"foo": "bar"})) async with async_client.audio.speech.with_streaming_response.create( - input="string", + input="input", model="string", voice="alloy", ) as response: diff --git a/tests/api_resources/audio/test_transcriptions.py b/tests/api_resources/audio/test_transcriptions.py index ba8e9e4099..a459a34c68 100644 --- a/tests/api_resources/audio/test_transcriptions.py +++ b/tests/api_resources/audio/test_transcriptions.py @@ -30,8 +30,8 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: transcription = client.audio.transcriptions.create( file=b"raw file contents", model="whisper-1", - language="string", - prompt="string", + language="language", + prompt="prompt", response_format="json", temperature=0, timestamp_granularities=["word", "segment"], @@ -81,8 +81,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> transcription = await async_client.audio.transcriptions.create( file=b"raw file contents", model="whisper-1", - language="string", - prompt="string", + language="language", + prompt="prompt", response_format="json", temperature=0, timestamp_granularities=["word", "segment"], diff --git a/tests/api_resources/audio/test_translations.py b/tests/api_resources/audio/test_translations.py index f5c6c68f0b..c6c87c2fef 100644 --- a/tests/api_resources/audio/test_translations.py +++ b/tests/api_resources/audio/test_translations.py @@ -30,8 +30,8 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: translation = client.audio.translations.create( file=b"raw file contents", model="whisper-1", - prompt="string", - response_format="string", + prompt="prompt", + response_format="response_format", temperature=0, ) assert_matches_type(Translation, translation, path=["response"]) @@ -79,8 +79,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> translation = await async_client.audio.translations.create( file=b"raw file contents", model="whisper-1", - prompt="string", - response_format="string", + prompt="prompt", + response_format="response_format", temperature=0, ) assert_matches_type(Translation, translation, path=["response"]) diff --git a/tests/api_resources/beta/test_assistants.py b/tests/api_resources/beta/test_assistants.py index dd0ce9266e..14f279bbb5 100644 --- a/tests/api_resources/beta/test_assistants.py +++ b/tests/api_resources/beta/test_assistants.py @@ -32,10 +32,10 @@ def test_method_create(self, client: OpenAI) -> None: def test_method_create_with_all_params(self, client: OpenAI) -> None: assistant = client.beta.assistants.create( model="gpt-4-turbo", - description="string", - instructions="string", + description="description", + instructions="instructions", metadata={}, - name="string", + name="name", response_format="none", temperature=1, tool_resources={ @@ -83,14 +83,14 @@ def test_streaming_response_create(self, client: OpenAI) -> None: @parametrize def test_method_retrieve(self, client: OpenAI) -> None: assistant = client.beta.assistants.retrieve( - "string", + "assistant_id", ) assert_matches_type(Assistant, assistant, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: OpenAI) -> None: response = client.beta.assistants.with_raw_response.retrieve( - "string", + "assistant_id", ) assert response.is_closed is True @@ -101,7 +101,7 @@ def test_raw_response_retrieve(self, client: OpenAI) -> None: @parametrize def test_streaming_response_retrieve(self, client: OpenAI) -> None: with client.beta.assistants.with_streaming_response.retrieve( - "string", + "assistant_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -121,19 +121,19 @@ def test_path_params_retrieve(self, client: OpenAI) -> None: @parametrize def test_method_update(self, client: OpenAI) -> None: assistant = client.beta.assistants.update( - "string", + assistant_id="assistant_id", ) assert_matches_type(Assistant, assistant, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: OpenAI) -> None: assistant = client.beta.assistants.update( - "string", - description="string", - instructions="string", + assistant_id="assistant_id", + description="description", + instructions="instructions", metadata={}, - model="string", - name="string", + model="model", + name="name", response_format="none", temperature=1, tool_resources={ @@ -148,7 +148,7 @@ def test_method_update_with_all_params(self, client: OpenAI) -> None: @parametrize def test_raw_response_update(self, client: OpenAI) -> None: response = client.beta.assistants.with_raw_response.update( - "string", + assistant_id="assistant_id", ) assert response.is_closed is True @@ -159,7 +159,7 @@ def test_raw_response_update(self, client: OpenAI) -> None: @parametrize def test_streaming_response_update(self, client: OpenAI) -> None: with client.beta.assistants.with_streaming_response.update( - "string", + assistant_id="assistant_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -173,7 +173,7 @@ def test_streaming_response_update(self, client: OpenAI) -> None: def test_path_params_update(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `assistant_id` but received ''"): client.beta.assistants.with_raw_response.update( - "", + assistant_id="", ) @parametrize @@ -184,8 +184,8 @@ def test_method_list(self, client: OpenAI) -> None: @parametrize def test_method_list_with_all_params(self, client: OpenAI) -> None: assistant = client.beta.assistants.list( - after="string", - before="string", + after="after", + before="before", limit=0, order="asc", ) @@ -214,14 +214,14 @@ def test_streaming_response_list(self, client: OpenAI) -> None: @parametrize def test_method_delete(self, client: OpenAI) -> None: assistant = client.beta.assistants.delete( - "string", + "assistant_id", ) assert_matches_type(AssistantDeleted, assistant, path=["response"]) @parametrize def test_raw_response_delete(self, client: OpenAI) -> None: response = client.beta.assistants.with_raw_response.delete( - "string", + "assistant_id", ) assert response.is_closed is True @@ -232,7 +232,7 @@ def test_raw_response_delete(self, client: OpenAI) -> None: @parametrize def test_streaming_response_delete(self, client: OpenAI) -> None: with client.beta.assistants.with_streaming_response.delete( - "string", + "assistant_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -264,10 +264,10 @@ async def test_method_create(self, async_client: AsyncOpenAI) -> None: async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> None: assistant = await async_client.beta.assistants.create( model="gpt-4-turbo", - description="string", - instructions="string", + description="description", + instructions="instructions", metadata={}, - name="string", + name="name", response_format="none", temperature=1, tool_resources={ @@ -315,14 +315,14 @@ async def test_streaming_response_create(self, async_client: AsyncOpenAI) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncOpenAI) -> None: assistant = await async_client.beta.assistants.retrieve( - "string", + "assistant_id", ) assert_matches_type(Assistant, assistant, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.assistants.with_raw_response.retrieve( - "string", + "assistant_id", ) assert response.is_closed is True @@ -333,7 +333,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.assistants.with_streaming_response.retrieve( - "string", + "assistant_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -353,19 +353,19 @@ async def test_path_params_retrieve(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_method_update(self, async_client: AsyncOpenAI) -> None: assistant = await async_client.beta.assistants.update( - "string", + assistant_id="assistant_id", ) assert_matches_type(Assistant, assistant, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOpenAI) -> None: assistant = await async_client.beta.assistants.update( - "string", - description="string", - instructions="string", + assistant_id="assistant_id", + description="description", + instructions="instructions", metadata={}, - model="string", - name="string", + model="model", + name="name", response_format="none", temperature=1, tool_resources={ @@ -380,7 +380,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOpenAI) -> @parametrize async def test_raw_response_update(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.assistants.with_raw_response.update( - "string", + assistant_id="assistant_id", ) assert response.is_closed is True @@ -391,7 +391,7 @@ async def test_raw_response_update(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.assistants.with_streaming_response.update( - "string", + assistant_id="assistant_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -405,7 +405,7 @@ async def test_streaming_response_update(self, async_client: AsyncOpenAI) -> Non async def test_path_params_update(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `assistant_id` but received ''"): await async_client.beta.assistants.with_raw_response.update( - "", + assistant_id="", ) @parametrize @@ -416,8 +416,8 @@ async def test_method_list(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOpenAI) -> None: assistant = await async_client.beta.assistants.list( - after="string", - before="string", + after="after", + before="before", limit=0, order="asc", ) @@ -446,14 +446,14 @@ async def test_streaming_response_list(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_method_delete(self, async_client: AsyncOpenAI) -> None: assistant = await async_client.beta.assistants.delete( - "string", + "assistant_id", ) assert_matches_type(AssistantDeleted, assistant, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.assistants.with_raw_response.delete( - "string", + "assistant_id", ) assert response.is_closed is True @@ -464,7 +464,7 @@ async def test_raw_response_delete(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.assistants.with_streaming_response.delete( - "string", + "assistant_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/beta/test_threads.py b/tests/api_resources/beta/test_threads.py index 9e06b597ef..d45a1a18d1 100644 --- a/tests/api_resources/beta/test_threads.py +++ b/tests/api_resources/beta/test_threads.py @@ -35,7 +35,7 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -43,7 +43,7 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -51,7 +51,7 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -66,7 +66,7 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -74,7 +74,7 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -82,7 +82,7 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -97,7 +97,7 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -105,7 +105,7 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -113,7 +113,7 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -164,14 +164,14 @@ def test_streaming_response_create(self, client: OpenAI) -> None: @parametrize def test_method_retrieve(self, client: OpenAI) -> None: thread = client.beta.threads.retrieve( - "string", + "thread_id", ) assert_matches_type(Thread, thread, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: OpenAI) -> None: response = client.beta.threads.with_raw_response.retrieve( - "string", + "thread_id", ) assert response.is_closed is True @@ -182,7 +182,7 @@ def test_raw_response_retrieve(self, client: OpenAI) -> None: @parametrize def test_streaming_response_retrieve(self, client: OpenAI) -> None: with client.beta.threads.with_streaming_response.retrieve( - "string", + "thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -202,14 +202,14 @@ def test_path_params_retrieve(self, client: OpenAI) -> None: @parametrize def test_method_update(self, client: OpenAI) -> None: thread = client.beta.threads.update( - "string", + thread_id="thread_id", ) assert_matches_type(Thread, thread, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: OpenAI) -> None: thread = client.beta.threads.update( - "string", + thread_id="thread_id", metadata={}, tool_resources={ "code_interpreter": {"file_ids": ["string", "string", "string"]}, @@ -221,7 +221,7 @@ def test_method_update_with_all_params(self, client: OpenAI) -> None: @parametrize def test_raw_response_update(self, client: OpenAI) -> None: response = client.beta.threads.with_raw_response.update( - "string", + thread_id="thread_id", ) assert response.is_closed is True @@ -232,7 +232,7 @@ def test_raw_response_update(self, client: OpenAI) -> None: @parametrize def test_streaming_response_update(self, client: OpenAI) -> None: with client.beta.threads.with_streaming_response.update( - "string", + thread_id="thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -246,20 +246,20 @@ def test_streaming_response_update(self, client: OpenAI) -> None: def test_path_params_update(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): client.beta.threads.with_raw_response.update( - "", + thread_id="", ) @parametrize def test_method_delete(self, client: OpenAI) -> None: thread = client.beta.threads.delete( - "string", + "thread_id", ) assert_matches_type(ThreadDeleted, thread, path=["response"]) @parametrize def test_raw_response_delete(self, client: OpenAI) -> None: response = client.beta.threads.with_raw_response.delete( - "string", + "thread_id", ) assert response.is_closed is True @@ -270,7 +270,7 @@ def test_raw_response_delete(self, client: OpenAI) -> None: @parametrize def test_streaming_response_delete(self, client: OpenAI) -> None: with client.beta.threads.with_streaming_response.delete( - "string", + "thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -290,15 +290,15 @@ def test_path_params_delete(self, client: OpenAI) -> None: @parametrize def test_method_create_and_run_overload_1(self, client: OpenAI) -> None: thread = client.beta.threads.create_and_run( - assistant_id="string", + assistant_id="assistant_id", ) assert_matches_type(Run, thread, path=["response"]) @parametrize def test_method_create_and_run_with_all_params_overload_1(self, client: OpenAI) -> None: thread = client.beta.threads.create_and_run( - assistant_id="string", - instructions="string", + assistant_id="assistant_id", + instructions="instructions", max_completion_tokens=256, max_prompt_tokens=256, metadata={}, @@ -314,7 +314,7 @@ def test_method_create_and_run_with_all_params_overload_1(self, client: OpenAI) "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -322,7 +322,7 @@ def test_method_create_and_run_with_all_params_overload_1(self, client: OpenAI) ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -330,7 +330,7 @@ def test_method_create_and_run_with_all_params_overload_1(self, client: OpenAI) ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -345,7 +345,7 @@ def test_method_create_and_run_with_all_params_overload_1(self, client: OpenAI) "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -353,7 +353,7 @@ def test_method_create_and_run_with_all_params_overload_1(self, client: OpenAI) ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -361,7 +361,7 @@ def test_method_create_and_run_with_all_params_overload_1(self, client: OpenAI) ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -376,7 +376,7 @@ def test_method_create_and_run_with_all_params_overload_1(self, client: OpenAI) "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -384,7 +384,7 @@ def test_method_create_and_run_with_all_params_overload_1(self, client: OpenAI) ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -392,7 +392,7 @@ def test_method_create_and_run_with_all_params_overload_1(self, client: OpenAI) ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -435,7 +435,7 @@ def test_method_create_and_run_with_all_params_overload_1(self, client: OpenAI) @parametrize def test_raw_response_create_and_run_overload_1(self, client: OpenAI) -> None: response = client.beta.threads.with_raw_response.create_and_run( - assistant_id="string", + assistant_id="assistant_id", ) assert response.is_closed is True @@ -446,7 +446,7 @@ def test_raw_response_create_and_run_overload_1(self, client: OpenAI) -> None: @parametrize def test_streaming_response_create_and_run_overload_1(self, client: OpenAI) -> None: with client.beta.threads.with_streaming_response.create_and_run( - assistant_id="string", + assistant_id="assistant_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -459,7 +459,7 @@ def test_streaming_response_create_and_run_overload_1(self, client: OpenAI) -> N @parametrize def test_method_create_and_run_overload_2(self, client: OpenAI) -> None: thread_stream = client.beta.threads.create_and_run( - assistant_id="string", + assistant_id="assistant_id", stream=True, ) thread_stream.response.close() @@ -467,9 +467,9 @@ def test_method_create_and_run_overload_2(self, client: OpenAI) -> None: @parametrize def test_method_create_and_run_with_all_params_overload_2(self, client: OpenAI) -> None: thread_stream = client.beta.threads.create_and_run( - assistant_id="string", + assistant_id="assistant_id", stream=True, - instructions="string", + instructions="instructions", max_completion_tokens=256, max_prompt_tokens=256, metadata={}, @@ -484,7 +484,7 @@ def test_method_create_and_run_with_all_params_overload_2(self, client: OpenAI) "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -492,7 +492,7 @@ def test_method_create_and_run_with_all_params_overload_2(self, client: OpenAI) ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -500,7 +500,7 @@ def test_method_create_and_run_with_all_params_overload_2(self, client: OpenAI) ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -515,7 +515,7 @@ def test_method_create_and_run_with_all_params_overload_2(self, client: OpenAI) "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -523,7 +523,7 @@ def test_method_create_and_run_with_all_params_overload_2(self, client: OpenAI) ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -531,7 +531,7 @@ def test_method_create_and_run_with_all_params_overload_2(self, client: OpenAI) ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -546,7 +546,7 @@ def test_method_create_and_run_with_all_params_overload_2(self, client: OpenAI) "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -554,7 +554,7 @@ def test_method_create_and_run_with_all_params_overload_2(self, client: OpenAI) ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -562,7 +562,7 @@ def test_method_create_and_run_with_all_params_overload_2(self, client: OpenAI) ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -605,7 +605,7 @@ def test_method_create_and_run_with_all_params_overload_2(self, client: OpenAI) @parametrize def test_raw_response_create_and_run_overload_2(self, client: OpenAI) -> None: response = client.beta.threads.with_raw_response.create_and_run( - assistant_id="string", + assistant_id="assistant_id", stream=True, ) @@ -616,7 +616,7 @@ def test_raw_response_create_and_run_overload_2(self, client: OpenAI) -> None: @parametrize def test_streaming_response_create_and_run_overload_2(self, client: OpenAI) -> None: with client.beta.threads.with_streaming_response.create_and_run( - assistant_id="string", + assistant_id="assistant_id", stream=True, ) as response: assert not response.is_closed @@ -645,7 +645,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -653,7 +653,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -661,7 +661,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -676,7 +676,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -684,7 +684,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -692,7 +692,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -707,7 +707,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -715,7 +715,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -723,7 +723,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -774,14 +774,14 @@ async def test_streaming_response_create(self, async_client: AsyncOpenAI) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncOpenAI) -> None: thread = await async_client.beta.threads.retrieve( - "string", + "thread_id", ) assert_matches_type(Thread, thread, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.threads.with_raw_response.retrieve( - "string", + "thread_id", ) assert response.is_closed is True @@ -792,7 +792,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.threads.with_streaming_response.retrieve( - "string", + "thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -812,14 +812,14 @@ async def test_path_params_retrieve(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_method_update(self, async_client: AsyncOpenAI) -> None: thread = await async_client.beta.threads.update( - "string", + thread_id="thread_id", ) assert_matches_type(Thread, thread, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOpenAI) -> None: thread = await async_client.beta.threads.update( - "string", + thread_id="thread_id", metadata={}, tool_resources={ "code_interpreter": {"file_ids": ["string", "string", "string"]}, @@ -831,7 +831,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOpenAI) -> @parametrize async def test_raw_response_update(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.threads.with_raw_response.update( - "string", + thread_id="thread_id", ) assert response.is_closed is True @@ -842,7 +842,7 @@ async def test_raw_response_update(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.threads.with_streaming_response.update( - "string", + thread_id="thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -856,20 +856,20 @@ async def test_streaming_response_update(self, async_client: AsyncOpenAI) -> Non async def test_path_params_update(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): await async_client.beta.threads.with_raw_response.update( - "", + thread_id="", ) @parametrize async def test_method_delete(self, async_client: AsyncOpenAI) -> None: thread = await async_client.beta.threads.delete( - "string", + "thread_id", ) assert_matches_type(ThreadDeleted, thread, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.threads.with_raw_response.delete( - "string", + "thread_id", ) assert response.is_closed is True @@ -880,7 +880,7 @@ async def test_raw_response_delete(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.threads.with_streaming_response.delete( - "string", + "thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -900,15 +900,15 @@ async def test_path_params_delete(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_method_create_and_run_overload_1(self, async_client: AsyncOpenAI) -> None: thread = await async_client.beta.threads.create_and_run( - assistant_id="string", + assistant_id="assistant_id", ) assert_matches_type(Run, thread, path=["response"]) @parametrize async def test_method_create_and_run_with_all_params_overload_1(self, async_client: AsyncOpenAI) -> None: thread = await async_client.beta.threads.create_and_run( - assistant_id="string", - instructions="string", + assistant_id="assistant_id", + instructions="instructions", max_completion_tokens=256, max_prompt_tokens=256, metadata={}, @@ -924,7 +924,7 @@ async def test_method_create_and_run_with_all_params_overload_1(self, async_clie "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -932,7 +932,7 @@ async def test_method_create_and_run_with_all_params_overload_1(self, async_clie ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -940,7 +940,7 @@ async def test_method_create_and_run_with_all_params_overload_1(self, async_clie ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -955,7 +955,7 @@ async def test_method_create_and_run_with_all_params_overload_1(self, async_clie "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -963,7 +963,7 @@ async def test_method_create_and_run_with_all_params_overload_1(self, async_clie ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -971,7 +971,7 @@ async def test_method_create_and_run_with_all_params_overload_1(self, async_clie ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -986,7 +986,7 @@ async def test_method_create_and_run_with_all_params_overload_1(self, async_clie "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -994,7 +994,7 @@ async def test_method_create_and_run_with_all_params_overload_1(self, async_clie ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -1002,7 +1002,7 @@ async def test_method_create_and_run_with_all_params_overload_1(self, async_clie ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -1045,7 +1045,7 @@ async def test_method_create_and_run_with_all_params_overload_1(self, async_clie @parametrize async def test_raw_response_create_and_run_overload_1(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.threads.with_raw_response.create_and_run( - assistant_id="string", + assistant_id="assistant_id", ) assert response.is_closed is True @@ -1056,7 +1056,7 @@ async def test_raw_response_create_and_run_overload_1(self, async_client: AsyncO @parametrize async def test_streaming_response_create_and_run_overload_1(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.threads.with_streaming_response.create_and_run( - assistant_id="string", + assistant_id="assistant_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1069,7 +1069,7 @@ async def test_streaming_response_create_and_run_overload_1(self, async_client: @parametrize async def test_method_create_and_run_overload_2(self, async_client: AsyncOpenAI) -> None: thread_stream = await async_client.beta.threads.create_and_run( - assistant_id="string", + assistant_id="assistant_id", stream=True, ) await thread_stream.response.aclose() @@ -1077,9 +1077,9 @@ async def test_method_create_and_run_overload_2(self, async_client: AsyncOpenAI) @parametrize async def test_method_create_and_run_with_all_params_overload_2(self, async_client: AsyncOpenAI) -> None: thread_stream = await async_client.beta.threads.create_and_run( - assistant_id="string", + assistant_id="assistant_id", stream=True, - instructions="string", + instructions="instructions", max_completion_tokens=256, max_prompt_tokens=256, metadata={}, @@ -1094,7 +1094,7 @@ async def test_method_create_and_run_with_all_params_overload_2(self, async_clie "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -1102,7 +1102,7 @@ async def test_method_create_and_run_with_all_params_overload_2(self, async_clie ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -1110,7 +1110,7 @@ async def test_method_create_and_run_with_all_params_overload_2(self, async_clie ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -1125,7 +1125,7 @@ async def test_method_create_and_run_with_all_params_overload_2(self, async_clie "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -1133,7 +1133,7 @@ async def test_method_create_and_run_with_all_params_overload_2(self, async_clie ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -1141,7 +1141,7 @@ async def test_method_create_and_run_with_all_params_overload_2(self, async_clie ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -1156,7 +1156,7 @@ async def test_method_create_and_run_with_all_params_overload_2(self, async_clie "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -1164,7 +1164,7 @@ async def test_method_create_and_run_with_all_params_overload_2(self, async_clie ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -1172,7 +1172,7 @@ async def test_method_create_and_run_with_all_params_overload_2(self, async_clie ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -1215,7 +1215,7 @@ async def test_method_create_and_run_with_all_params_overload_2(self, async_clie @parametrize async def test_raw_response_create_and_run_overload_2(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.threads.with_raw_response.create_and_run( - assistant_id="string", + assistant_id="assistant_id", stream=True, ) @@ -1226,7 +1226,7 @@ async def test_raw_response_create_and_run_overload_2(self, async_client: AsyncO @parametrize async def test_streaming_response_create_and_run_overload_2(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.threads.with_streaming_response.create_and_run( - assistant_id="string", + assistant_id="assistant_id", stream=True, ) as response: assert not response.is_closed diff --git a/tests/api_resources/beta/test_vector_stores.py b/tests/api_resources/beta/test_vector_stores.py index 39fdb9d1d4..6f0c4d2144 100644 --- a/tests/api_resources/beta/test_vector_stores.py +++ b/tests/api_resources/beta/test_vector_stores.py @@ -36,7 +36,7 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: }, file_ids=["string", "string", "string"], metadata={}, - name="string", + name="name", ) assert_matches_type(VectorStore, vector_store, path=["response"]) @@ -63,14 +63,14 @@ def test_streaming_response_create(self, client: OpenAI) -> None: @parametrize def test_method_retrieve(self, client: OpenAI) -> None: vector_store = client.beta.vector_stores.retrieve( - "string", + "vector_store_id", ) assert_matches_type(VectorStore, vector_store, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: OpenAI) -> None: response = client.beta.vector_stores.with_raw_response.retrieve( - "string", + "vector_store_id", ) assert response.is_closed is True @@ -81,7 +81,7 @@ def test_raw_response_retrieve(self, client: OpenAI) -> None: @parametrize def test_streaming_response_retrieve(self, client: OpenAI) -> None: with client.beta.vector_stores.with_streaming_response.retrieve( - "string", + "vector_store_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -101,27 +101,27 @@ def test_path_params_retrieve(self, client: OpenAI) -> None: @parametrize def test_method_update(self, client: OpenAI) -> None: vector_store = client.beta.vector_stores.update( - "string", + vector_store_id="vector_store_id", ) assert_matches_type(VectorStore, vector_store, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: OpenAI) -> None: vector_store = client.beta.vector_stores.update( - "string", + vector_store_id="vector_store_id", expires_after={ "anchor": "last_active_at", "days": 1, }, metadata={}, - name="string", + name="name", ) assert_matches_type(VectorStore, vector_store, path=["response"]) @parametrize def test_raw_response_update(self, client: OpenAI) -> None: response = client.beta.vector_stores.with_raw_response.update( - "string", + vector_store_id="vector_store_id", ) assert response.is_closed is True @@ -132,7 +132,7 @@ def test_raw_response_update(self, client: OpenAI) -> None: @parametrize def test_streaming_response_update(self, client: OpenAI) -> None: with client.beta.vector_stores.with_streaming_response.update( - "string", + vector_store_id="vector_store_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -146,7 +146,7 @@ def test_streaming_response_update(self, client: OpenAI) -> None: def test_path_params_update(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"): client.beta.vector_stores.with_raw_response.update( - "", + vector_store_id="", ) @parametrize @@ -157,8 +157,8 @@ def test_method_list(self, client: OpenAI) -> None: @parametrize def test_method_list_with_all_params(self, client: OpenAI) -> None: vector_store = client.beta.vector_stores.list( - after="string", - before="string", + after="after", + before="before", limit=0, order="asc", ) @@ -187,14 +187,14 @@ def test_streaming_response_list(self, client: OpenAI) -> None: @parametrize def test_method_delete(self, client: OpenAI) -> None: vector_store = client.beta.vector_stores.delete( - "string", + "vector_store_id", ) assert_matches_type(VectorStoreDeleted, vector_store, path=["response"]) @parametrize def test_raw_response_delete(self, client: OpenAI) -> None: response = client.beta.vector_stores.with_raw_response.delete( - "string", + "vector_store_id", ) assert response.is_closed is True @@ -205,7 +205,7 @@ def test_raw_response_delete(self, client: OpenAI) -> None: @parametrize def test_streaming_response_delete(self, client: OpenAI) -> None: with client.beta.vector_stores.with_streaming_response.delete( - "string", + "vector_store_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -241,7 +241,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> }, file_ids=["string", "string", "string"], metadata={}, - name="string", + name="name", ) assert_matches_type(VectorStore, vector_store, path=["response"]) @@ -268,14 +268,14 @@ async def test_streaming_response_create(self, async_client: AsyncOpenAI) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncOpenAI) -> None: vector_store = await async_client.beta.vector_stores.retrieve( - "string", + "vector_store_id", ) assert_matches_type(VectorStore, vector_store, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.vector_stores.with_raw_response.retrieve( - "string", + "vector_store_id", ) assert response.is_closed is True @@ -286,7 +286,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.vector_stores.with_streaming_response.retrieve( - "string", + "vector_store_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -306,27 +306,27 @@ async def test_path_params_retrieve(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_method_update(self, async_client: AsyncOpenAI) -> None: vector_store = await async_client.beta.vector_stores.update( - "string", + vector_store_id="vector_store_id", ) assert_matches_type(VectorStore, vector_store, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOpenAI) -> None: vector_store = await async_client.beta.vector_stores.update( - "string", + vector_store_id="vector_store_id", expires_after={ "anchor": "last_active_at", "days": 1, }, metadata={}, - name="string", + name="name", ) assert_matches_type(VectorStore, vector_store, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.vector_stores.with_raw_response.update( - "string", + vector_store_id="vector_store_id", ) assert response.is_closed is True @@ -337,7 +337,7 @@ async def test_raw_response_update(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.vector_stores.with_streaming_response.update( - "string", + vector_store_id="vector_store_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -351,7 +351,7 @@ async def test_streaming_response_update(self, async_client: AsyncOpenAI) -> Non async def test_path_params_update(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"): await async_client.beta.vector_stores.with_raw_response.update( - "", + vector_store_id="", ) @parametrize @@ -362,8 +362,8 @@ async def test_method_list(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOpenAI) -> None: vector_store = await async_client.beta.vector_stores.list( - after="string", - before="string", + after="after", + before="before", limit=0, order="asc", ) @@ -392,14 +392,14 @@ async def test_streaming_response_list(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_method_delete(self, async_client: AsyncOpenAI) -> None: vector_store = await async_client.beta.vector_stores.delete( - "string", + "vector_store_id", ) assert_matches_type(VectorStoreDeleted, vector_store, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.vector_stores.with_raw_response.delete( - "string", + "vector_store_id", ) assert response.is_closed is True @@ -410,7 +410,7 @@ async def test_raw_response_delete(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.vector_stores.with_streaming_response.delete( - "string", + "vector_store_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/beta/threads/runs/test_steps.py b/tests/api_resources/beta/threads/runs/test_steps.py index e6108d8dad..d5edeb823e 100644 --- a/tests/api_resources/beta/threads/runs/test_steps.py +++ b/tests/api_resources/beta/threads/runs/test_steps.py @@ -21,18 +21,18 @@ class TestSteps: @parametrize def test_method_retrieve(self, client: OpenAI) -> None: step = client.beta.threads.runs.steps.retrieve( - "string", - thread_id="string", - run_id="string", + step_id="step_id", + thread_id="thread_id", + run_id="run_id", ) assert_matches_type(RunStep, step, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: OpenAI) -> None: response = client.beta.threads.runs.steps.with_raw_response.retrieve( - "string", - thread_id="string", - run_id="string", + step_id="step_id", + thread_id="thread_id", + run_id="run_id", ) assert response.is_closed is True @@ -43,9 +43,9 @@ def test_raw_response_retrieve(self, client: OpenAI) -> None: @parametrize def test_streaming_response_retrieve(self, client: OpenAI) -> None: with client.beta.threads.runs.steps.with_streaming_response.retrieve( - "string", - thread_id="string", - run_id="string", + step_id="step_id", + thread_id="thread_id", + run_id="run_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -59,40 +59,40 @@ def test_streaming_response_retrieve(self, client: OpenAI) -> None: def test_path_params_retrieve(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): client.beta.threads.runs.steps.with_raw_response.retrieve( - "string", + step_id="step_id", thread_id="", - run_id="string", + run_id="run_id", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"): client.beta.threads.runs.steps.with_raw_response.retrieve( - "string", - thread_id="string", + step_id="step_id", + thread_id="thread_id", run_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `step_id` but received ''"): client.beta.threads.runs.steps.with_raw_response.retrieve( - "", - thread_id="string", - run_id="string", + step_id="", + thread_id="thread_id", + run_id="run_id", ) @parametrize def test_method_list(self, client: OpenAI) -> None: step = client.beta.threads.runs.steps.list( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) assert_matches_type(SyncCursorPage[RunStep], step, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: OpenAI) -> None: step = client.beta.threads.runs.steps.list( - "string", - thread_id="string", - after="string", - before="string", + run_id="run_id", + thread_id="thread_id", + after="after", + before="before", limit=0, order="asc", ) @@ -101,8 +101,8 @@ def test_method_list_with_all_params(self, client: OpenAI) -> None: @parametrize def test_raw_response_list(self, client: OpenAI) -> None: response = client.beta.threads.runs.steps.with_raw_response.list( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) assert response.is_closed is True @@ -113,8 +113,8 @@ def test_raw_response_list(self, client: OpenAI) -> None: @parametrize def test_streaming_response_list(self, client: OpenAI) -> None: with client.beta.threads.runs.steps.with_streaming_response.list( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -128,14 +128,14 @@ def test_streaming_response_list(self, client: OpenAI) -> None: def test_path_params_list(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): client.beta.threads.runs.steps.with_raw_response.list( - "string", + run_id="run_id", thread_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"): client.beta.threads.runs.steps.with_raw_response.list( - "", - thread_id="string", + run_id="", + thread_id="thread_id", ) @@ -145,18 +145,18 @@ class TestAsyncSteps: @parametrize async def test_method_retrieve(self, async_client: AsyncOpenAI) -> None: step = await async_client.beta.threads.runs.steps.retrieve( - "string", - thread_id="string", - run_id="string", + step_id="step_id", + thread_id="thread_id", + run_id="run_id", ) assert_matches_type(RunStep, step, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.threads.runs.steps.with_raw_response.retrieve( - "string", - thread_id="string", - run_id="string", + step_id="step_id", + thread_id="thread_id", + run_id="run_id", ) assert response.is_closed is True @@ -167,9 +167,9 @@ async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.threads.runs.steps.with_streaming_response.retrieve( - "string", - thread_id="string", - run_id="string", + step_id="step_id", + thread_id="thread_id", + run_id="run_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -183,40 +183,40 @@ async def test_streaming_response_retrieve(self, async_client: AsyncOpenAI) -> N async def test_path_params_retrieve(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): await async_client.beta.threads.runs.steps.with_raw_response.retrieve( - "string", + step_id="step_id", thread_id="", - run_id="string", + run_id="run_id", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"): await async_client.beta.threads.runs.steps.with_raw_response.retrieve( - "string", - thread_id="string", + step_id="step_id", + thread_id="thread_id", run_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `step_id` but received ''"): await async_client.beta.threads.runs.steps.with_raw_response.retrieve( - "", - thread_id="string", - run_id="string", + step_id="", + thread_id="thread_id", + run_id="run_id", ) @parametrize async def test_method_list(self, async_client: AsyncOpenAI) -> None: step = await async_client.beta.threads.runs.steps.list( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) assert_matches_type(AsyncCursorPage[RunStep], step, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOpenAI) -> None: step = await async_client.beta.threads.runs.steps.list( - "string", - thread_id="string", - after="string", - before="string", + run_id="run_id", + thread_id="thread_id", + after="after", + before="before", limit=0, order="asc", ) @@ -225,8 +225,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncOpenAI) -> N @parametrize async def test_raw_response_list(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.threads.runs.steps.with_raw_response.list( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) assert response.is_closed is True @@ -237,8 +237,8 @@ async def test_raw_response_list(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.threads.runs.steps.with_streaming_response.list( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -252,12 +252,12 @@ async def test_streaming_response_list(self, async_client: AsyncOpenAI) -> None: async def test_path_params_list(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): await async_client.beta.threads.runs.steps.with_raw_response.list( - "string", + run_id="run_id", thread_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"): await async_client.beta.threads.runs.steps.with_raw_response.list( - "", - thread_id="string", + run_id="", + thread_id="thread_id", ) diff --git a/tests/api_resources/beta/threads/test_messages.py b/tests/api_resources/beta/threads/test_messages.py index b5be32a421..edd5f77a32 100644 --- a/tests/api_resources/beta/threads/test_messages.py +++ b/tests/api_resources/beta/threads/test_messages.py @@ -24,7 +24,7 @@ class TestMessages: @parametrize def test_method_create(self, client: OpenAI) -> None: message = client.beta.threads.messages.create( - "string", + thread_id="thread_id", content="string", role="user", ) @@ -33,20 +33,20 @@ def test_method_create(self, client: OpenAI) -> None: @parametrize def test_method_create_with_all_params(self, client: OpenAI) -> None: message = client.beta.threads.messages.create( - "string", + thread_id="thread_id", content="string", role="user", attachments=[ { - "file_id": "string", + "file_id": "file_id", "tools": [{"type": "code_interpreter"}, {"type": "code_interpreter"}, {"type": "code_interpreter"}], }, { - "file_id": "string", + "file_id": "file_id", "tools": [{"type": "code_interpreter"}, {"type": "code_interpreter"}, {"type": "code_interpreter"}], }, { - "file_id": "string", + "file_id": "file_id", "tools": [{"type": "code_interpreter"}, {"type": "code_interpreter"}, {"type": "code_interpreter"}], }, ], @@ -57,7 +57,7 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: @parametrize def test_raw_response_create(self, client: OpenAI) -> None: response = client.beta.threads.messages.with_raw_response.create( - "string", + thread_id="thread_id", content="string", role="user", ) @@ -70,7 +70,7 @@ def test_raw_response_create(self, client: OpenAI) -> None: @parametrize def test_streaming_response_create(self, client: OpenAI) -> None: with client.beta.threads.messages.with_streaming_response.create( - "string", + thread_id="thread_id", content="string", role="user", ) as response: @@ -86,7 +86,7 @@ def test_streaming_response_create(self, client: OpenAI) -> None: def test_path_params_create(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): client.beta.threads.messages.with_raw_response.create( - "", + thread_id="", content="string", role="user", ) @@ -94,16 +94,16 @@ def test_path_params_create(self, client: OpenAI) -> None: @parametrize def test_method_retrieve(self, client: OpenAI) -> None: message = client.beta.threads.messages.retrieve( - "string", - thread_id="string", + message_id="message_id", + thread_id="thread_id", ) assert_matches_type(Message, message, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: OpenAI) -> None: response = client.beta.threads.messages.with_raw_response.retrieve( - "string", - thread_id="string", + message_id="message_id", + thread_id="thread_id", ) assert response.is_closed is True @@ -114,8 +114,8 @@ def test_raw_response_retrieve(self, client: OpenAI) -> None: @parametrize def test_streaming_response_retrieve(self, client: OpenAI) -> None: with client.beta.threads.messages.with_streaming_response.retrieve( - "string", - thread_id="string", + message_id="message_id", + thread_id="thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -129,29 +129,29 @@ def test_streaming_response_retrieve(self, client: OpenAI) -> None: def test_path_params_retrieve(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): client.beta.threads.messages.with_raw_response.retrieve( - "string", + message_id="message_id", thread_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): client.beta.threads.messages.with_raw_response.retrieve( - "", - thread_id="string", + message_id="", + thread_id="thread_id", ) @parametrize def test_method_update(self, client: OpenAI) -> None: message = client.beta.threads.messages.update( - "string", - thread_id="string", + message_id="message_id", + thread_id="thread_id", ) assert_matches_type(Message, message, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: OpenAI) -> None: message = client.beta.threads.messages.update( - "string", - thread_id="string", + message_id="message_id", + thread_id="thread_id", metadata={}, ) assert_matches_type(Message, message, path=["response"]) @@ -159,8 +159,8 @@ def test_method_update_with_all_params(self, client: OpenAI) -> None: @parametrize def test_raw_response_update(self, client: OpenAI) -> None: response = client.beta.threads.messages.with_raw_response.update( - "string", - thread_id="string", + message_id="message_id", + thread_id="thread_id", ) assert response.is_closed is True @@ -171,8 +171,8 @@ def test_raw_response_update(self, client: OpenAI) -> None: @parametrize def test_streaming_response_update(self, client: OpenAI) -> None: with client.beta.threads.messages.with_streaming_response.update( - "string", - thread_id="string", + message_id="message_id", + thread_id="thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -186,39 +186,39 @@ def test_streaming_response_update(self, client: OpenAI) -> None: def test_path_params_update(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): client.beta.threads.messages.with_raw_response.update( - "string", + message_id="message_id", thread_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): client.beta.threads.messages.with_raw_response.update( - "", - thread_id="string", + message_id="", + thread_id="thread_id", ) @parametrize def test_method_list(self, client: OpenAI) -> None: message = client.beta.threads.messages.list( - "string", + thread_id="thread_id", ) assert_matches_type(SyncCursorPage[Message], message, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: OpenAI) -> None: message = client.beta.threads.messages.list( - "string", - after="string", - before="string", + thread_id="thread_id", + after="after", + before="before", limit=0, order="asc", - run_id="string", + run_id="run_id", ) assert_matches_type(SyncCursorPage[Message], message, path=["response"]) @parametrize def test_raw_response_list(self, client: OpenAI) -> None: response = client.beta.threads.messages.with_raw_response.list( - "string", + thread_id="thread_id", ) assert response.is_closed is True @@ -229,7 +229,7 @@ def test_raw_response_list(self, client: OpenAI) -> None: @parametrize def test_streaming_response_list(self, client: OpenAI) -> None: with client.beta.threads.messages.with_streaming_response.list( - "string", + thread_id="thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -243,22 +243,22 @@ def test_streaming_response_list(self, client: OpenAI) -> None: def test_path_params_list(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): client.beta.threads.messages.with_raw_response.list( - "", + thread_id="", ) @parametrize def test_method_delete(self, client: OpenAI) -> None: message = client.beta.threads.messages.delete( - "string", - thread_id="string", + message_id="message_id", + thread_id="thread_id", ) assert_matches_type(MessageDeleted, message, path=["response"]) @parametrize def test_raw_response_delete(self, client: OpenAI) -> None: response = client.beta.threads.messages.with_raw_response.delete( - "string", - thread_id="string", + message_id="message_id", + thread_id="thread_id", ) assert response.is_closed is True @@ -269,8 +269,8 @@ def test_raw_response_delete(self, client: OpenAI) -> None: @parametrize def test_streaming_response_delete(self, client: OpenAI) -> None: with client.beta.threads.messages.with_streaming_response.delete( - "string", - thread_id="string", + message_id="message_id", + thread_id="thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -284,14 +284,14 @@ def test_streaming_response_delete(self, client: OpenAI) -> None: def test_path_params_delete(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): client.beta.threads.messages.with_raw_response.delete( - "string", + message_id="message_id", thread_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): client.beta.threads.messages.with_raw_response.delete( - "", - thread_id="string", + message_id="", + thread_id="thread_id", ) @@ -301,7 +301,7 @@ class TestAsyncMessages: @parametrize async def test_method_create(self, async_client: AsyncOpenAI) -> None: message = await async_client.beta.threads.messages.create( - "string", + thread_id="thread_id", content="string", role="user", ) @@ -310,20 +310,20 @@ async def test_method_create(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> None: message = await async_client.beta.threads.messages.create( - "string", + thread_id="thread_id", content="string", role="user", attachments=[ { - "file_id": "string", + "file_id": "file_id", "tools": [{"type": "code_interpreter"}, {"type": "code_interpreter"}, {"type": "code_interpreter"}], }, { - "file_id": "string", + "file_id": "file_id", "tools": [{"type": "code_interpreter"}, {"type": "code_interpreter"}, {"type": "code_interpreter"}], }, { - "file_id": "string", + "file_id": "file_id", "tools": [{"type": "code_interpreter"}, {"type": "code_interpreter"}, {"type": "code_interpreter"}], }, ], @@ -334,7 +334,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> @parametrize async def test_raw_response_create(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.threads.messages.with_raw_response.create( - "string", + thread_id="thread_id", content="string", role="user", ) @@ -347,7 +347,7 @@ async def test_raw_response_create(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.threads.messages.with_streaming_response.create( - "string", + thread_id="thread_id", content="string", role="user", ) as response: @@ -363,7 +363,7 @@ async def test_streaming_response_create(self, async_client: AsyncOpenAI) -> Non async def test_path_params_create(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): await async_client.beta.threads.messages.with_raw_response.create( - "", + thread_id="", content="string", role="user", ) @@ -371,16 +371,16 @@ async def test_path_params_create(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_method_retrieve(self, async_client: AsyncOpenAI) -> None: message = await async_client.beta.threads.messages.retrieve( - "string", - thread_id="string", + message_id="message_id", + thread_id="thread_id", ) assert_matches_type(Message, message, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.threads.messages.with_raw_response.retrieve( - "string", - thread_id="string", + message_id="message_id", + thread_id="thread_id", ) assert response.is_closed is True @@ -391,8 +391,8 @@ async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.threads.messages.with_streaming_response.retrieve( - "string", - thread_id="string", + message_id="message_id", + thread_id="thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -406,29 +406,29 @@ async def test_streaming_response_retrieve(self, async_client: AsyncOpenAI) -> N async def test_path_params_retrieve(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): await async_client.beta.threads.messages.with_raw_response.retrieve( - "string", + message_id="message_id", thread_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): await async_client.beta.threads.messages.with_raw_response.retrieve( - "", - thread_id="string", + message_id="", + thread_id="thread_id", ) @parametrize async def test_method_update(self, async_client: AsyncOpenAI) -> None: message = await async_client.beta.threads.messages.update( - "string", - thread_id="string", + message_id="message_id", + thread_id="thread_id", ) assert_matches_type(Message, message, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOpenAI) -> None: message = await async_client.beta.threads.messages.update( - "string", - thread_id="string", + message_id="message_id", + thread_id="thread_id", metadata={}, ) assert_matches_type(Message, message, path=["response"]) @@ -436,8 +436,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncOpenAI) -> @parametrize async def test_raw_response_update(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.threads.messages.with_raw_response.update( - "string", - thread_id="string", + message_id="message_id", + thread_id="thread_id", ) assert response.is_closed is True @@ -448,8 +448,8 @@ async def test_raw_response_update(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.threads.messages.with_streaming_response.update( - "string", - thread_id="string", + message_id="message_id", + thread_id="thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -463,39 +463,39 @@ async def test_streaming_response_update(self, async_client: AsyncOpenAI) -> Non async def test_path_params_update(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): await async_client.beta.threads.messages.with_raw_response.update( - "string", + message_id="message_id", thread_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): await async_client.beta.threads.messages.with_raw_response.update( - "", - thread_id="string", + message_id="", + thread_id="thread_id", ) @parametrize async def test_method_list(self, async_client: AsyncOpenAI) -> None: message = await async_client.beta.threads.messages.list( - "string", + thread_id="thread_id", ) assert_matches_type(AsyncCursorPage[Message], message, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOpenAI) -> None: message = await async_client.beta.threads.messages.list( - "string", - after="string", - before="string", + thread_id="thread_id", + after="after", + before="before", limit=0, order="asc", - run_id="string", + run_id="run_id", ) assert_matches_type(AsyncCursorPage[Message], message, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.threads.messages.with_raw_response.list( - "string", + thread_id="thread_id", ) assert response.is_closed is True @@ -506,7 +506,7 @@ async def test_raw_response_list(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.threads.messages.with_streaming_response.list( - "string", + thread_id="thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -520,22 +520,22 @@ async def test_streaming_response_list(self, async_client: AsyncOpenAI) -> None: async def test_path_params_list(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): await async_client.beta.threads.messages.with_raw_response.list( - "", + thread_id="", ) @parametrize async def test_method_delete(self, async_client: AsyncOpenAI) -> None: message = await async_client.beta.threads.messages.delete( - "string", - thread_id="string", + message_id="message_id", + thread_id="thread_id", ) assert_matches_type(MessageDeleted, message, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.threads.messages.with_raw_response.delete( - "string", - thread_id="string", + message_id="message_id", + thread_id="thread_id", ) assert response.is_closed is True @@ -546,8 +546,8 @@ async def test_raw_response_delete(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.threads.messages.with_streaming_response.delete( - "string", - thread_id="string", + message_id="message_id", + thread_id="thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -561,12 +561,12 @@ async def test_streaming_response_delete(self, async_client: AsyncOpenAI) -> Non async def test_path_params_delete(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): await async_client.beta.threads.messages.with_raw_response.delete( - "string", + message_id="message_id", thread_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): await async_client.beta.threads.messages.with_raw_response.delete( - "", - thread_id="string", + message_id="", + thread_id="thread_id", ) diff --git a/tests/api_resources/beta/threads/test_runs.py b/tests/api_resources/beta/threads/test_runs.py index ffadc1df88..ff242126b2 100644 --- a/tests/api_resources/beta/threads/test_runs.py +++ b/tests/api_resources/beta/threads/test_runs.py @@ -23,24 +23,24 @@ class TestRuns: @parametrize def test_method_create_overload_1(self, client: OpenAI) -> None: run = client.beta.threads.runs.create( - "string", - assistant_id="string", + thread_id="thread_id", + assistant_id="assistant_id", ) assert_matches_type(Run, run, path=["response"]) @parametrize def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: run = client.beta.threads.runs.create( - "string", - assistant_id="string", - additional_instructions="string", + thread_id="thread_id", + assistant_id="assistant_id", + additional_instructions="additional_instructions", additional_messages=[ { "role": "user", "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -48,7 +48,7 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -56,7 +56,7 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -71,7 +71,7 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -79,7 +79,7 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -87,7 +87,7 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -102,7 +102,7 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -110,7 +110,7 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -118,7 +118,7 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -129,7 +129,7 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: "metadata": {}, }, ], - instructions="string", + instructions="instructions", max_completion_tokens=256, max_prompt_tokens=256, metadata={}, @@ -151,8 +151,8 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: @parametrize def test_raw_response_create_overload_1(self, client: OpenAI) -> None: response = client.beta.threads.runs.with_raw_response.create( - "string", - assistant_id="string", + thread_id="thread_id", + assistant_id="assistant_id", ) assert response.is_closed is True @@ -163,8 +163,8 @@ def test_raw_response_create_overload_1(self, client: OpenAI) -> None: @parametrize def test_streaming_response_create_overload_1(self, client: OpenAI) -> None: with client.beta.threads.runs.with_streaming_response.create( - "string", - assistant_id="string", + thread_id="thread_id", + assistant_id="assistant_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -178,15 +178,15 @@ def test_streaming_response_create_overload_1(self, client: OpenAI) -> None: def test_path_params_create_overload_1(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): client.beta.threads.runs.with_raw_response.create( - "", - assistant_id="string", + thread_id="", + assistant_id="assistant_id", ) @parametrize def test_method_create_overload_2(self, client: OpenAI) -> None: run_stream = client.beta.threads.runs.create( - "string", - assistant_id="string", + thread_id="thread_id", + assistant_id="assistant_id", stream=True, ) run_stream.response.close() @@ -194,17 +194,17 @@ def test_method_create_overload_2(self, client: OpenAI) -> None: @parametrize def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: run_stream = client.beta.threads.runs.create( - "string", - assistant_id="string", + thread_id="thread_id", + assistant_id="assistant_id", stream=True, - additional_instructions="string", + additional_instructions="additional_instructions", additional_messages=[ { "role": "user", "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -212,7 +212,7 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -220,7 +220,7 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -235,7 +235,7 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -243,7 +243,7 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -251,7 +251,7 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -266,7 +266,7 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -274,7 +274,7 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -282,7 +282,7 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -293,7 +293,7 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: "metadata": {}, }, ], - instructions="string", + instructions="instructions", max_completion_tokens=256, max_prompt_tokens=256, metadata={}, @@ -314,8 +314,8 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: @parametrize def test_raw_response_create_overload_2(self, client: OpenAI) -> None: response = client.beta.threads.runs.with_raw_response.create( - "string", - assistant_id="string", + thread_id="thread_id", + assistant_id="assistant_id", stream=True, ) @@ -326,8 +326,8 @@ def test_raw_response_create_overload_2(self, client: OpenAI) -> None: @parametrize def test_streaming_response_create_overload_2(self, client: OpenAI) -> None: with client.beta.threads.runs.with_streaming_response.create( - "string", - assistant_id="string", + thread_id="thread_id", + assistant_id="assistant_id", stream=True, ) as response: assert not response.is_closed @@ -342,24 +342,24 @@ def test_streaming_response_create_overload_2(self, client: OpenAI) -> None: def test_path_params_create_overload_2(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): client.beta.threads.runs.with_raw_response.create( - "", - assistant_id="string", + thread_id="", + assistant_id="assistant_id", stream=True, ) @parametrize def test_method_retrieve(self, client: OpenAI) -> None: run = client.beta.threads.runs.retrieve( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) assert_matches_type(Run, run, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: OpenAI) -> None: response = client.beta.threads.runs.with_raw_response.retrieve( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) assert response.is_closed is True @@ -370,8 +370,8 @@ def test_raw_response_retrieve(self, client: OpenAI) -> None: @parametrize def test_streaming_response_retrieve(self, client: OpenAI) -> None: with client.beta.threads.runs.with_streaming_response.retrieve( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -385,29 +385,29 @@ def test_streaming_response_retrieve(self, client: OpenAI) -> None: def test_path_params_retrieve(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): client.beta.threads.runs.with_raw_response.retrieve( - "string", + run_id="run_id", thread_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"): client.beta.threads.runs.with_raw_response.retrieve( - "", - thread_id="string", + run_id="", + thread_id="thread_id", ) @parametrize def test_method_update(self, client: OpenAI) -> None: run = client.beta.threads.runs.update( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) assert_matches_type(Run, run, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: OpenAI) -> None: run = client.beta.threads.runs.update( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", metadata={}, ) assert_matches_type(Run, run, path=["response"]) @@ -415,8 +415,8 @@ def test_method_update_with_all_params(self, client: OpenAI) -> None: @parametrize def test_raw_response_update(self, client: OpenAI) -> None: response = client.beta.threads.runs.with_raw_response.update( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) assert response.is_closed is True @@ -427,8 +427,8 @@ def test_raw_response_update(self, client: OpenAI) -> None: @parametrize def test_streaming_response_update(self, client: OpenAI) -> None: with client.beta.threads.runs.with_streaming_response.update( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -442,29 +442,29 @@ def test_streaming_response_update(self, client: OpenAI) -> None: def test_path_params_update(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): client.beta.threads.runs.with_raw_response.update( - "string", + run_id="run_id", thread_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"): client.beta.threads.runs.with_raw_response.update( - "", - thread_id="string", + run_id="", + thread_id="thread_id", ) @parametrize def test_method_list(self, client: OpenAI) -> None: run = client.beta.threads.runs.list( - "string", + thread_id="thread_id", ) assert_matches_type(SyncCursorPage[Run], run, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: OpenAI) -> None: run = client.beta.threads.runs.list( - "string", - after="string", - before="string", + thread_id="thread_id", + after="after", + before="before", limit=0, order="asc", ) @@ -473,7 +473,7 @@ def test_method_list_with_all_params(self, client: OpenAI) -> None: @parametrize def test_raw_response_list(self, client: OpenAI) -> None: response = client.beta.threads.runs.with_raw_response.list( - "string", + thread_id="thread_id", ) assert response.is_closed is True @@ -484,7 +484,7 @@ def test_raw_response_list(self, client: OpenAI) -> None: @parametrize def test_streaming_response_list(self, client: OpenAI) -> None: with client.beta.threads.runs.with_streaming_response.list( - "string", + thread_id="thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -498,22 +498,22 @@ def test_streaming_response_list(self, client: OpenAI) -> None: def test_path_params_list(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): client.beta.threads.runs.with_raw_response.list( - "", + thread_id="", ) @parametrize def test_method_cancel(self, client: OpenAI) -> None: run = client.beta.threads.runs.cancel( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) assert_matches_type(Run, run, path=["response"]) @parametrize def test_raw_response_cancel(self, client: OpenAI) -> None: response = client.beta.threads.runs.with_raw_response.cancel( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) assert response.is_closed is True @@ -524,8 +524,8 @@ def test_raw_response_cancel(self, client: OpenAI) -> None: @parametrize def test_streaming_response_cancel(self, client: OpenAI) -> None: with client.beta.threads.runs.with_streaming_response.cancel( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -539,21 +539,21 @@ def test_streaming_response_cancel(self, client: OpenAI) -> None: def test_path_params_cancel(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): client.beta.threads.runs.with_raw_response.cancel( - "string", + run_id="run_id", thread_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"): client.beta.threads.runs.with_raw_response.cancel( - "", - thread_id="string", + run_id="", + thread_id="thread_id", ) @parametrize def test_method_submit_tool_outputs_overload_1(self, client: OpenAI) -> None: run = client.beta.threads.runs.submit_tool_outputs( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", tool_outputs=[{}, {}, {}], ) assert_matches_type(Run, run, path=["response"]) @@ -561,20 +561,20 @@ def test_method_submit_tool_outputs_overload_1(self, client: OpenAI) -> None: @parametrize def test_method_submit_tool_outputs_with_all_params_overload_1(self, client: OpenAI) -> None: run = client.beta.threads.runs.submit_tool_outputs( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", tool_outputs=[ { - "tool_call_id": "string", - "output": "string", + "tool_call_id": "tool_call_id", + "output": "output", }, { - "tool_call_id": "string", - "output": "string", + "tool_call_id": "tool_call_id", + "output": "output", }, { - "tool_call_id": "string", - "output": "string", + "tool_call_id": "tool_call_id", + "output": "output", }, ], stream=False, @@ -584,8 +584,8 @@ def test_method_submit_tool_outputs_with_all_params_overload_1(self, client: Ope @parametrize def test_raw_response_submit_tool_outputs_overload_1(self, client: OpenAI) -> None: response = client.beta.threads.runs.with_raw_response.submit_tool_outputs( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", tool_outputs=[{}, {}, {}], ) @@ -597,8 +597,8 @@ def test_raw_response_submit_tool_outputs_overload_1(self, client: OpenAI) -> No @parametrize def test_streaming_response_submit_tool_outputs_overload_1(self, client: OpenAI) -> None: with client.beta.threads.runs.with_streaming_response.submit_tool_outputs( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", tool_outputs=[{}, {}, {}], ) as response: assert not response.is_closed @@ -613,23 +613,23 @@ def test_streaming_response_submit_tool_outputs_overload_1(self, client: OpenAI) def test_path_params_submit_tool_outputs_overload_1(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): client.beta.threads.runs.with_raw_response.submit_tool_outputs( - "string", + run_id="run_id", thread_id="", tool_outputs=[{}, {}, {}], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"): client.beta.threads.runs.with_raw_response.submit_tool_outputs( - "", - thread_id="string", + run_id="", + thread_id="thread_id", tool_outputs=[{}, {}, {}], ) @parametrize def test_method_submit_tool_outputs_overload_2(self, client: OpenAI) -> None: run_stream = client.beta.threads.runs.submit_tool_outputs( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", stream=True, tool_outputs=[{}, {}, {}], ) @@ -638,8 +638,8 @@ def test_method_submit_tool_outputs_overload_2(self, client: OpenAI) -> None: @parametrize def test_raw_response_submit_tool_outputs_overload_2(self, client: OpenAI) -> None: response = client.beta.threads.runs.with_raw_response.submit_tool_outputs( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", stream=True, tool_outputs=[{}, {}, {}], ) @@ -651,8 +651,8 @@ def test_raw_response_submit_tool_outputs_overload_2(self, client: OpenAI) -> No @parametrize def test_streaming_response_submit_tool_outputs_overload_2(self, client: OpenAI) -> None: with client.beta.threads.runs.with_streaming_response.submit_tool_outputs( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", stream=True, tool_outputs=[{}, {}, {}], ) as response: @@ -668,7 +668,7 @@ def test_streaming_response_submit_tool_outputs_overload_2(self, client: OpenAI) def test_path_params_submit_tool_outputs_overload_2(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): client.beta.threads.runs.with_raw_response.submit_tool_outputs( - "string", + run_id="run_id", thread_id="", stream=True, tool_outputs=[{}, {}, {}], @@ -676,8 +676,8 @@ def test_path_params_submit_tool_outputs_overload_2(self, client: OpenAI) -> Non with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"): client.beta.threads.runs.with_raw_response.submit_tool_outputs( - "", - thread_id="string", + run_id="", + thread_id="thread_id", stream=True, tool_outputs=[{}, {}, {}], ) @@ -689,24 +689,24 @@ class TestAsyncRuns: @parametrize async def test_method_create_overload_1(self, async_client: AsyncOpenAI) -> None: run = await async_client.beta.threads.runs.create( - "string", - assistant_id="string", + thread_id="thread_id", + assistant_id="assistant_id", ) assert_matches_type(Run, run, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_1(self, async_client: AsyncOpenAI) -> None: run = await async_client.beta.threads.runs.create( - "string", - assistant_id="string", - additional_instructions="string", + thread_id="thread_id", + assistant_id="assistant_id", + additional_instructions="additional_instructions", additional_messages=[ { "role": "user", "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -714,7 +714,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -722,7 +722,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -737,7 +737,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -745,7 +745,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -753,7 +753,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -768,7 +768,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -776,7 +776,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -784,7 +784,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -795,7 +795,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn "metadata": {}, }, ], - instructions="string", + instructions="instructions", max_completion_tokens=256, max_prompt_tokens=256, metadata={}, @@ -817,8 +817,8 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.threads.runs.with_raw_response.create( - "string", - assistant_id="string", + thread_id="thread_id", + assistant_id="assistant_id", ) assert response.is_closed is True @@ -829,8 +829,8 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncOpenAI) - @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.threads.runs.with_streaming_response.create( - "string", - assistant_id="string", + thread_id="thread_id", + assistant_id="assistant_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -844,15 +844,15 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncOpe async def test_path_params_create_overload_1(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): await async_client.beta.threads.runs.with_raw_response.create( - "", - assistant_id="string", + thread_id="", + assistant_id="assistant_id", ) @parametrize async def test_method_create_overload_2(self, async_client: AsyncOpenAI) -> None: run_stream = await async_client.beta.threads.runs.create( - "string", - assistant_id="string", + thread_id="thread_id", + assistant_id="assistant_id", stream=True, ) await run_stream.response.aclose() @@ -860,17 +860,17 @@ async def test_method_create_overload_2(self, async_client: AsyncOpenAI) -> None @parametrize async def test_method_create_with_all_params_overload_2(self, async_client: AsyncOpenAI) -> None: run_stream = await async_client.beta.threads.runs.create( - "string", - assistant_id="string", + thread_id="thread_id", + assistant_id="assistant_id", stream=True, - additional_instructions="string", + additional_instructions="additional_instructions", additional_messages=[ { "role": "user", "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -878,7 +878,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -886,7 +886,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -901,7 +901,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -909,7 +909,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -917,7 +917,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -932,7 +932,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn "content": "string", "attachments": [ { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -940,7 +940,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -948,7 +948,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn ], }, { - "file_id": "string", + "file_id": "file_id", "tools": [ {"type": "code_interpreter"}, {"type": "code_interpreter"}, @@ -959,7 +959,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn "metadata": {}, }, ], - instructions="string", + instructions="instructions", max_completion_tokens=256, max_prompt_tokens=256, metadata={}, @@ -980,8 +980,8 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.threads.runs.with_raw_response.create( - "string", - assistant_id="string", + thread_id="thread_id", + assistant_id="assistant_id", stream=True, ) @@ -992,8 +992,8 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncOpenAI) - @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.threads.runs.with_streaming_response.create( - "string", - assistant_id="string", + thread_id="thread_id", + assistant_id="assistant_id", stream=True, ) as response: assert not response.is_closed @@ -1008,24 +1008,24 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncOpe async def test_path_params_create_overload_2(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): await async_client.beta.threads.runs.with_raw_response.create( - "", - assistant_id="string", + thread_id="", + assistant_id="assistant_id", stream=True, ) @parametrize async def test_method_retrieve(self, async_client: AsyncOpenAI) -> None: run = await async_client.beta.threads.runs.retrieve( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) assert_matches_type(Run, run, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.threads.runs.with_raw_response.retrieve( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) assert response.is_closed is True @@ -1036,8 +1036,8 @@ async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.threads.runs.with_streaming_response.retrieve( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1051,29 +1051,29 @@ async def test_streaming_response_retrieve(self, async_client: AsyncOpenAI) -> N async def test_path_params_retrieve(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): await async_client.beta.threads.runs.with_raw_response.retrieve( - "string", + run_id="run_id", thread_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"): await async_client.beta.threads.runs.with_raw_response.retrieve( - "", - thread_id="string", + run_id="", + thread_id="thread_id", ) @parametrize async def test_method_update(self, async_client: AsyncOpenAI) -> None: run = await async_client.beta.threads.runs.update( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) assert_matches_type(Run, run, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncOpenAI) -> None: run = await async_client.beta.threads.runs.update( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", metadata={}, ) assert_matches_type(Run, run, path=["response"]) @@ -1081,8 +1081,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncOpenAI) -> @parametrize async def test_raw_response_update(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.threads.runs.with_raw_response.update( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) assert response.is_closed is True @@ -1093,8 +1093,8 @@ async def test_raw_response_update(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_update(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.threads.runs.with_streaming_response.update( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1108,29 +1108,29 @@ async def test_streaming_response_update(self, async_client: AsyncOpenAI) -> Non async def test_path_params_update(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): await async_client.beta.threads.runs.with_raw_response.update( - "string", + run_id="run_id", thread_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"): await async_client.beta.threads.runs.with_raw_response.update( - "", - thread_id="string", + run_id="", + thread_id="thread_id", ) @parametrize async def test_method_list(self, async_client: AsyncOpenAI) -> None: run = await async_client.beta.threads.runs.list( - "string", + thread_id="thread_id", ) assert_matches_type(AsyncCursorPage[Run], run, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOpenAI) -> None: run = await async_client.beta.threads.runs.list( - "string", - after="string", - before="string", + thread_id="thread_id", + after="after", + before="before", limit=0, order="asc", ) @@ -1139,7 +1139,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOpenAI) -> N @parametrize async def test_raw_response_list(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.threads.runs.with_raw_response.list( - "string", + thread_id="thread_id", ) assert response.is_closed is True @@ -1150,7 +1150,7 @@ async def test_raw_response_list(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.threads.runs.with_streaming_response.list( - "string", + thread_id="thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1164,22 +1164,22 @@ async def test_streaming_response_list(self, async_client: AsyncOpenAI) -> None: async def test_path_params_list(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): await async_client.beta.threads.runs.with_raw_response.list( - "", + thread_id="", ) @parametrize async def test_method_cancel(self, async_client: AsyncOpenAI) -> None: run = await async_client.beta.threads.runs.cancel( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) assert_matches_type(Run, run, path=["response"]) @parametrize async def test_raw_response_cancel(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.threads.runs.with_raw_response.cancel( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) assert response.is_closed is True @@ -1190,8 +1190,8 @@ async def test_raw_response_cancel(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_cancel(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.threads.runs.with_streaming_response.cancel( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1205,21 +1205,21 @@ async def test_streaming_response_cancel(self, async_client: AsyncOpenAI) -> Non async def test_path_params_cancel(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): await async_client.beta.threads.runs.with_raw_response.cancel( - "string", + run_id="run_id", thread_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"): await async_client.beta.threads.runs.with_raw_response.cancel( - "", - thread_id="string", + run_id="", + thread_id="thread_id", ) @parametrize async def test_method_submit_tool_outputs_overload_1(self, async_client: AsyncOpenAI) -> None: run = await async_client.beta.threads.runs.submit_tool_outputs( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", tool_outputs=[{}, {}, {}], ) assert_matches_type(Run, run, path=["response"]) @@ -1227,20 +1227,20 @@ async def test_method_submit_tool_outputs_overload_1(self, async_client: AsyncOp @parametrize async def test_method_submit_tool_outputs_with_all_params_overload_1(self, async_client: AsyncOpenAI) -> None: run = await async_client.beta.threads.runs.submit_tool_outputs( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", tool_outputs=[ { - "tool_call_id": "string", - "output": "string", + "tool_call_id": "tool_call_id", + "output": "output", }, { - "tool_call_id": "string", - "output": "string", + "tool_call_id": "tool_call_id", + "output": "output", }, { - "tool_call_id": "string", - "output": "string", + "tool_call_id": "tool_call_id", + "output": "output", }, ], stream=False, @@ -1250,8 +1250,8 @@ async def test_method_submit_tool_outputs_with_all_params_overload_1(self, async @parametrize async def test_raw_response_submit_tool_outputs_overload_1(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.threads.runs.with_raw_response.submit_tool_outputs( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", tool_outputs=[{}, {}, {}], ) @@ -1263,8 +1263,8 @@ async def test_raw_response_submit_tool_outputs_overload_1(self, async_client: A @parametrize async def test_streaming_response_submit_tool_outputs_overload_1(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.threads.runs.with_streaming_response.submit_tool_outputs( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", tool_outputs=[{}, {}, {}], ) as response: assert not response.is_closed @@ -1279,23 +1279,23 @@ async def test_streaming_response_submit_tool_outputs_overload_1(self, async_cli async def test_path_params_submit_tool_outputs_overload_1(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): await async_client.beta.threads.runs.with_raw_response.submit_tool_outputs( - "string", + run_id="run_id", thread_id="", tool_outputs=[{}, {}, {}], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"): await async_client.beta.threads.runs.with_raw_response.submit_tool_outputs( - "", - thread_id="string", + run_id="", + thread_id="thread_id", tool_outputs=[{}, {}, {}], ) @parametrize async def test_method_submit_tool_outputs_overload_2(self, async_client: AsyncOpenAI) -> None: run_stream = await async_client.beta.threads.runs.submit_tool_outputs( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", stream=True, tool_outputs=[{}, {}, {}], ) @@ -1304,8 +1304,8 @@ async def test_method_submit_tool_outputs_overload_2(self, async_client: AsyncOp @parametrize async def test_raw_response_submit_tool_outputs_overload_2(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.threads.runs.with_raw_response.submit_tool_outputs( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", stream=True, tool_outputs=[{}, {}, {}], ) @@ -1317,8 +1317,8 @@ async def test_raw_response_submit_tool_outputs_overload_2(self, async_client: A @parametrize async def test_streaming_response_submit_tool_outputs_overload_2(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.threads.runs.with_streaming_response.submit_tool_outputs( - "string", - thread_id="string", + run_id="run_id", + thread_id="thread_id", stream=True, tool_outputs=[{}, {}, {}], ) as response: @@ -1334,7 +1334,7 @@ async def test_streaming_response_submit_tool_outputs_overload_2(self, async_cli async def test_path_params_submit_tool_outputs_overload_2(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): await async_client.beta.threads.runs.with_raw_response.submit_tool_outputs( - "string", + run_id="run_id", thread_id="", stream=True, tool_outputs=[{}, {}, {}], @@ -1342,8 +1342,8 @@ async def test_path_params_submit_tool_outputs_overload_2(self, async_client: As with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"): await async_client.beta.threads.runs.with_raw_response.submit_tool_outputs( - "", - thread_id="string", + run_id="", + thread_id="thread_id", stream=True, tool_outputs=[{}, {}, {}], ) diff --git a/tests/api_resources/beta/vector_stores/test_file_batches.py b/tests/api_resources/beta/vector_stores/test_file_batches.py index 631f2669ad..3281622695 100644 --- a/tests/api_resources/beta/vector_stores/test_file_batches.py +++ b/tests/api_resources/beta/vector_stores/test_file_batches.py @@ -24,7 +24,7 @@ class TestFileBatches: @parametrize def test_method_create(self, client: OpenAI) -> None: file_batch = client.beta.vector_stores.file_batches.create( - "vs_abc123", + vector_store_id="vs_abc123", file_ids=["string"], ) assert_matches_type(VectorStoreFileBatch, file_batch, path=["response"]) @@ -32,7 +32,7 @@ def test_method_create(self, client: OpenAI) -> None: @parametrize def test_method_create_with_all_params(self, client: OpenAI) -> None: file_batch = client.beta.vector_stores.file_batches.create( - "vs_abc123", + vector_store_id="vs_abc123", file_ids=["string"], chunking_strategy={"type": "auto"}, ) @@ -41,7 +41,7 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: @parametrize def test_raw_response_create(self, client: OpenAI) -> None: response = client.beta.vector_stores.file_batches.with_raw_response.create( - "vs_abc123", + vector_store_id="vs_abc123", file_ids=["string"], ) @@ -53,7 +53,7 @@ def test_raw_response_create(self, client: OpenAI) -> None: @parametrize def test_streaming_response_create(self, client: OpenAI) -> None: with client.beta.vector_stores.file_batches.with_streaming_response.create( - "vs_abc123", + vector_store_id="vs_abc123", file_ids=["string"], ) as response: assert not response.is_closed @@ -68,14 +68,14 @@ def test_streaming_response_create(self, client: OpenAI) -> None: def test_path_params_create(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"): client.beta.vector_stores.file_batches.with_raw_response.create( - "", + vector_store_id="", file_ids=["string"], ) @parametrize def test_method_retrieve(self, client: OpenAI) -> None: file_batch = client.beta.vector_stores.file_batches.retrieve( - "vsfb_abc123", + batch_id="vsfb_abc123", vector_store_id="vs_abc123", ) assert_matches_type(VectorStoreFileBatch, file_batch, path=["response"]) @@ -83,7 +83,7 @@ def test_method_retrieve(self, client: OpenAI) -> None: @parametrize def test_raw_response_retrieve(self, client: OpenAI) -> None: response = client.beta.vector_stores.file_batches.with_raw_response.retrieve( - "vsfb_abc123", + batch_id="vsfb_abc123", vector_store_id="vs_abc123", ) @@ -95,7 +95,7 @@ def test_raw_response_retrieve(self, client: OpenAI) -> None: @parametrize def test_streaming_response_retrieve(self, client: OpenAI) -> None: with client.beta.vector_stores.file_batches.with_streaming_response.retrieve( - "vsfb_abc123", + batch_id="vsfb_abc123", vector_store_id="vs_abc123", ) as response: assert not response.is_closed @@ -110,29 +110,29 @@ def test_streaming_response_retrieve(self, client: OpenAI) -> None: def test_path_params_retrieve(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"): client.beta.vector_stores.file_batches.with_raw_response.retrieve( - "vsfb_abc123", + batch_id="vsfb_abc123", vector_store_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `batch_id` but received ''"): client.beta.vector_stores.file_batches.with_raw_response.retrieve( - "", + batch_id="", vector_store_id="vs_abc123", ) @parametrize def test_method_cancel(self, client: OpenAI) -> None: file_batch = client.beta.vector_stores.file_batches.cancel( - "string", - vector_store_id="string", + batch_id="batch_id", + vector_store_id="vector_store_id", ) assert_matches_type(VectorStoreFileBatch, file_batch, path=["response"]) @parametrize def test_raw_response_cancel(self, client: OpenAI) -> None: response = client.beta.vector_stores.file_batches.with_raw_response.cancel( - "string", - vector_store_id="string", + batch_id="batch_id", + vector_store_id="vector_store_id", ) assert response.is_closed is True @@ -143,8 +143,8 @@ def test_raw_response_cancel(self, client: OpenAI) -> None: @parametrize def test_streaming_response_cancel(self, client: OpenAI) -> None: with client.beta.vector_stores.file_batches.with_streaming_response.cancel( - "string", - vector_store_id="string", + batch_id="batch_id", + vector_store_id="vector_store_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -158,31 +158,31 @@ def test_streaming_response_cancel(self, client: OpenAI) -> None: def test_path_params_cancel(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"): client.beta.vector_stores.file_batches.with_raw_response.cancel( - "string", + batch_id="batch_id", vector_store_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `batch_id` but received ''"): client.beta.vector_stores.file_batches.with_raw_response.cancel( - "", - vector_store_id="string", + batch_id="", + vector_store_id="vector_store_id", ) @parametrize def test_method_list_files(self, client: OpenAI) -> None: file_batch = client.beta.vector_stores.file_batches.list_files( - "string", - vector_store_id="string", + batch_id="batch_id", + vector_store_id="vector_store_id", ) assert_matches_type(SyncCursorPage[VectorStoreFile], file_batch, path=["response"]) @parametrize def test_method_list_files_with_all_params(self, client: OpenAI) -> None: file_batch = client.beta.vector_stores.file_batches.list_files( - "string", - vector_store_id="string", - after="string", - before="string", + batch_id="batch_id", + vector_store_id="vector_store_id", + after="after", + before="before", filter="in_progress", limit=0, order="asc", @@ -192,8 +192,8 @@ def test_method_list_files_with_all_params(self, client: OpenAI) -> None: @parametrize def test_raw_response_list_files(self, client: OpenAI) -> None: response = client.beta.vector_stores.file_batches.with_raw_response.list_files( - "string", - vector_store_id="string", + batch_id="batch_id", + vector_store_id="vector_store_id", ) assert response.is_closed is True @@ -204,8 +204,8 @@ def test_raw_response_list_files(self, client: OpenAI) -> None: @parametrize def test_streaming_response_list_files(self, client: OpenAI) -> None: with client.beta.vector_stores.file_batches.with_streaming_response.list_files( - "string", - vector_store_id="string", + batch_id="batch_id", + vector_store_id="vector_store_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -219,14 +219,14 @@ def test_streaming_response_list_files(self, client: OpenAI) -> None: def test_path_params_list_files(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"): client.beta.vector_stores.file_batches.with_raw_response.list_files( - "string", + batch_id="batch_id", vector_store_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `batch_id` but received ''"): client.beta.vector_stores.file_batches.with_raw_response.list_files( - "", - vector_store_id="string", + batch_id="", + vector_store_id="vector_store_id", ) @@ -236,7 +236,7 @@ class TestAsyncFileBatches: @parametrize async def test_method_create(self, async_client: AsyncOpenAI) -> None: file_batch = await async_client.beta.vector_stores.file_batches.create( - "vs_abc123", + vector_store_id="vs_abc123", file_ids=["string"], ) assert_matches_type(VectorStoreFileBatch, file_batch, path=["response"]) @@ -244,7 +244,7 @@ async def test_method_create(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> None: file_batch = await async_client.beta.vector_stores.file_batches.create( - "vs_abc123", + vector_store_id="vs_abc123", file_ids=["string"], chunking_strategy={"type": "auto"}, ) @@ -253,7 +253,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> @parametrize async def test_raw_response_create(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.vector_stores.file_batches.with_raw_response.create( - "vs_abc123", + vector_store_id="vs_abc123", file_ids=["string"], ) @@ -265,7 +265,7 @@ async def test_raw_response_create(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.vector_stores.file_batches.with_streaming_response.create( - "vs_abc123", + vector_store_id="vs_abc123", file_ids=["string"], ) as response: assert not response.is_closed @@ -280,14 +280,14 @@ async def test_streaming_response_create(self, async_client: AsyncOpenAI) -> Non async def test_path_params_create(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"): await async_client.beta.vector_stores.file_batches.with_raw_response.create( - "", + vector_store_id="", file_ids=["string"], ) @parametrize async def test_method_retrieve(self, async_client: AsyncOpenAI) -> None: file_batch = await async_client.beta.vector_stores.file_batches.retrieve( - "vsfb_abc123", + batch_id="vsfb_abc123", vector_store_id="vs_abc123", ) assert_matches_type(VectorStoreFileBatch, file_batch, path=["response"]) @@ -295,7 +295,7 @@ async def test_method_retrieve(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.vector_stores.file_batches.with_raw_response.retrieve( - "vsfb_abc123", + batch_id="vsfb_abc123", vector_store_id="vs_abc123", ) @@ -307,7 +307,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.vector_stores.file_batches.with_streaming_response.retrieve( - "vsfb_abc123", + batch_id="vsfb_abc123", vector_store_id="vs_abc123", ) as response: assert not response.is_closed @@ -322,29 +322,29 @@ async def test_streaming_response_retrieve(self, async_client: AsyncOpenAI) -> N async def test_path_params_retrieve(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"): await async_client.beta.vector_stores.file_batches.with_raw_response.retrieve( - "vsfb_abc123", + batch_id="vsfb_abc123", vector_store_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `batch_id` but received ''"): await async_client.beta.vector_stores.file_batches.with_raw_response.retrieve( - "", + batch_id="", vector_store_id="vs_abc123", ) @parametrize async def test_method_cancel(self, async_client: AsyncOpenAI) -> None: file_batch = await async_client.beta.vector_stores.file_batches.cancel( - "string", - vector_store_id="string", + batch_id="batch_id", + vector_store_id="vector_store_id", ) assert_matches_type(VectorStoreFileBatch, file_batch, path=["response"]) @parametrize async def test_raw_response_cancel(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.vector_stores.file_batches.with_raw_response.cancel( - "string", - vector_store_id="string", + batch_id="batch_id", + vector_store_id="vector_store_id", ) assert response.is_closed is True @@ -355,8 +355,8 @@ async def test_raw_response_cancel(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_cancel(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.vector_stores.file_batches.with_streaming_response.cancel( - "string", - vector_store_id="string", + batch_id="batch_id", + vector_store_id="vector_store_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -370,31 +370,31 @@ async def test_streaming_response_cancel(self, async_client: AsyncOpenAI) -> Non async def test_path_params_cancel(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"): await async_client.beta.vector_stores.file_batches.with_raw_response.cancel( - "string", + batch_id="batch_id", vector_store_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `batch_id` but received ''"): await async_client.beta.vector_stores.file_batches.with_raw_response.cancel( - "", - vector_store_id="string", + batch_id="", + vector_store_id="vector_store_id", ) @parametrize async def test_method_list_files(self, async_client: AsyncOpenAI) -> None: file_batch = await async_client.beta.vector_stores.file_batches.list_files( - "string", - vector_store_id="string", + batch_id="batch_id", + vector_store_id="vector_store_id", ) assert_matches_type(AsyncCursorPage[VectorStoreFile], file_batch, path=["response"]) @parametrize async def test_method_list_files_with_all_params(self, async_client: AsyncOpenAI) -> None: file_batch = await async_client.beta.vector_stores.file_batches.list_files( - "string", - vector_store_id="string", - after="string", - before="string", + batch_id="batch_id", + vector_store_id="vector_store_id", + after="after", + before="before", filter="in_progress", limit=0, order="asc", @@ -404,8 +404,8 @@ async def test_method_list_files_with_all_params(self, async_client: AsyncOpenAI @parametrize async def test_raw_response_list_files(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.vector_stores.file_batches.with_raw_response.list_files( - "string", - vector_store_id="string", + batch_id="batch_id", + vector_store_id="vector_store_id", ) assert response.is_closed is True @@ -416,8 +416,8 @@ async def test_raw_response_list_files(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_list_files(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.vector_stores.file_batches.with_streaming_response.list_files( - "string", - vector_store_id="string", + batch_id="batch_id", + vector_store_id="vector_store_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -431,12 +431,12 @@ async def test_streaming_response_list_files(self, async_client: AsyncOpenAI) -> async def test_path_params_list_files(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"): await async_client.beta.vector_stores.file_batches.with_raw_response.list_files( - "string", + batch_id="batch_id", vector_store_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `batch_id` but received ''"): await async_client.beta.vector_stores.file_batches.with_raw_response.list_files( - "", - vector_store_id="string", + batch_id="", + vector_store_id="vector_store_id", ) diff --git a/tests/api_resources/beta/vector_stores/test_files.py b/tests/api_resources/beta/vector_stores/test_files.py index 36622e699b..29fc28f39d 100644 --- a/tests/api_resources/beta/vector_stores/test_files.py +++ b/tests/api_resources/beta/vector_stores/test_files.py @@ -24,16 +24,16 @@ class TestFiles: @parametrize def test_method_create(self, client: OpenAI) -> None: file = client.beta.vector_stores.files.create( - "vs_abc123", - file_id="string", + vector_store_id="vs_abc123", + file_id="file_id", ) assert_matches_type(VectorStoreFile, file, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: OpenAI) -> None: file = client.beta.vector_stores.files.create( - "vs_abc123", - file_id="string", + vector_store_id="vs_abc123", + file_id="file_id", chunking_strategy={"type": "auto"}, ) assert_matches_type(VectorStoreFile, file, path=["response"]) @@ -41,8 +41,8 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: @parametrize def test_raw_response_create(self, client: OpenAI) -> None: response = client.beta.vector_stores.files.with_raw_response.create( - "vs_abc123", - file_id="string", + vector_store_id="vs_abc123", + file_id="file_id", ) assert response.is_closed is True @@ -53,8 +53,8 @@ def test_raw_response_create(self, client: OpenAI) -> None: @parametrize def test_streaming_response_create(self, client: OpenAI) -> None: with client.beta.vector_stores.files.with_streaming_response.create( - "vs_abc123", - file_id="string", + vector_store_id="vs_abc123", + file_id="file_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -68,14 +68,14 @@ def test_streaming_response_create(self, client: OpenAI) -> None: def test_path_params_create(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"): client.beta.vector_stores.files.with_raw_response.create( - "", - file_id="string", + vector_store_id="", + file_id="file_id", ) @parametrize def test_method_retrieve(self, client: OpenAI) -> None: file = client.beta.vector_stores.files.retrieve( - "file-abc123", + file_id="file-abc123", vector_store_id="vs_abc123", ) assert_matches_type(VectorStoreFile, file, path=["response"]) @@ -83,7 +83,7 @@ def test_method_retrieve(self, client: OpenAI) -> None: @parametrize def test_raw_response_retrieve(self, client: OpenAI) -> None: response = client.beta.vector_stores.files.with_raw_response.retrieve( - "file-abc123", + file_id="file-abc123", vector_store_id="vs_abc123", ) @@ -95,7 +95,7 @@ def test_raw_response_retrieve(self, client: OpenAI) -> None: @parametrize def test_streaming_response_retrieve(self, client: OpenAI) -> None: with client.beta.vector_stores.files.with_streaming_response.retrieve( - "file-abc123", + file_id="file-abc123", vector_store_id="vs_abc123", ) as response: assert not response.is_closed @@ -110,29 +110,29 @@ def test_streaming_response_retrieve(self, client: OpenAI) -> None: def test_path_params_retrieve(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"): client.beta.vector_stores.files.with_raw_response.retrieve( - "file-abc123", + file_id="file-abc123", vector_store_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"): client.beta.vector_stores.files.with_raw_response.retrieve( - "", + file_id="", vector_store_id="vs_abc123", ) @parametrize def test_method_list(self, client: OpenAI) -> None: file = client.beta.vector_stores.files.list( - "string", + vector_store_id="vector_store_id", ) assert_matches_type(SyncCursorPage[VectorStoreFile], file, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: OpenAI) -> None: file = client.beta.vector_stores.files.list( - "string", - after="string", - before="string", + vector_store_id="vector_store_id", + after="after", + before="before", filter="in_progress", limit=0, order="asc", @@ -142,7 +142,7 @@ def test_method_list_with_all_params(self, client: OpenAI) -> None: @parametrize def test_raw_response_list(self, client: OpenAI) -> None: response = client.beta.vector_stores.files.with_raw_response.list( - "string", + vector_store_id="vector_store_id", ) assert response.is_closed is True @@ -153,7 +153,7 @@ def test_raw_response_list(self, client: OpenAI) -> None: @parametrize def test_streaming_response_list(self, client: OpenAI) -> None: with client.beta.vector_stores.files.with_streaming_response.list( - "string", + vector_store_id="vector_store_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -167,22 +167,22 @@ def test_streaming_response_list(self, client: OpenAI) -> None: def test_path_params_list(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"): client.beta.vector_stores.files.with_raw_response.list( - "", + vector_store_id="", ) @parametrize def test_method_delete(self, client: OpenAI) -> None: file = client.beta.vector_stores.files.delete( - "string", - vector_store_id="string", + file_id="file_id", + vector_store_id="vector_store_id", ) assert_matches_type(VectorStoreFileDeleted, file, path=["response"]) @parametrize def test_raw_response_delete(self, client: OpenAI) -> None: response = client.beta.vector_stores.files.with_raw_response.delete( - "string", - vector_store_id="string", + file_id="file_id", + vector_store_id="vector_store_id", ) assert response.is_closed is True @@ -193,8 +193,8 @@ def test_raw_response_delete(self, client: OpenAI) -> None: @parametrize def test_streaming_response_delete(self, client: OpenAI) -> None: with client.beta.vector_stores.files.with_streaming_response.delete( - "string", - vector_store_id="string", + file_id="file_id", + vector_store_id="vector_store_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -208,14 +208,14 @@ def test_streaming_response_delete(self, client: OpenAI) -> None: def test_path_params_delete(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"): client.beta.vector_stores.files.with_raw_response.delete( - "string", + file_id="file_id", vector_store_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"): client.beta.vector_stores.files.with_raw_response.delete( - "", - vector_store_id="string", + file_id="", + vector_store_id="vector_store_id", ) @@ -225,16 +225,16 @@ class TestAsyncFiles: @parametrize async def test_method_create(self, async_client: AsyncOpenAI) -> None: file = await async_client.beta.vector_stores.files.create( - "vs_abc123", - file_id="string", + vector_store_id="vs_abc123", + file_id="file_id", ) assert_matches_type(VectorStoreFile, file, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> None: file = await async_client.beta.vector_stores.files.create( - "vs_abc123", - file_id="string", + vector_store_id="vs_abc123", + file_id="file_id", chunking_strategy={"type": "auto"}, ) assert_matches_type(VectorStoreFile, file, path=["response"]) @@ -242,8 +242,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> @parametrize async def test_raw_response_create(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.vector_stores.files.with_raw_response.create( - "vs_abc123", - file_id="string", + vector_store_id="vs_abc123", + file_id="file_id", ) assert response.is_closed is True @@ -254,8 +254,8 @@ async def test_raw_response_create(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.vector_stores.files.with_streaming_response.create( - "vs_abc123", - file_id="string", + vector_store_id="vs_abc123", + file_id="file_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -269,14 +269,14 @@ async def test_streaming_response_create(self, async_client: AsyncOpenAI) -> Non async def test_path_params_create(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"): await async_client.beta.vector_stores.files.with_raw_response.create( - "", - file_id="string", + vector_store_id="", + file_id="file_id", ) @parametrize async def test_method_retrieve(self, async_client: AsyncOpenAI) -> None: file = await async_client.beta.vector_stores.files.retrieve( - "file-abc123", + file_id="file-abc123", vector_store_id="vs_abc123", ) assert_matches_type(VectorStoreFile, file, path=["response"]) @@ -284,7 +284,7 @@ async def test_method_retrieve(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.vector_stores.files.with_raw_response.retrieve( - "file-abc123", + file_id="file-abc123", vector_store_id="vs_abc123", ) @@ -296,7 +296,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.vector_stores.files.with_streaming_response.retrieve( - "file-abc123", + file_id="file-abc123", vector_store_id="vs_abc123", ) as response: assert not response.is_closed @@ -311,29 +311,29 @@ async def test_streaming_response_retrieve(self, async_client: AsyncOpenAI) -> N async def test_path_params_retrieve(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"): await async_client.beta.vector_stores.files.with_raw_response.retrieve( - "file-abc123", + file_id="file-abc123", vector_store_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"): await async_client.beta.vector_stores.files.with_raw_response.retrieve( - "", + file_id="", vector_store_id="vs_abc123", ) @parametrize async def test_method_list(self, async_client: AsyncOpenAI) -> None: file = await async_client.beta.vector_stores.files.list( - "string", + vector_store_id="vector_store_id", ) assert_matches_type(AsyncCursorPage[VectorStoreFile], file, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOpenAI) -> None: file = await async_client.beta.vector_stores.files.list( - "string", - after="string", - before="string", + vector_store_id="vector_store_id", + after="after", + before="before", filter="in_progress", limit=0, order="asc", @@ -343,7 +343,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOpenAI) -> N @parametrize async def test_raw_response_list(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.vector_stores.files.with_raw_response.list( - "string", + vector_store_id="vector_store_id", ) assert response.is_closed is True @@ -354,7 +354,7 @@ async def test_raw_response_list(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.vector_stores.files.with_streaming_response.list( - "string", + vector_store_id="vector_store_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -368,22 +368,22 @@ async def test_streaming_response_list(self, async_client: AsyncOpenAI) -> None: async def test_path_params_list(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"): await async_client.beta.vector_stores.files.with_raw_response.list( - "", + vector_store_id="", ) @parametrize async def test_method_delete(self, async_client: AsyncOpenAI) -> None: file = await async_client.beta.vector_stores.files.delete( - "string", - vector_store_id="string", + file_id="file_id", + vector_store_id="vector_store_id", ) assert_matches_type(VectorStoreFileDeleted, file, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncOpenAI) -> None: response = await async_client.beta.vector_stores.files.with_raw_response.delete( - "string", - vector_store_id="string", + file_id="file_id", + vector_store_id="vector_store_id", ) assert response.is_closed is True @@ -394,8 +394,8 @@ async def test_raw_response_delete(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncOpenAI) -> None: async with async_client.beta.vector_stores.files.with_streaming_response.delete( - "string", - vector_store_id="string", + file_id="file_id", + vector_store_id="vector_store_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -409,12 +409,12 @@ async def test_streaming_response_delete(self, async_client: AsyncOpenAI) -> Non async def test_path_params_delete(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"): await async_client.beta.vector_stores.files.with_raw_response.delete( - "string", + file_id="file_id", vector_store_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"): await async_client.beta.vector_stores.files.with_raw_response.delete( - "", - vector_store_id="string", + file_id="", + vector_store_id="vector_store_id", ) diff --git a/tests/api_resources/chat/test_completions.py b/tests/api_resources/chat/test_completions.py index 5cb2a8c717..ca5cada7f3 100644 --- a/tests/api_resources/chat/test_completions.py +++ b/tests/api_resources/chat/test_completions.py @@ -24,7 +24,7 @@ def test_method_create_overload_1(self, client: OpenAI) -> None: completion = client.chat.completions.create( messages=[ { - "content": "string", + "content": "content", "role": "system", } ], @@ -37,9 +37,9 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: completion = client.chat.completions.create( messages=[ { - "content": "string", + "content": "content", "role": "system", - "name": "string", + "name": "name", } ], model="gpt-4-turbo", @@ -47,8 +47,8 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: function_call="none", functions=[ { - "description": "string", - "name": "string", + "description": "description", + "name": "name", "parameters": {"foo": "bar"}, } ], @@ -70,24 +70,24 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: { "type": "function", "function": { - "description": "string", - "name": "string", + "description": "description", + "name": "name", "parameters": {"foo": "bar"}, }, }, { "type": "function", "function": { - "description": "string", - "name": "string", + "description": "description", + "name": "name", "parameters": {"foo": "bar"}, }, }, { "type": "function", "function": { - "description": "string", - "name": "string", + "description": "description", + "name": "name", "parameters": {"foo": "bar"}, }, }, @@ -103,7 +103,7 @@ def test_raw_response_create_overload_1(self, client: OpenAI) -> None: response = client.chat.completions.with_raw_response.create( messages=[ { - "content": "string", + "content": "content", "role": "system", } ], @@ -120,7 +120,7 @@ def test_streaming_response_create_overload_1(self, client: OpenAI) -> None: with client.chat.completions.with_streaming_response.create( messages=[ { - "content": "string", + "content": "content", "role": "system", } ], @@ -139,7 +139,7 @@ def test_method_create_overload_2(self, client: OpenAI) -> None: completion_stream = client.chat.completions.create( messages=[ { - "content": "string", + "content": "content", "role": "system", } ], @@ -153,9 +153,9 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: completion_stream = client.chat.completions.create( messages=[ { - "content": "string", + "content": "content", "role": "system", - "name": "string", + "name": "name", } ], model="gpt-4-turbo", @@ -164,8 +164,8 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: function_call="none", functions=[ { - "description": "string", - "name": "string", + "description": "description", + "name": "name", "parameters": {"foo": "bar"}, } ], @@ -186,24 +186,24 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: { "type": "function", "function": { - "description": "string", - "name": "string", + "description": "description", + "name": "name", "parameters": {"foo": "bar"}, }, }, { "type": "function", "function": { - "description": "string", - "name": "string", + "description": "description", + "name": "name", "parameters": {"foo": "bar"}, }, }, { "type": "function", "function": { - "description": "string", - "name": "string", + "description": "description", + "name": "name", "parameters": {"foo": "bar"}, }, }, @@ -219,7 +219,7 @@ def test_raw_response_create_overload_2(self, client: OpenAI) -> None: response = client.chat.completions.with_raw_response.create( messages=[ { - "content": "string", + "content": "content", "role": "system", } ], @@ -236,7 +236,7 @@ def test_streaming_response_create_overload_2(self, client: OpenAI) -> None: with client.chat.completions.with_streaming_response.create( messages=[ { - "content": "string", + "content": "content", "role": "system", } ], @@ -260,7 +260,7 @@ async def test_method_create_overload_1(self, async_client: AsyncOpenAI) -> None completion = await async_client.chat.completions.create( messages=[ { - "content": "string", + "content": "content", "role": "system", } ], @@ -273,9 +273,9 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn completion = await async_client.chat.completions.create( messages=[ { - "content": "string", + "content": "content", "role": "system", - "name": "string", + "name": "name", } ], model="gpt-4-turbo", @@ -283,8 +283,8 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn function_call="none", functions=[ { - "description": "string", - "name": "string", + "description": "description", + "name": "name", "parameters": {"foo": "bar"}, } ], @@ -306,24 +306,24 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn { "type": "function", "function": { - "description": "string", - "name": "string", + "description": "description", + "name": "name", "parameters": {"foo": "bar"}, }, }, { "type": "function", "function": { - "description": "string", - "name": "string", + "description": "description", + "name": "name", "parameters": {"foo": "bar"}, }, }, { "type": "function", "function": { - "description": "string", - "name": "string", + "description": "description", + "name": "name", "parameters": {"foo": "bar"}, }, }, @@ -339,7 +339,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncOpenAI) - response = await async_client.chat.completions.with_raw_response.create( messages=[ { - "content": "string", + "content": "content", "role": "system", } ], @@ -356,7 +356,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncOpe async with async_client.chat.completions.with_streaming_response.create( messages=[ { - "content": "string", + "content": "content", "role": "system", } ], @@ -375,7 +375,7 @@ async def test_method_create_overload_2(self, async_client: AsyncOpenAI) -> None completion_stream = await async_client.chat.completions.create( messages=[ { - "content": "string", + "content": "content", "role": "system", } ], @@ -389,9 +389,9 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn completion_stream = await async_client.chat.completions.create( messages=[ { - "content": "string", + "content": "content", "role": "system", - "name": "string", + "name": "name", } ], model="gpt-4-turbo", @@ -400,8 +400,8 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn function_call="none", functions=[ { - "description": "string", - "name": "string", + "description": "description", + "name": "name", "parameters": {"foo": "bar"}, } ], @@ -422,24 +422,24 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn { "type": "function", "function": { - "description": "string", - "name": "string", + "description": "description", + "name": "name", "parameters": {"foo": "bar"}, }, }, { "type": "function", "function": { - "description": "string", - "name": "string", + "description": "description", + "name": "name", "parameters": {"foo": "bar"}, }, }, { "type": "function", "function": { - "description": "string", - "name": "string", + "description": "description", + "name": "name", "parameters": {"foo": "bar"}, }, }, @@ -455,7 +455,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncOpenAI) - response = await async_client.chat.completions.with_raw_response.create( messages=[ { - "content": "string", + "content": "content", "role": "system", } ], @@ -472,7 +472,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncOpe async with async_client.chat.completions.with_streaming_response.create( messages=[ { - "content": "string", + "content": "content", "role": "system", } ], diff --git a/tests/api_resources/fine_tuning/jobs/test_checkpoints.py b/tests/api_resources/fine_tuning/jobs/test_checkpoints.py index 915d5c6f63..e65f84c818 100644 --- a/tests/api_resources/fine_tuning/jobs/test_checkpoints.py +++ b/tests/api_resources/fine_tuning/jobs/test_checkpoints.py @@ -21,15 +21,15 @@ class TestCheckpoints: @parametrize def test_method_list(self, client: OpenAI) -> None: checkpoint = client.fine_tuning.jobs.checkpoints.list( - "ft-AF1WoRqd3aJAHsqc9NY7iL8F", + fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F", ) assert_matches_type(SyncCursorPage[FineTuningJobCheckpoint], checkpoint, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: OpenAI) -> None: checkpoint = client.fine_tuning.jobs.checkpoints.list( - "ft-AF1WoRqd3aJAHsqc9NY7iL8F", - after="string", + fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F", + after="after", limit=0, ) assert_matches_type(SyncCursorPage[FineTuningJobCheckpoint], checkpoint, path=["response"]) @@ -37,7 +37,7 @@ def test_method_list_with_all_params(self, client: OpenAI) -> None: @parametrize def test_raw_response_list(self, client: OpenAI) -> None: response = client.fine_tuning.jobs.checkpoints.with_raw_response.list( - "ft-AF1WoRqd3aJAHsqc9NY7iL8F", + fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F", ) assert response.is_closed is True @@ -48,7 +48,7 @@ def test_raw_response_list(self, client: OpenAI) -> None: @parametrize def test_streaming_response_list(self, client: OpenAI) -> None: with client.fine_tuning.jobs.checkpoints.with_streaming_response.list( - "ft-AF1WoRqd3aJAHsqc9NY7iL8F", + fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -62,7 +62,7 @@ def test_streaming_response_list(self, client: OpenAI) -> None: def test_path_params_list(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `fine_tuning_job_id` but received ''"): client.fine_tuning.jobs.checkpoints.with_raw_response.list( - "", + fine_tuning_job_id="", ) @@ -72,15 +72,15 @@ class TestAsyncCheckpoints: @parametrize async def test_method_list(self, async_client: AsyncOpenAI) -> None: checkpoint = await async_client.fine_tuning.jobs.checkpoints.list( - "ft-AF1WoRqd3aJAHsqc9NY7iL8F", + fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F", ) assert_matches_type(AsyncCursorPage[FineTuningJobCheckpoint], checkpoint, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOpenAI) -> None: checkpoint = await async_client.fine_tuning.jobs.checkpoints.list( - "ft-AF1WoRqd3aJAHsqc9NY7iL8F", - after="string", + fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F", + after="after", limit=0, ) assert_matches_type(AsyncCursorPage[FineTuningJobCheckpoint], checkpoint, path=["response"]) @@ -88,7 +88,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncOpenAI) -> N @parametrize async def test_raw_response_list(self, async_client: AsyncOpenAI) -> None: response = await async_client.fine_tuning.jobs.checkpoints.with_raw_response.list( - "ft-AF1WoRqd3aJAHsqc9NY7iL8F", + fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F", ) assert response.is_closed is True @@ -99,7 +99,7 @@ async def test_raw_response_list(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncOpenAI) -> None: async with async_client.fine_tuning.jobs.checkpoints.with_streaming_response.list( - "ft-AF1WoRqd3aJAHsqc9NY7iL8F", + fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -113,5 +113,5 @@ async def test_streaming_response_list(self, async_client: AsyncOpenAI) -> None: async def test_path_params_list(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `fine_tuning_job_id` but received ''"): await async_client.fine_tuning.jobs.checkpoints.with_raw_response.list( - "", + fine_tuning_job_id="", ) diff --git a/tests/api_resources/fine_tuning/test_jobs.py b/tests/api_resources/fine_tuning/test_jobs.py index 1ff6d63b31..3353547ad7 100644 --- a/tests/api_resources/fine_tuning/test_jobs.py +++ b/tests/api_resources/fine_tuning/test_jobs.py @@ -44,8 +44,8 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: "type": "wandb", "wandb": { "project": "my-wandb-project", - "name": "string", - "entity": "string", + "name": "name", + "entity": "entity", "tags": ["custom-tag", "custom-tag", "custom-tag"], }, }, @@ -53,8 +53,8 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: "type": "wandb", "wandb": { "project": "my-wandb-project", - "name": "string", - "entity": "string", + "name": "name", + "entity": "entity", "tags": ["custom-tag", "custom-tag", "custom-tag"], }, }, @@ -62,8 +62,8 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: "type": "wandb", "wandb": { "project": "my-wandb-project", - "name": "string", - "entity": "string", + "name": "name", + "entity": "entity", "tags": ["custom-tag", "custom-tag", "custom-tag"], }, }, @@ -146,7 +146,7 @@ def test_method_list(self, client: OpenAI) -> None: @parametrize def test_method_list_with_all_params(self, client: OpenAI) -> None: job = client.fine_tuning.jobs.list( - after="string", + after="after", limit=0, ) assert_matches_type(SyncCursorPage[FineTuningJob], job, path=["response"]) @@ -212,15 +212,15 @@ def test_path_params_cancel(self, client: OpenAI) -> None: @parametrize def test_method_list_events(self, client: OpenAI) -> None: job = client.fine_tuning.jobs.list_events( - "ft-AF1WoRqd3aJAHsqc9NY7iL8F", + fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F", ) assert_matches_type(SyncCursorPage[FineTuningJobEvent], job, path=["response"]) @parametrize def test_method_list_events_with_all_params(self, client: OpenAI) -> None: job = client.fine_tuning.jobs.list_events( - "ft-AF1WoRqd3aJAHsqc9NY7iL8F", - after="string", + fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F", + after="after", limit=0, ) assert_matches_type(SyncCursorPage[FineTuningJobEvent], job, path=["response"]) @@ -228,7 +228,7 @@ def test_method_list_events_with_all_params(self, client: OpenAI) -> None: @parametrize def test_raw_response_list_events(self, client: OpenAI) -> None: response = client.fine_tuning.jobs.with_raw_response.list_events( - "ft-AF1WoRqd3aJAHsqc9NY7iL8F", + fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F", ) assert response.is_closed is True @@ -239,7 +239,7 @@ def test_raw_response_list_events(self, client: OpenAI) -> None: @parametrize def test_streaming_response_list_events(self, client: OpenAI) -> None: with client.fine_tuning.jobs.with_streaming_response.list_events( - "ft-AF1WoRqd3aJAHsqc9NY7iL8F", + fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -253,7 +253,7 @@ def test_streaming_response_list_events(self, client: OpenAI) -> None: def test_path_params_list_events(self, client: OpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `fine_tuning_job_id` but received ''"): client.fine_tuning.jobs.with_raw_response.list_events( - "", + fine_tuning_job_id="", ) @@ -283,8 +283,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> "type": "wandb", "wandb": { "project": "my-wandb-project", - "name": "string", - "entity": "string", + "name": "name", + "entity": "entity", "tags": ["custom-tag", "custom-tag", "custom-tag"], }, }, @@ -292,8 +292,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> "type": "wandb", "wandb": { "project": "my-wandb-project", - "name": "string", - "entity": "string", + "name": "name", + "entity": "entity", "tags": ["custom-tag", "custom-tag", "custom-tag"], }, }, @@ -301,8 +301,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> "type": "wandb", "wandb": { "project": "my-wandb-project", - "name": "string", - "entity": "string", + "name": "name", + "entity": "entity", "tags": ["custom-tag", "custom-tag", "custom-tag"], }, }, @@ -385,7 +385,7 @@ async def test_method_list(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOpenAI) -> None: job = await async_client.fine_tuning.jobs.list( - after="string", + after="after", limit=0, ) assert_matches_type(AsyncCursorPage[FineTuningJob], job, path=["response"]) @@ -451,15 +451,15 @@ async def test_path_params_cancel(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_method_list_events(self, async_client: AsyncOpenAI) -> None: job = await async_client.fine_tuning.jobs.list_events( - "ft-AF1WoRqd3aJAHsqc9NY7iL8F", + fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F", ) assert_matches_type(AsyncCursorPage[FineTuningJobEvent], job, path=["response"]) @parametrize async def test_method_list_events_with_all_params(self, async_client: AsyncOpenAI) -> None: job = await async_client.fine_tuning.jobs.list_events( - "ft-AF1WoRqd3aJAHsqc9NY7iL8F", - after="string", + fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F", + after="after", limit=0, ) assert_matches_type(AsyncCursorPage[FineTuningJobEvent], job, path=["response"]) @@ -467,7 +467,7 @@ async def test_method_list_events_with_all_params(self, async_client: AsyncOpenA @parametrize async def test_raw_response_list_events(self, async_client: AsyncOpenAI) -> None: response = await async_client.fine_tuning.jobs.with_raw_response.list_events( - "ft-AF1WoRqd3aJAHsqc9NY7iL8F", + fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F", ) assert response.is_closed is True @@ -478,7 +478,7 @@ async def test_raw_response_list_events(self, async_client: AsyncOpenAI) -> None @parametrize async def test_streaming_response_list_events(self, async_client: AsyncOpenAI) -> None: async with async_client.fine_tuning.jobs.with_streaming_response.list_events( - "ft-AF1WoRqd3aJAHsqc9NY7iL8F", + fine_tuning_job_id="ft-AF1WoRqd3aJAHsqc9NY7iL8F", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -492,5 +492,5 @@ async def test_streaming_response_list_events(self, async_client: AsyncOpenAI) - async def test_path_params_list_events(self, async_client: AsyncOpenAI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `fine_tuning_job_id` but received ''"): await async_client.fine_tuning.jobs.with_raw_response.list_events( - "", + fine_tuning_job_id="", ) diff --git a/tests/api_resources/test_batches.py b/tests/api_resources/test_batches.py index 6f9b598e61..047b8bae12 100644 --- a/tests/api_resources/test_batches.py +++ b/tests/api_resources/test_batches.py @@ -23,7 +23,7 @@ def test_method_create(self, client: OpenAI) -> None: batch = client.batches.create( completion_window="24h", endpoint="/v1/chat/completions", - input_file_id="string", + input_file_id="input_file_id", ) assert_matches_type(Batch, batch, path=["response"]) @@ -32,7 +32,7 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: batch = client.batches.create( completion_window="24h", endpoint="/v1/chat/completions", - input_file_id="string", + input_file_id="input_file_id", metadata={"foo": "string"}, ) assert_matches_type(Batch, batch, path=["response"]) @@ -42,7 +42,7 @@ def test_raw_response_create(self, client: OpenAI) -> None: response = client.batches.with_raw_response.create( completion_window="24h", endpoint="/v1/chat/completions", - input_file_id="string", + input_file_id="input_file_id", ) assert response.is_closed is True @@ -55,7 +55,7 @@ def test_streaming_response_create(self, client: OpenAI) -> None: with client.batches.with_streaming_response.create( completion_window="24h", endpoint="/v1/chat/completions", - input_file_id="string", + input_file_id="input_file_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -68,14 +68,14 @@ def test_streaming_response_create(self, client: OpenAI) -> None: @parametrize def test_method_retrieve(self, client: OpenAI) -> None: batch = client.batches.retrieve( - "string", + "batch_id", ) assert_matches_type(Batch, batch, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: OpenAI) -> None: response = client.batches.with_raw_response.retrieve( - "string", + "batch_id", ) assert response.is_closed is True @@ -86,7 +86,7 @@ def test_raw_response_retrieve(self, client: OpenAI) -> None: @parametrize def test_streaming_response_retrieve(self, client: OpenAI) -> None: with client.batches.with_streaming_response.retrieve( - "string", + "batch_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -111,7 +111,7 @@ def test_method_list(self, client: OpenAI) -> None: @parametrize def test_method_list_with_all_params(self, client: OpenAI) -> None: batch = client.batches.list( - after="string", + after="after", limit=0, ) assert_matches_type(SyncCursorPage[Batch], batch, path=["response"]) @@ -139,14 +139,14 @@ def test_streaming_response_list(self, client: OpenAI) -> None: @parametrize def test_method_cancel(self, client: OpenAI) -> None: batch = client.batches.cancel( - "string", + "batch_id", ) assert_matches_type(Batch, batch, path=["response"]) @parametrize def test_raw_response_cancel(self, client: OpenAI) -> None: response = client.batches.with_raw_response.cancel( - "string", + "batch_id", ) assert response.is_closed is True @@ -157,7 +157,7 @@ def test_raw_response_cancel(self, client: OpenAI) -> None: @parametrize def test_streaming_response_cancel(self, client: OpenAI) -> None: with client.batches.with_streaming_response.cancel( - "string", + "batch_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -183,7 +183,7 @@ async def test_method_create(self, async_client: AsyncOpenAI) -> None: batch = await async_client.batches.create( completion_window="24h", endpoint="/v1/chat/completions", - input_file_id="string", + input_file_id="input_file_id", ) assert_matches_type(Batch, batch, path=["response"]) @@ -192,7 +192,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> batch = await async_client.batches.create( completion_window="24h", endpoint="/v1/chat/completions", - input_file_id="string", + input_file_id="input_file_id", metadata={"foo": "string"}, ) assert_matches_type(Batch, batch, path=["response"]) @@ -202,7 +202,7 @@ async def test_raw_response_create(self, async_client: AsyncOpenAI) -> None: response = await async_client.batches.with_raw_response.create( completion_window="24h", endpoint="/v1/chat/completions", - input_file_id="string", + input_file_id="input_file_id", ) assert response.is_closed is True @@ -215,7 +215,7 @@ async def test_streaming_response_create(self, async_client: AsyncOpenAI) -> Non async with async_client.batches.with_streaming_response.create( completion_window="24h", endpoint="/v1/chat/completions", - input_file_id="string", + input_file_id="input_file_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -228,14 +228,14 @@ async def test_streaming_response_create(self, async_client: AsyncOpenAI) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncOpenAI) -> None: batch = await async_client.batches.retrieve( - "string", + "batch_id", ) assert_matches_type(Batch, batch, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None: response = await async_client.batches.with_raw_response.retrieve( - "string", + "batch_id", ) assert response.is_closed is True @@ -246,7 +246,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOpenAI) -> None: async with async_client.batches.with_streaming_response.retrieve( - "string", + "batch_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -271,7 +271,7 @@ async def test_method_list(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOpenAI) -> None: batch = await async_client.batches.list( - after="string", + after="after", limit=0, ) assert_matches_type(AsyncCursorPage[Batch], batch, path=["response"]) @@ -299,14 +299,14 @@ async def test_streaming_response_list(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_method_cancel(self, async_client: AsyncOpenAI) -> None: batch = await async_client.batches.cancel( - "string", + "batch_id", ) assert_matches_type(Batch, batch, path=["response"]) @parametrize async def test_raw_response_cancel(self, async_client: AsyncOpenAI) -> None: response = await async_client.batches.with_raw_response.cancel( - "string", + "batch_id", ) assert response.is_closed is True @@ -317,7 +317,7 @@ async def test_raw_response_cancel(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_cancel(self, async_client: AsyncOpenAI) -> None: async with async_client.batches.with_streaming_response.cancel( - "string", + "batch_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_files.py b/tests/api_resources/test_files.py index 882f0ddbe7..725e55c193 100644 --- a/tests/api_resources/test_files.py +++ b/tests/api_resources/test_files.py @@ -60,14 +60,14 @@ def test_streaming_response_create(self, client: OpenAI) -> None: @parametrize def test_method_retrieve(self, client: OpenAI) -> None: file = client.files.retrieve( - "string", + "file_id", ) assert_matches_type(FileObject, file, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: OpenAI) -> None: response = client.files.with_raw_response.retrieve( - "string", + "file_id", ) assert response.is_closed is True @@ -78,7 +78,7 @@ def test_raw_response_retrieve(self, client: OpenAI) -> None: @parametrize def test_streaming_response_retrieve(self, client: OpenAI) -> None: with client.files.with_streaming_response.retrieve( - "string", + "file_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -103,7 +103,7 @@ def test_method_list(self, client: OpenAI) -> None: @parametrize def test_method_list_with_all_params(self, client: OpenAI) -> None: file = client.files.list( - purpose="string", + purpose="purpose", ) assert_matches_type(SyncPage[FileObject], file, path=["response"]) @@ -130,14 +130,14 @@ def test_streaming_response_list(self, client: OpenAI) -> None: @parametrize def test_method_delete(self, client: OpenAI) -> None: file = client.files.delete( - "string", + "file_id", ) assert_matches_type(FileDeleted, file, path=["response"]) @parametrize def test_raw_response_delete(self, client: OpenAI) -> None: response = client.files.with_raw_response.delete( - "string", + "file_id", ) assert response.is_closed is True @@ -148,7 +148,7 @@ def test_raw_response_delete(self, client: OpenAI) -> None: @parametrize def test_streaming_response_delete(self, client: OpenAI) -> None: with client.files.with_streaming_response.delete( - "string", + "file_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -168,9 +168,9 @@ def test_path_params_delete(self, client: OpenAI) -> None: @parametrize @pytest.mark.respx(base_url=base_url) def test_method_content(self, client: OpenAI, respx_mock: MockRouter) -> None: - respx_mock.get("/files/string/content").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + respx_mock.get("/files/file_id/content").mock(return_value=httpx.Response(200, json={"foo": "bar"})) file = client.files.content( - "string", + "file_id", ) assert isinstance(file, _legacy_response.HttpxBinaryResponseContent) assert file.json() == {"foo": "bar"} @@ -178,10 +178,10 @@ def test_method_content(self, client: OpenAI, respx_mock: MockRouter) -> None: @parametrize @pytest.mark.respx(base_url=base_url) def test_raw_response_content(self, client: OpenAI, respx_mock: MockRouter) -> None: - respx_mock.get("/files/string/content").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + respx_mock.get("/files/file_id/content").mock(return_value=httpx.Response(200, json={"foo": "bar"})) response = client.files.with_raw_response.content( - "string", + "file_id", ) assert response.is_closed is True @@ -192,9 +192,9 @@ def test_raw_response_content(self, client: OpenAI, respx_mock: MockRouter) -> N @parametrize @pytest.mark.respx(base_url=base_url) def test_streaming_response_content(self, client: OpenAI, respx_mock: MockRouter) -> None: - respx_mock.get("/files/string/content").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + respx_mock.get("/files/file_id/content").mock(return_value=httpx.Response(200, json={"foo": "bar"})) with client.files.with_streaming_response.content( - "string", + "file_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -216,7 +216,7 @@ def test_path_params_content(self, client: OpenAI) -> None: def test_method_retrieve_content(self, client: OpenAI) -> None: with pytest.warns(DeprecationWarning): file = client.files.retrieve_content( - "string", + "file_id", ) assert_matches_type(str, file, path=["response"]) @@ -225,7 +225,7 @@ def test_method_retrieve_content(self, client: OpenAI) -> None: def test_raw_response_retrieve_content(self, client: OpenAI) -> None: with pytest.warns(DeprecationWarning): response = client.files.with_raw_response.retrieve_content( - "string", + "file_id", ) assert response.is_closed is True @@ -237,7 +237,7 @@ def test_raw_response_retrieve_content(self, client: OpenAI) -> None: def test_streaming_response_retrieve_content(self, client: OpenAI) -> None: with pytest.warns(DeprecationWarning): with client.files.with_streaming_response.retrieve_content( - "string", + "file_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -296,14 +296,14 @@ async def test_streaming_response_create(self, async_client: AsyncOpenAI) -> Non @parametrize async def test_method_retrieve(self, async_client: AsyncOpenAI) -> None: file = await async_client.files.retrieve( - "string", + "file_id", ) assert_matches_type(FileObject, file, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None: response = await async_client.files.with_raw_response.retrieve( - "string", + "file_id", ) assert response.is_closed is True @@ -314,7 +314,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncOpenAI) -> None: async with async_client.files.with_streaming_response.retrieve( - "string", + "file_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -339,7 +339,7 @@ async def test_method_list(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncOpenAI) -> None: file = await async_client.files.list( - purpose="string", + purpose="purpose", ) assert_matches_type(AsyncPage[FileObject], file, path=["response"]) @@ -366,14 +366,14 @@ async def test_streaming_response_list(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_method_delete(self, async_client: AsyncOpenAI) -> None: file = await async_client.files.delete( - "string", + "file_id", ) assert_matches_type(FileDeleted, file, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncOpenAI) -> None: response = await async_client.files.with_raw_response.delete( - "string", + "file_id", ) assert response.is_closed is True @@ -384,7 +384,7 @@ async def test_raw_response_delete(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncOpenAI) -> None: async with async_client.files.with_streaming_response.delete( - "string", + "file_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -404,9 +404,9 @@ async def test_path_params_delete(self, async_client: AsyncOpenAI) -> None: @parametrize @pytest.mark.respx(base_url=base_url) async def test_method_content(self, async_client: AsyncOpenAI, respx_mock: MockRouter) -> None: - respx_mock.get("/files/string/content").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + respx_mock.get("/files/file_id/content").mock(return_value=httpx.Response(200, json={"foo": "bar"})) file = await async_client.files.content( - "string", + "file_id", ) assert isinstance(file, _legacy_response.HttpxBinaryResponseContent) assert file.json() == {"foo": "bar"} @@ -414,10 +414,10 @@ async def test_method_content(self, async_client: AsyncOpenAI, respx_mock: MockR @parametrize @pytest.mark.respx(base_url=base_url) async def test_raw_response_content(self, async_client: AsyncOpenAI, respx_mock: MockRouter) -> None: - respx_mock.get("/files/string/content").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + respx_mock.get("/files/file_id/content").mock(return_value=httpx.Response(200, json={"foo": "bar"})) response = await async_client.files.with_raw_response.content( - "string", + "file_id", ) assert response.is_closed is True @@ -428,9 +428,9 @@ async def test_raw_response_content(self, async_client: AsyncOpenAI, respx_mock: @parametrize @pytest.mark.respx(base_url=base_url) async def test_streaming_response_content(self, async_client: AsyncOpenAI, respx_mock: MockRouter) -> None: - respx_mock.get("/files/string/content").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + respx_mock.get("/files/file_id/content").mock(return_value=httpx.Response(200, json={"foo": "bar"})) async with async_client.files.with_streaming_response.content( - "string", + "file_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -452,7 +452,7 @@ async def test_path_params_content(self, async_client: AsyncOpenAI) -> None: async def test_method_retrieve_content(self, async_client: AsyncOpenAI) -> None: with pytest.warns(DeprecationWarning): file = await async_client.files.retrieve_content( - "string", + "file_id", ) assert_matches_type(str, file, path=["response"]) @@ -461,7 +461,7 @@ async def test_method_retrieve_content(self, async_client: AsyncOpenAI) -> None: async def test_raw_response_retrieve_content(self, async_client: AsyncOpenAI) -> None: with pytest.warns(DeprecationWarning): response = await async_client.files.with_raw_response.retrieve_content( - "string", + "file_id", ) assert response.is_closed is True @@ -473,7 +473,7 @@ async def test_raw_response_retrieve_content(self, async_client: AsyncOpenAI) -> async def test_streaming_response_retrieve_content(self, async_client: AsyncOpenAI) -> None: with pytest.warns(DeprecationWarning): async with async_client.files.with_streaming_response.retrieve_content( - "string", + "file_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python"