From 4885602af6d4bdbec46eb59eda4ddb399e8f4230 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 18 Nov 2024 11:37:13 +0000 Subject: [PATCH] chore: rebuild project due to codegen change --- tests/api_resources/test_applications.py | 96 ++----- tests/api_resources/test_chat.py | 312 ++--------------------- tests/api_resources/test_files.py | 36 +-- 3 files changed, 42 insertions(+), 402 deletions(-) diff --git a/tests/api_resources/test_applications.py b/tests/api_resources/test_applications.py index f1063ba3..cdf9faa2 100644 --- a/tests/api_resources/test_applications.py +++ b/tests/api_resources/test_applications.py @@ -24,16 +24,8 @@ def test_method_generate_content(self, client: Writer) -> None: inputs=[ { "id": "id", - "value": ["string", "string", "string"], - }, - { - "id": "id", - "value": ["string", "string", "string"], - }, - { - "id": "id", - "value": ["string", "string", "string"], - }, + "value": ["string"], + } ], ) assert_matches_type(ApplicationGenerateContentResponse, application, path=["response"]) @@ -45,16 +37,8 @@ def test_raw_response_generate_content(self, client: Writer) -> None: inputs=[ { "id": "id", - "value": ["string", "string", "string"], - }, - { - "id": "id", - "value": ["string", "string", "string"], - }, - { - "id": "id", - "value": ["string", "string", "string"], - }, + "value": ["string"], + } ], ) @@ -70,16 +54,8 @@ def test_streaming_response_generate_content(self, client: Writer) -> None: inputs=[ { "id": "id", - "value": ["string", "string", "string"], - }, - { - "id": "id", - "value": ["string", "string", "string"], - }, - { - "id": "id", - "value": ["string", "string", "string"], - }, + "value": ["string"], + } ], ) as response: assert not response.is_closed @@ -98,16 +74,8 @@ def test_path_params_generate_content(self, client: Writer) -> None: inputs=[ { "id": "id", - "value": ["string", "string", "string"], - }, - { - "id": "id", - "value": ["string", "string", "string"], - }, - { - "id": "id", - "value": ["string", "string", "string"], - }, + "value": ["string"], + } ], ) @@ -122,16 +90,8 @@ async def test_method_generate_content(self, async_client: AsyncWriter) -> None: inputs=[ { "id": "id", - "value": ["string", "string", "string"], - }, - { - "id": "id", - "value": ["string", "string", "string"], - }, - { - "id": "id", - "value": ["string", "string", "string"], - }, + "value": ["string"], + } ], ) assert_matches_type(ApplicationGenerateContentResponse, application, path=["response"]) @@ -143,16 +103,8 @@ async def test_raw_response_generate_content(self, async_client: AsyncWriter) -> inputs=[ { "id": "id", - "value": ["string", "string", "string"], - }, - { - "id": "id", - "value": ["string", "string", "string"], - }, - { - "id": "id", - "value": ["string", "string", "string"], - }, + "value": ["string"], + } ], ) @@ -168,16 +120,8 @@ async def test_streaming_response_generate_content(self, async_client: AsyncWrit inputs=[ { "id": "id", - "value": ["string", "string", "string"], - }, - { - "id": "id", - "value": ["string", "string", "string"], - }, - { - "id": "id", - "value": ["string", "string", "string"], - }, + "value": ["string"], + } ], ) as response: assert not response.is_closed @@ -196,15 +140,7 @@ async def test_path_params_generate_content(self, async_client: AsyncWriter) -> inputs=[ { "id": "id", - "value": ["string", "string", "string"], - }, - { - "id": "id", - "value": ["string", "string", "string"], - }, - { - "id": "id", - "value": ["string", "string", "string"], - }, + "value": ["string"], + } ], ) diff --git a/tests/api_resources/test_chat.py b/tests/api_resources/test_chat.py index 0906891a..03c27d4d 100644 --- a/tests/api_resources/test_chat.py +++ b/tests/api_resources/test_chat.py @@ -37,15 +37,7 @@ def test_method_chat_with_all_params_overload_1(self, client: Writer) -> None: { "file_id": "file_id", "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, + } ], "status": "processing", "subqueries": [ @@ -56,53 +48,9 @@ def test_method_chat_with_all_params_overload_1(self, client: Writer) -> None: { "file_id": "file_id", "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, + } ], - }, - { - "answer": "answer", - "query": "query", - "sources": [ - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - ], - }, - { - "answer": "answer", - "query": "query", - "sources": [ - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - ], - }, + } ], }, "name": "name", @@ -125,7 +73,7 @@ def test_method_chat_with_all_params_overload_1(self, client: Writer) -> None: logprobs=True, max_tokens=0, n=0, - stop=["string", "string", "string"], + stop=["string"], stream=False, stream_options={"include_usage": True}, temperature=0, @@ -138,23 +86,7 @@ def test_method_chat_with_all_params_overload_1(self, client: Writer) -> None: "parameters": {"foo": "bar"}, }, "type": "function", - }, - { - "function": { - "name": "name", - "description": "description", - "parameters": {"foo": "bar"}, - }, - "type": "function", - }, - { - "function": { - "name": "name", - "description": "description", - "parameters": {"foo": "bar"}, - }, - "type": "function", - }, + } ], top_p=0, ) @@ -207,15 +139,7 @@ def test_method_chat_with_all_params_overload_2(self, client: Writer) -> None: { "file_id": "file_id", "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, + } ], "status": "processing", "subqueries": [ @@ -226,53 +150,9 @@ def test_method_chat_with_all_params_overload_2(self, client: Writer) -> None: { "file_id": "file_id", "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, + } ], - }, - { - "answer": "answer", - "query": "query", - "sources": [ - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - ], - }, - { - "answer": "answer", - "query": "query", - "sources": [ - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - ], - }, + } ], }, "name": "name", @@ -296,7 +176,7 @@ def test_method_chat_with_all_params_overload_2(self, client: Writer) -> None: logprobs=True, max_tokens=0, n=0, - stop=["string", "string", "string"], + stop=["string"], stream_options={"include_usage": True}, temperature=0, tool_choice={"value": "none"}, @@ -308,23 +188,7 @@ def test_method_chat_with_all_params_overload_2(self, client: Writer) -> None: "parameters": {"foo": "bar"}, }, "type": "function", - }, - { - "function": { - "name": "name", - "description": "description", - "parameters": {"foo": "bar"}, - }, - "type": "function", - }, - { - "function": { - "name": "name", - "description": "description", - "parameters": {"foo": "bar"}, - }, - "type": "function", - }, + } ], top_p=0, ) @@ -381,15 +245,7 @@ async def test_method_chat_with_all_params_overload_1(self, async_client: AsyncW { "file_id": "file_id", "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, + } ], "status": "processing", "subqueries": [ @@ -400,53 +256,9 @@ async def test_method_chat_with_all_params_overload_1(self, async_client: AsyncW { "file_id": "file_id", "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, + } ], - }, - { - "answer": "answer", - "query": "query", - "sources": [ - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - ], - }, - { - "answer": "answer", - "query": "query", - "sources": [ - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - ], - }, + } ], }, "name": "name", @@ -469,7 +281,7 @@ async def test_method_chat_with_all_params_overload_1(self, async_client: AsyncW logprobs=True, max_tokens=0, n=0, - stop=["string", "string", "string"], + stop=["string"], stream=False, stream_options={"include_usage": True}, temperature=0, @@ -482,23 +294,7 @@ async def test_method_chat_with_all_params_overload_1(self, async_client: AsyncW "parameters": {"foo": "bar"}, }, "type": "function", - }, - { - "function": { - "name": "name", - "description": "description", - "parameters": {"foo": "bar"}, - }, - "type": "function", - }, - { - "function": { - "name": "name", - "description": "description", - "parameters": {"foo": "bar"}, - }, - "type": "function", - }, + } ], top_p=0, ) @@ -551,15 +347,7 @@ async def test_method_chat_with_all_params_overload_2(self, async_client: AsyncW { "file_id": "file_id", "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, + } ], "status": "processing", "subqueries": [ @@ -570,53 +358,9 @@ async def test_method_chat_with_all_params_overload_2(self, async_client: AsyncW { "file_id": "file_id", "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, + } ], - }, - { - "answer": "answer", - "query": "query", - "sources": [ - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - ], - }, - { - "answer": "answer", - "query": "query", - "sources": [ - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - { - "file_id": "file_id", - "snippet": "snippet", - }, - ], - }, + } ], }, "name": "name", @@ -640,7 +384,7 @@ async def test_method_chat_with_all_params_overload_2(self, async_client: AsyncW logprobs=True, max_tokens=0, n=0, - stop=["string", "string", "string"], + stop=["string"], stream_options={"include_usage": True}, temperature=0, tool_choice={"value": "none"}, @@ -652,23 +396,7 @@ async def test_method_chat_with_all_params_overload_2(self, async_client: AsyncW "parameters": {"foo": "bar"}, }, "type": "function", - }, - { - "function": { - "name": "name", - "description": "description", - "parameters": {"foo": "bar"}, - }, - "type": "function", - }, - { - "function": { - "name": "name", - "description": "description", - "parameters": {"foo": "bar"}, - }, - "type": "function", - }, + } ], top_p=0, ) diff --git a/tests/api_resources/test_files.py b/tests/api_resources/test_files.py index 6afa628d..90cb5c04 100644 --- a/tests/api_resources/test_files.py +++ b/tests/api_resources/test_files.py @@ -200,22 +200,14 @@ def test_path_params_download(self, client: Writer) -> None: @parametrize def test_method_retry(self, client: Writer) -> None: file = client.files.retry( - file_ids=[ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], + file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ) assert_matches_type(FileRetryResponse, file, path=["response"]) @parametrize def test_raw_response_retry(self, client: Writer) -> None: response = client.files.with_raw_response.retry( - file_ids=[ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], + file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ) assert response.is_closed is True @@ -226,11 +218,7 @@ def test_raw_response_retry(self, client: Writer) -> None: @parametrize def test_streaming_response_retry(self, client: Writer) -> None: with client.files.with_streaming_response.retry( - file_ids=[ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], + file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -451,22 +439,14 @@ async def test_path_params_download(self, async_client: AsyncWriter) -> None: @parametrize async def test_method_retry(self, async_client: AsyncWriter) -> None: file = await async_client.files.retry( - file_ids=[ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], + file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ) assert_matches_type(FileRetryResponse, file, path=["response"]) @parametrize async def test_raw_response_retry(self, async_client: AsyncWriter) -> None: response = await async_client.files.with_raw_response.retry( - file_ids=[ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], + file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ) assert response.is_closed is True @@ -477,11 +457,7 @@ async def test_raw_response_retry(self, async_client: AsyncWriter) -> None: @parametrize async def test_streaming_response_retry(self, async_client: AsyncWriter) -> None: async with async_client.files.with_streaming_response.retry( - file_ids=[ - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - ], + file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python"