Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 32f8801

Browse files
committedFeb 6, 2025·
Drop deprecated classify
1 parent 03edc9a commit 32f8801

File tree

2 files changed

+6
-63
lines changed

2 files changed

+6
-63
lines changed
 

‎tests/test_async_client.py

+4-32
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async def test_chat(self) -> None:
2929
UserMessage(
3030
message="Who discovered gravity?"),
3131
ChatbotMessage(message="The man who is widely credited with discovering "
32-
"gravity is Sir Isaac Newton")
32+
"gravity is Sir Isaac Newton")
3333
],
3434
message="What year was he born?",
3535
connectors=[ChatConnector(id="web-search")]
@@ -43,7 +43,7 @@ async def test_chat_stream(self) -> None:
4343
UserMessage(
4444
message="Who discovered gravity?"),
4545
ChatbotMessage(message="The man who is widely credited with discovering "
46-
"gravity is Sir Isaac Newton")
46+
"gravity is Sir Isaac Newton")
4747
],
4848
message="What year was he born?",
4949
connectors=[ChatConnector(id="web-search")]
@@ -73,7 +73,8 @@ async def test_deprecated_fn(self) -> None:
7373

7474
async def test_moved_fn(self) -> None:
7575
with self.assertRaises(ValueError):
76-
await self.co.list_connectors("dummy", dummy="dummy") # type: ignore
76+
# type: ignore
77+
await self.co.list_connectors("dummy", dummy="dummy")
7778

7879
@unittest.skipIf(os.getenv("CO_API_URL") is not None, "Doesn't work in staging.")
7980
async def test_generate(self) -> None:
@@ -176,35 +177,6 @@ async def test_rerank(self) -> None:
176177

177178
print(response)
178179

179-
@unittest.skipIf(os.getenv("CO_API_URL") is not None, "Doesn't work in staging.")
180-
async def test_classify(self) -> None:
181-
examples = [
182-
ClassifyExample(
183-
text="Dermatologists don't like her!", label="Spam"),
184-
ClassifyExample(text="'Hello, open to this?'", label="Spam"),
185-
ClassifyExample(
186-
text="I need help please wire me $1000 right now", label="Spam"),
187-
ClassifyExample(text="Nice to know you ;)", label="Spam"),
188-
ClassifyExample(text="Please help me?", label="Spam"),
189-
ClassifyExample(
190-
text="Your parcel will be delivered today", label="Not spam"),
191-
ClassifyExample(
192-
text="Review changes to our Terms and Conditions", label="Not spam"),
193-
ClassifyExample(text="Weekly sync notes", label="Not spam"),
194-
ClassifyExample(
195-
text="'Re: Follow up from today's meeting'", label="Not spam"),
196-
ClassifyExample(text="Pre-read for tomorrow", label="Not spam"),
197-
]
198-
inputs = [
199-
"Confirm your email address",
200-
"hey i need u to send some $",
201-
]
202-
response = await self.co.classify(
203-
inputs=inputs,
204-
examples=examples,
205-
)
206-
print(response)
207-
208180
@unittest.skipIf(os.getenv("CO_API_URL") is not None, "Doesn't work in staging.")
209181
async def test_datasets_crud(self) -> None:
210182
my_dataset = await self.co.datasets.create(

‎tests/test_client.py

+2-31
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_chat(self) -> None:
2828
UserMessage(
2929
message="Who discovered gravity?"),
3030
ChatbotMessage(message="The man who is widely credited with discovering "
31-
"gravity is Sir Isaac Newton")
31+
"gravity is Sir Isaac Newton")
3232
],
3333
message="What year was he born?",
3434
connectors=[ChatConnector(id="web-search")]
@@ -64,7 +64,7 @@ def test_chat_stream(self) -> None:
6464
UserMessage(
6565
message="Who discovered gravity?"),
6666
ChatbotMessage(message="The man who is widely credited with discovering "
67-
"gravity is Sir Isaac Newton")
67+
"gravity is Sir Isaac Newton")
6868
],
6969
message="What year was he born?",
7070
connectors=[ChatConnector(id="web-search")]
@@ -238,35 +238,6 @@ def test_rerank(self) -> None:
238238

239239
print(response)
240240

241-
@unittest.skipIf(os.getenv("CO_API_URL") is not None, "Doesn't work in staging.")
242-
def test_classify(self) -> None:
243-
examples = [
244-
ClassifyExample(
245-
text="Dermatologists don't like her!", label="Spam"),
246-
ClassifyExample(text="'Hello, open to this?'", label="Spam"),
247-
ClassifyExample(
248-
text="I need help please wire me $1000 right now", label="Spam"),
249-
ClassifyExample(text="Nice to know you ;)", label="Spam"),
250-
ClassifyExample(text="Please help me?", label="Spam"),
251-
ClassifyExample(
252-
text="Your parcel will be delivered today", label="Not spam"),
253-
ClassifyExample(
254-
text="Review changes to our Terms and Conditions", label="Not spam"),
255-
ClassifyExample(text="Weekly sync notes", label="Not spam"),
256-
ClassifyExample(
257-
text="'Re: Follow up from today's meeting'", label="Not spam"),
258-
ClassifyExample(text="Pre-read for tomorrow", label="Not spam"),
259-
]
260-
inputs = [
261-
"Confirm your email address",
262-
"hey i need u to send some $",
263-
]
264-
response = co.classify(
265-
inputs=inputs,
266-
examples=examples,
267-
)
268-
print(response)
269-
270241
@unittest.skipIf(os.getenv("CO_API_URL") is not None, "Doesn't work in staging.")
271242
def test_datasets_crud(self) -> None:
272243
my_dataset = co.datasets.create(

0 commit comments

Comments
 (0)
Please sign in to comment.