From fa0822922fe324cbba177f60d53da3638b4a0c1c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 19:46:31 +0000 Subject: [PATCH] chore(examples): minor formatting changes (#633) --- tests/api_resources/test_messages.py | 88 ++++++++++++++-------------- tests/test_client.py | 8 +-- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/tests/api_resources/test_messages.py b/tests/api_resources/test_messages.py index 94dc8cc6..e3685408 100644 --- a/tests/api_resources/test_messages.py +++ b/tests/api_resources/test_messages.py @@ -23,8 +23,8 @@ def test_method_create_overload_1(self, client: Anthropic) -> None: max_tokens=1024, messages=[ { - "role": "user", "content": "Hello, world", + "role": "user", } ], model="claude-3-5-sonnet-20240620", @@ -37,8 +37,8 @@ def test_method_create_with_all_params_overload_1(self, client: Anthropic) -> No max_tokens=1024, messages=[ { - "role": "user", "content": "Hello, world", + "role": "user", } ], model="claude-3-5-sonnet-20240620", @@ -47,16 +47,14 @@ def test_method_create_with_all_params_overload_1(self, client: Anthropic) -> No stream=False, system=[ { - "type": "text", "text": "Today's date is 2024-06-01.", + "type": "text", } ], temperature=1, tool_choice={"type": "auto"}, tools=[ { - "description": "Get the current weather in a given location", - "name": "x", "input_schema": { "type": "object", "properties": { @@ -70,10 +68,10 @@ def test_method_create_with_all_params_overload_1(self, client: Anthropic) -> No }, }, }, + "name": "x", + "description": "Get the current weather in a given location", }, { - "description": "Get the current weather in a given location", - "name": "x", "input_schema": { "type": "object", "properties": { @@ -87,10 +85,10 @@ def test_method_create_with_all_params_overload_1(self, client: Anthropic) -> No }, }, }, + "name": "x", + "description": "Get the current weather in a given location", }, { - "description": "Get the current weather in a given location", - "name": "x", "input_schema": { "type": "object", "properties": { @@ -104,6 +102,8 @@ def test_method_create_with_all_params_overload_1(self, client: Anthropic) -> No }, }, }, + "name": "x", + "description": "Get the current weather in a given location", }, ], top_k=5, @@ -117,8 +117,8 @@ def test_raw_response_create_overload_1(self, client: Anthropic) -> None: max_tokens=1024, messages=[ { - "role": "user", "content": "Hello, world", + "role": "user", } ], model="claude-3-5-sonnet-20240620", @@ -135,8 +135,8 @@ def test_streaming_response_create_overload_1(self, client: Anthropic) -> None: max_tokens=1024, messages=[ { - "role": "user", "content": "Hello, world", + "role": "user", } ], model="claude-3-5-sonnet-20240620", @@ -155,8 +155,8 @@ def test_method_create_overload_2(self, client: Anthropic) -> None: max_tokens=1024, messages=[ { - "role": "user", "content": "Hello, world", + "role": "user", } ], model="claude-3-5-sonnet-20240620", @@ -170,8 +170,8 @@ def test_method_create_with_all_params_overload_2(self, client: Anthropic) -> No max_tokens=1024, messages=[ { - "role": "user", "content": "Hello, world", + "role": "user", } ], model="claude-3-5-sonnet-20240620", @@ -180,16 +180,14 @@ def test_method_create_with_all_params_overload_2(self, client: Anthropic) -> No stop_sequences=["string", "string", "string"], system=[ { - "type": "text", "text": "Today's date is 2024-06-01.", + "type": "text", } ], temperature=1, tool_choice={"type": "auto"}, tools=[ { - "description": "Get the current weather in a given location", - "name": "x", "input_schema": { "type": "object", "properties": { @@ -203,10 +201,10 @@ def test_method_create_with_all_params_overload_2(self, client: Anthropic) -> No }, }, }, + "name": "x", + "description": "Get the current weather in a given location", }, { - "description": "Get the current weather in a given location", - "name": "x", "input_schema": { "type": "object", "properties": { @@ -220,10 +218,10 @@ def test_method_create_with_all_params_overload_2(self, client: Anthropic) -> No }, }, }, + "name": "x", + "description": "Get the current weather in a given location", }, { - "description": "Get the current weather in a given location", - "name": "x", "input_schema": { "type": "object", "properties": { @@ -237,6 +235,8 @@ def test_method_create_with_all_params_overload_2(self, client: Anthropic) -> No }, }, }, + "name": "x", + "description": "Get the current weather in a given location", }, ], top_k=5, @@ -250,8 +250,8 @@ def test_raw_response_create_overload_2(self, client: Anthropic) -> None: max_tokens=1024, messages=[ { - "role": "user", "content": "Hello, world", + "role": "user", } ], model="claude-3-5-sonnet-20240620", @@ -268,8 +268,8 @@ def test_streaming_response_create_overload_2(self, client: Anthropic) -> None: max_tokens=1024, messages=[ { - "role": "user", "content": "Hello, world", + "role": "user", } ], model="claude-3-5-sonnet-20240620", @@ -293,8 +293,8 @@ async def test_method_create_overload_1(self, async_client: AsyncAnthropic) -> N max_tokens=1024, messages=[ { - "role": "user", "content": "Hello, world", + "role": "user", } ], model="claude-3-5-sonnet-20240620", @@ -307,8 +307,8 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn max_tokens=1024, messages=[ { - "role": "user", "content": "Hello, world", + "role": "user", } ], model="claude-3-5-sonnet-20240620", @@ -317,16 +317,14 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn stream=False, system=[ { - "type": "text", "text": "Today's date is 2024-06-01.", + "type": "text", } ], temperature=1, tool_choice={"type": "auto"}, tools=[ { - "description": "Get the current weather in a given location", - "name": "x", "input_schema": { "type": "object", "properties": { @@ -340,10 +338,10 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn }, }, }, + "name": "x", + "description": "Get the current weather in a given location", }, { - "description": "Get the current weather in a given location", - "name": "x", "input_schema": { "type": "object", "properties": { @@ -357,10 +355,10 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn }, }, }, + "name": "x", + "description": "Get the current weather in a given location", }, { - "description": "Get the current weather in a given location", - "name": "x", "input_schema": { "type": "object", "properties": { @@ -374,6 +372,8 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn }, }, }, + "name": "x", + "description": "Get the current weather in a given location", }, ], top_k=5, @@ -387,8 +387,8 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncAnthropic max_tokens=1024, messages=[ { - "role": "user", "content": "Hello, world", + "role": "user", } ], model="claude-3-5-sonnet-20240620", @@ -405,8 +405,8 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncAnt max_tokens=1024, messages=[ { - "role": "user", "content": "Hello, world", + "role": "user", } ], model="claude-3-5-sonnet-20240620", @@ -425,8 +425,8 @@ async def test_method_create_overload_2(self, async_client: AsyncAnthropic) -> N max_tokens=1024, messages=[ { - "role": "user", "content": "Hello, world", + "role": "user", } ], model="claude-3-5-sonnet-20240620", @@ -440,8 +440,8 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn max_tokens=1024, messages=[ { - "role": "user", "content": "Hello, world", + "role": "user", } ], model="claude-3-5-sonnet-20240620", @@ -450,16 +450,14 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn stop_sequences=["string", "string", "string"], system=[ { - "type": "text", "text": "Today's date is 2024-06-01.", + "type": "text", } ], temperature=1, tool_choice={"type": "auto"}, tools=[ { - "description": "Get the current weather in a given location", - "name": "x", "input_schema": { "type": "object", "properties": { @@ -473,10 +471,10 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn }, }, }, + "name": "x", + "description": "Get the current weather in a given location", }, { - "description": "Get the current weather in a given location", - "name": "x", "input_schema": { "type": "object", "properties": { @@ -490,10 +488,10 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn }, }, }, + "name": "x", + "description": "Get the current weather in a given location", }, { - "description": "Get the current weather in a given location", - "name": "x", "input_schema": { "type": "object", "properties": { @@ -507,6 +505,8 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn }, }, }, + "name": "x", + "description": "Get the current weather in a given location", }, ], top_k=5, @@ -520,8 +520,8 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncAnthropic max_tokens=1024, messages=[ { - "role": "user", "content": "Hello, world", + "role": "user", } ], model="claude-3-5-sonnet-20240620", @@ -538,8 +538,8 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncAnt max_tokens=1024, messages=[ { - "role": "user", "content": "Hello, world", + "role": "user", } ], model="claude-3-5-sonnet-20240620", diff --git a/tests/test_client.py b/tests/test_client.py index 23364599..e20da702 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -890,8 +890,8 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: max_tokens=1024, messages=[ { - "role": "user", "content": "Hello, world", + "role": "user", } ], model="claude-3-5-sonnet-20240620", @@ -922,8 +922,8 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: max_tokens=1024, messages=[ { - "role": "user", "content": "Hello, world", + "role": "user", } ], model="claude-3-5-sonnet-20240620", @@ -1790,8 +1790,8 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: max_tokens=1024, messages=[ { - "role": "user", "content": "Hello, world", + "role": "user", } ], model="claude-3-5-sonnet-20240620", @@ -1823,8 +1823,8 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: max_tokens=1024, messages=[ { - "role": "user", "content": "Hello, world", + "role": "user", } ], model="claude-3-5-sonnet-20240620",