99
1010from asktable import Asktable , AsyncAsktable
1111from tests .utils import assert_matches_type
12- from asktable .types import ChatOut , ChatListResponse
12+ from asktable .types import (
13+ ChatListResponse ,
14+ ChatCreateResponse ,
15+ ChatRetrieveResponse ,
16+ )
1317
1418base_url = os .environ .get ("TEST_API_BASE_URL" , "http://127.0.0.1:4010" )
1519
@@ -20,7 +24,7 @@ class TestChats:
2024 @parametrize
2125 def test_method_create (self , client : Asktable ) -> None :
2226 chat = client .chats .create ()
23- assert_matches_type (ChatOut , chat , path = ["response" ])
27+ assert_matches_type (ChatCreateResponse , chat , path = ["response" ])
2428
2529 @parametrize
2630 def test_method_create_with_all_params (self , client : Asktable ) -> None :
@@ -35,7 +39,7 @@ def test_method_create_with_all_params(self, client: Asktable) -> None:
3539 "name" : "张三" ,
3640 },
3741 )
38- assert_matches_type (ChatOut , chat , path = ["response" ])
42+ assert_matches_type (ChatCreateResponse , chat , path = ["response" ])
3943
4044 @parametrize
4145 def test_raw_response_create (self , client : Asktable ) -> None :
@@ -44,7 +48,7 @@ def test_raw_response_create(self, client: Asktable) -> None:
4448 assert response .is_closed is True
4549 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
4650 chat = response .parse ()
47- assert_matches_type (ChatOut , chat , path = ["response" ])
51+ assert_matches_type (ChatCreateResponse , chat , path = ["response" ])
4852
4953 @parametrize
5054 def test_streaming_response_create (self , client : Asktable ) -> None :
@@ -53,7 +57,7 @@ def test_streaming_response_create(self, client: Asktable) -> None:
5357 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
5458
5559 chat = response .parse ()
56- assert_matches_type (ChatOut , chat , path = ["response" ])
60+ assert_matches_type (ChatCreateResponse , chat , path = ["response" ])
5761
5862 assert cast (Any , response .is_closed ) is True
5963
@@ -62,7 +66,7 @@ def test_method_retrieve(self, client: Asktable) -> None:
6266 chat = client .chats .retrieve (
6367 "chat_id" ,
6468 )
65- assert_matches_type (ChatOut , chat , path = ["response" ])
69+ assert_matches_type (ChatRetrieveResponse , chat , path = ["response" ])
6670
6771 @parametrize
6872 def test_raw_response_retrieve (self , client : Asktable ) -> None :
@@ -73,7 +77,7 @@ def test_raw_response_retrieve(self, client: Asktable) -> None:
7377 assert response .is_closed is True
7478 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
7579 chat = response .parse ()
76- assert_matches_type (ChatOut , chat , path = ["response" ])
80+ assert_matches_type (ChatRetrieveResponse , chat , path = ["response" ])
7781
7882 @parametrize
7983 def test_streaming_response_retrieve (self , client : Asktable ) -> None :
@@ -84,7 +88,7 @@ def test_streaming_response_retrieve(self, client: Asktable) -> None:
8488 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
8589
8690 chat = response .parse ()
87- assert_matches_type (ChatOut , chat , path = ["response" ])
91+ assert_matches_type (ChatRetrieveResponse , chat , path = ["response" ])
8892
8993 assert cast (Any , response .is_closed ) is True
9094
@@ -173,7 +177,7 @@ class TestAsyncChats:
173177 @parametrize
174178 async def test_method_create (self , async_client : AsyncAsktable ) -> None :
175179 chat = await async_client .chats .create ()
176- assert_matches_type (ChatOut , chat , path = ["response" ])
180+ assert_matches_type (ChatCreateResponse , chat , path = ["response" ])
177181
178182 @parametrize
179183 async def test_method_create_with_all_params (self , async_client : AsyncAsktable ) -> None :
@@ -188,7 +192,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncAsktable)
188192 "name" : "张三" ,
189193 },
190194 )
191- assert_matches_type (ChatOut , chat , path = ["response" ])
195+ assert_matches_type (ChatCreateResponse , chat , path = ["response" ])
192196
193197 @parametrize
194198 async def test_raw_response_create (self , async_client : AsyncAsktable ) -> None :
@@ -197,7 +201,7 @@ async def test_raw_response_create(self, async_client: AsyncAsktable) -> None:
197201 assert response .is_closed is True
198202 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
199203 chat = await response .parse ()
200- assert_matches_type (ChatOut , chat , path = ["response" ])
204+ assert_matches_type (ChatCreateResponse , chat , path = ["response" ])
201205
202206 @parametrize
203207 async def test_streaming_response_create (self , async_client : AsyncAsktable ) -> None :
@@ -206,7 +210,7 @@ async def test_streaming_response_create(self, async_client: AsyncAsktable) -> N
206210 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
207211
208212 chat = await response .parse ()
209- assert_matches_type (ChatOut , chat , path = ["response" ])
213+ assert_matches_type (ChatCreateResponse , chat , path = ["response" ])
210214
211215 assert cast (Any , response .is_closed ) is True
212216
@@ -215,7 +219,7 @@ async def test_method_retrieve(self, async_client: AsyncAsktable) -> None:
215219 chat = await async_client .chats .retrieve (
216220 "chat_id" ,
217221 )
218- assert_matches_type (ChatOut , chat , path = ["response" ])
222+ assert_matches_type (ChatRetrieveResponse , chat , path = ["response" ])
219223
220224 @parametrize
221225 async def test_raw_response_retrieve (self , async_client : AsyncAsktable ) -> None :
@@ -226,7 +230,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncAsktable) -> None:
226230 assert response .is_closed is True
227231 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
228232 chat = await response .parse ()
229- assert_matches_type (ChatOut , chat , path = ["response" ])
233+ assert_matches_type (ChatRetrieveResponse , chat , path = ["response" ])
230234
231235 @parametrize
232236 async def test_streaming_response_retrieve (self , async_client : AsyncAsktable ) -> None :
@@ -237,7 +241,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncAsktable) ->
237241 assert response .http_request .headers .get ("X-Stainless-Lang" ) == "python"
238242
239243 chat = await response .parse ()
240- assert_matches_type (ChatOut , chat , path = ["response" ])
244+ assert_matches_type (ChatRetrieveResponse , chat , path = ["response" ])
241245
242246 assert cast (Any , response .is_closed ) is True
243247
0 commit comments