Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 10 additions & 3 deletions tests/client/test_input_search_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
get_channel,
metadata,
raise_on_failure,
user_app_id,
)


Expand Down Expand Up @@ -180,6 +181,7 @@ def test_search_by_image_url(channel_key):
with SetupImage(stub) as input_:
response = stub.PostSearches(
service_pb2.PostSearchesRequest(
user_app_id=user_app_id(),
query=resources_pb2.Query(
ands=[
resources_pb2.And(
Expand All @@ -195,7 +197,8 @@ def test_search_by_image_url(channel_key):
),
pagination=service_pb2.Pagination(page=1, per_page=1000),
),
metadata=metadata(),
# Need PAT to run embedder model from clarifai/main on the image data.
metadata=metadata(pat=True),
)
raise_on_failure(response)
assert len(response.hits) > 0
Expand All @@ -210,6 +213,7 @@ def test_search_by_image_bytes(channel_key):
url_bytes = http_response.read()
response = stub.PostSearches(
service_pb2.PostSearchesRequest(
user_app_id=user_app_id(),
query=resources_pb2.Query(
ands=[
resources_pb2.And(
Expand All @@ -225,7 +229,8 @@ def test_search_by_image_bytes(channel_key):
),
pagination=service_pb2.Pagination(page=1, per_page=1000),
),
metadata=metadata(),
# Need PAT to run embedder model from clarifai/main on the image data.
metadata=metadata(pat=True),
)
raise_on_failure(response)
assert len(response.hits) > 0
Expand Down Expand Up @@ -336,6 +341,7 @@ def test_search_by_image_url_and_geo_box(channel_key):
with SetupImage(stub) as input_:
response = stub.PostSearches(
service_pb2.PostSearchesRequest(
user_app_id=user_app_id(),
query=resources_pb2.Query(
ands=[
resources_pb2.And(
Expand Down Expand Up @@ -371,7 +377,8 @@ def test_search_by_image_url_and_geo_box(channel_key):
),
pagination=service_pb2.Pagination(page=1, per_page=1000),
),
metadata=metadata(),
# Need PAT to run embedder model from clarifai/main on the image data.
metadata=metadata(pat=True),
)
raise_on_failure(response)
assert len(response.hits) > 0
Expand Down
12 changes: 9 additions & 3 deletions tests/client/test_inputs_searches.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ def test_search_by_image_url(channel_key):
with SetupImage(stub) as input_:
response = stub.PostInputsSearches(
PostInputsSearchesRequest(
user_app_id=user_app_id(),
searches=[
Search(
query=Query(
Expand All @@ -196,7 +197,8 @@ def test_search_by_image_url(channel_key):
],
pagination=service_pb2.Pagination(page=1, per_page=1000),
),
metadata=metadata(),
# Need PAT to run embedder model from clarifai/main on the image data.
metadata=metadata(pat=True),
)
raise_on_failure(response)
assert len(response.hits) >= 1
Expand All @@ -213,6 +215,7 @@ def test_search_by_image_bytes(channel_key):
with SetupImage(stub) as input_:
response = stub.PostInputsSearches(
PostInputsSearchesRequest(
user_app_id=user_app_id(),
searches=[
Search(
query=Query(
Expand All @@ -226,7 +229,8 @@ def test_search_by_image_bytes(channel_key):
],
pagination=service_pb2.Pagination(page=1, per_page=1000),
),
metadata=metadata(),
# Need PAT to run embedder model from clarifai/main on the image data.
metadata=metadata(pat=True),
)
raise_on_failure(response)
assert len(response.hits) >= 1
Expand Down Expand Up @@ -350,6 +354,7 @@ def test_search_by_image_url_and_geo_box(channel_key):
with SetupImage(stub) as input_:
response = stub.PostInputsSearches(
PostInputsSearchesRequest(
user_app_id=user_app_id(),
searches=[
Search(
query=Query(
Expand Down Expand Up @@ -387,7 +392,8 @@ def test_search_by_image_url_and_geo_box(channel_key):
],
pagination=service_pb2.Pagination(page=1, per_page=1000),
),
metadata=metadata(),
# Need PAT to run embedder model from clarifai/main on the image data.
metadata=metadata(pat=True),
)
raise_on_failure(response)
assert len(response.hits) >= 1
Expand Down
4 changes: 3 additions & 1 deletion tests/client/test_model_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def test_post_patch_get_train_evaluate_predict_delete_model(channel_key):

post_model_outputs_response = stub.PostModelOutputs(
service_pb2.PostModelOutputsRequest(
user_app_id=user_app_id(),
model_id=model_id,
version_id=model_version_id,
inputs=[
Expand All @@ -177,7 +178,8 @@ def test_post_patch_get_train_evaluate_predict_delete_model(channel_key):
)
],
),
metadata=metadata(),
# Need PAT to run embedder model from clarifai/main on the image data.
metadata=metadata(pat=True),
)
raise_on_failure(post_model_outputs_response)
assert len(post_model_outputs_response.outputs) == 1
Expand Down
Loading