@@ -712,27 +712,25 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str
712712 @mock .patch ("isaacus._base_client.BaseClient._calculate_retry_timeout" , _low_retry_timeout )
713713 @pytest .mark .respx (base_url = base_url )
714714 def test_retrying_timeout_errors_doesnt_leak (self , respx_mock : MockRouter , client : Isaacus ) -> None :
715- respx_mock .post ("/classifications/universal " ).mock (side_effect = httpx .TimeoutException ("Test timeout error" ))
715+ respx_mock .post ("/embeddings " ).mock (side_effect = httpx .TimeoutException ("Test timeout error" ))
716716
717717 with pytest .raises (APITimeoutError ):
718- client .classifications .universal .with_streaming_response .create (
719- model = "kanon-universal-classifier" ,
720- query = "This is a confidentiality clause." ,
721- texts = ["I agree not to tell anyone about the document." ],
718+ client .embeddings .with_streaming_response .create (
719+ model = "kanon-2-embedder" ,
720+ texts = ["Are restraints of trade enforceable under English law?" , "What is a non-compete clause?" ],
722721 ).__enter__ ()
723722
724723 assert _get_open_connections (self .client ) == 0
725724
726725 @mock .patch ("isaacus._base_client.BaseClient._calculate_retry_timeout" , _low_retry_timeout )
727726 @pytest .mark .respx (base_url = base_url )
728727 def test_retrying_status_errors_doesnt_leak (self , respx_mock : MockRouter , client : Isaacus ) -> None :
729- respx_mock .post ("/classifications/universal " ).mock (return_value = httpx .Response (500 ))
728+ respx_mock .post ("/embeddings " ).mock (return_value = httpx .Response (500 ))
730729
731730 with pytest .raises (APIStatusError ):
732- client .classifications .universal .with_streaming_response .create (
733- model = "kanon-universal-classifier" ,
734- query = "This is a confidentiality clause." ,
735- texts = ["I agree not to tell anyone about the document." ],
731+ client .embeddings .with_streaming_response .create (
732+ model = "kanon-2-embedder" ,
733+ texts = ["Are restraints of trade enforceable under English law?" , "What is a non-compete clause?" ],
736734 ).__enter__ ()
737735 assert _get_open_connections (self .client ) == 0
738736
@@ -760,12 +758,11 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
760758 return httpx .Response (500 )
761759 return httpx .Response (200 )
762760
763- respx_mock .post ("/classifications/universal " ).mock (side_effect = retry_handler )
761+ respx_mock .post ("/embeddings " ).mock (side_effect = retry_handler )
764762
765- response = client .classifications .universal .with_raw_response .create (
766- model = "kanon-universal-classifier" ,
767- query = "This is a confidentiality clause." ,
768- texts = ["I agree not to tell anyone about the document." ],
763+ response = client .embeddings .with_raw_response .create (
764+ model = "kanon-2-embedder" ,
765+ texts = ["Are restraints of trade enforceable under English law?" , "What is a non-compete clause?" ],
769766 )
770767
771768 assert response .retries_taken == failures_before_success
@@ -788,12 +785,11 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
788785 return httpx .Response (500 )
789786 return httpx .Response (200 )
790787
791- respx_mock .post ("/classifications/universal " ).mock (side_effect = retry_handler )
788+ respx_mock .post ("/embeddings " ).mock (side_effect = retry_handler )
792789
793- response = client .classifications .universal .with_raw_response .create (
794- model = "kanon-universal-classifier" ,
795- query = "This is a confidentiality clause." ,
796- texts = ["I agree not to tell anyone about the document." ],
790+ response = client .embeddings .with_raw_response .create (
791+ model = "kanon-2-embedder" ,
792+ texts = ["Are restraints of trade enforceable under English law?" , "What is a non-compete clause?" ],
797793 extra_headers = {"x-stainless-retry-count" : Omit ()},
798794 )
799795
@@ -816,12 +812,11 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
816812 return httpx .Response (500 )
817813 return httpx .Response (200 )
818814
819- respx_mock .post ("/classifications/universal " ).mock (side_effect = retry_handler )
815+ respx_mock .post ("/embeddings " ).mock (side_effect = retry_handler )
820816
821- response = client .classifications .universal .with_raw_response .create (
822- model = "kanon-universal-classifier" ,
823- query = "This is a confidentiality clause." ,
824- texts = ["I agree not to tell anyone about the document." ],
817+ response = client .embeddings .with_raw_response .create (
818+ model = "kanon-2-embedder" ,
819+ texts = ["Are restraints of trade enforceable under English law?" , "What is a non-compete clause?" ],
825820 extra_headers = {"x-stainless-retry-count" : "42" },
826821 )
827822
@@ -1551,27 +1546,25 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte
15511546 async def test_retrying_timeout_errors_doesnt_leak (
15521547 self , respx_mock : MockRouter , async_client : AsyncIsaacus
15531548 ) -> None :
1554- respx_mock .post ("/classifications/universal " ).mock (side_effect = httpx .TimeoutException ("Test timeout error" ))
1549+ respx_mock .post ("/embeddings " ).mock (side_effect = httpx .TimeoutException ("Test timeout error" ))
15551550
15561551 with pytest .raises (APITimeoutError ):
1557- await async_client .classifications .universal .with_streaming_response .create (
1558- model = "kanon-universal-classifier" ,
1559- query = "This is a confidentiality clause." ,
1560- texts = ["I agree not to tell anyone about the document." ],
1552+ await async_client .embeddings .with_streaming_response .create (
1553+ model = "kanon-2-embedder" ,
1554+ texts = ["Are restraints of trade enforceable under English law?" , "What is a non-compete clause?" ],
15611555 ).__aenter__ ()
15621556
15631557 assert _get_open_connections (self .client ) == 0
15641558
15651559 @mock .patch ("isaacus._base_client.BaseClient._calculate_retry_timeout" , _low_retry_timeout )
15661560 @pytest .mark .respx (base_url = base_url )
15671561 async def test_retrying_status_errors_doesnt_leak (self , respx_mock : MockRouter , async_client : AsyncIsaacus ) -> None :
1568- respx_mock .post ("/classifications/universal " ).mock (return_value = httpx .Response (500 ))
1562+ respx_mock .post ("/embeddings " ).mock (return_value = httpx .Response (500 ))
15691563
15701564 with pytest .raises (APIStatusError ):
1571- await async_client .classifications .universal .with_streaming_response .create (
1572- model = "kanon-universal-classifier" ,
1573- query = "This is a confidentiality clause." ,
1574- texts = ["I agree not to tell anyone about the document." ],
1565+ await async_client .embeddings .with_streaming_response .create (
1566+ model = "kanon-2-embedder" ,
1567+ texts = ["Are restraints of trade enforceable under English law?" , "What is a non-compete clause?" ],
15751568 ).__aenter__ ()
15761569 assert _get_open_connections (self .client ) == 0
15771570
@@ -1600,12 +1593,11 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
16001593 return httpx .Response (500 )
16011594 return httpx .Response (200 )
16021595
1603- respx_mock .post ("/classifications/universal " ).mock (side_effect = retry_handler )
1596+ respx_mock .post ("/embeddings " ).mock (side_effect = retry_handler )
16041597
1605- response = await client .classifications .universal .with_raw_response .create (
1606- model = "kanon-universal-classifier" ,
1607- query = "This is a confidentiality clause." ,
1608- texts = ["I agree not to tell anyone about the document." ],
1598+ response = await client .embeddings .with_raw_response .create (
1599+ model = "kanon-2-embedder" ,
1600+ texts = ["Are restraints of trade enforceable under English law?" , "What is a non-compete clause?" ],
16091601 )
16101602
16111603 assert response .retries_taken == failures_before_success
@@ -1629,12 +1621,11 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
16291621 return httpx .Response (500 )
16301622 return httpx .Response (200 )
16311623
1632- respx_mock .post ("/classifications/universal " ).mock (side_effect = retry_handler )
1624+ respx_mock .post ("/embeddings " ).mock (side_effect = retry_handler )
16331625
1634- response = await client .classifications .universal .with_raw_response .create (
1635- model = "kanon-universal-classifier" ,
1636- query = "This is a confidentiality clause." ,
1637- texts = ["I agree not to tell anyone about the document." ],
1626+ response = await client .embeddings .with_raw_response .create (
1627+ model = "kanon-2-embedder" ,
1628+ texts = ["Are restraints of trade enforceable under English law?" , "What is a non-compete clause?" ],
16381629 extra_headers = {"x-stainless-retry-count" : Omit ()},
16391630 )
16401631
@@ -1658,12 +1649,11 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
16581649 return httpx .Response (500 )
16591650 return httpx .Response (200 )
16601651
1661- respx_mock .post ("/classifications/universal " ).mock (side_effect = retry_handler )
1652+ respx_mock .post ("/embeddings " ).mock (side_effect = retry_handler )
16621653
1663- response = await client .classifications .universal .with_raw_response .create (
1664- model = "kanon-universal-classifier" ,
1665- query = "This is a confidentiality clause." ,
1666- texts = ["I agree not to tell anyone about the document." ],
1654+ response = await client .embeddings .with_raw_response .create (
1655+ model = "kanon-2-embedder" ,
1656+ texts = ["Are restraints of trade enforceable under English law?" , "What is a non-compete clause?" ],
16671657 extra_headers = {"x-stainless-retry-count" : "42" },
16681658 )
16691659
0 commit comments