Skip to content

Commit abfbac4

Browse files
authored
add __iter__ to dataset object (#361)
* add __iter__ to dataset object
1 parent e3804a5 commit abfbac4

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Changelog
2+
## 4.40
3+
- [#357] (https://github.com/cohere-ai/cohere-python/pull/361)
4+
- Add __iter__ to dataset
5+
26
## 4.39
37
- [#357] (https://github.com/cohere-ai/cohere-python/pull/357)
48
- Embed: add bulk embed support for embed V3

cohere/responses/dataset.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ def __init__(
5151
self.validation_error = validation_error
5252
self.validation_warnings = validation_warnings
5353

54+
def __iter__(self):
55+
return self.open()
56+
5457
@classmethod
5558
def from_dict(cls, data: Dict[str, Any], wait_fn) -> "Dataset":
5659
download_urls = []

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "cohere"
3-
version = "4.39"
3+
version = "4.40"
44
description = "Python SDK for the Cohere API"
55
authors = ["Cohere"]
66
readme = "README.md"

0 commit comments

Comments
 (0)