Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions roboflow/core/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,9 @@ def search(
batch_id (str): batch id that an image must be in
annotation_job (bool): whether the image must be in an annotation job
annotation_job_id (str): annotation job id that an image must be in
fields (list): fields to return in results (default: ["id", "created", "name", "labels"])
fields (list): fields to return in results (default: ["id", "created", "name", "labels"]).
Available fields: id, name, created, annotations, labels, split, tags, owner,
embedding, user_metadata.

Returns:
A list of images that match the search criteria.
Expand All @@ -684,7 +686,14 @@ def search(

>>> project = rf.workspace().project("PROJECT_ID")

>>> results = project.search(query="cat", limit=10)
>>> # Basic search
>>> results = project.search(prompt="cat", limit=10)

>>> # Search with tags and user_metadata
>>> results = project.search(
... limit=10,
... fields=["id", "name", "tags", "user_metadata"]
... )
""" # noqa: E501 // docs
if fields is None:
fields = ["id", "created", "name", "labels"]
Expand Down Expand Up @@ -764,10 +773,12 @@ def search_all(
batch_id (str): batch id that an image must be in
annotation_job (bool): whether the image must be in an annotation job
annotation_job_id (str): annotation job id that an image must be in
fields (list): fields to return in results (default: ["id", "created", "name", "labels"])
fields (list): fields to return in results (default: ["id", "created"]).
Available fields: id, name, created, annotations, labels, split, tags, owner,
embedding, user_metadata.

Returns:
A list of images that match the search criteria.
A generator yielding images that match the search criteria.

Example:
>>> import roboflow
Expand All @@ -776,10 +787,9 @@ def search_all(

>>> project = rf.workspace().project("PROJECT_ID")

>>> results = project.search_all(query="cat", limit=10)
>>> results = project.search_all(prompt="cat", limit=10)

>>> for result in results:

>>> print(result)
""" # noqa: E501 // docs
if fields is None:
Expand Down