Model Search
search.model_search(SearchModelSearchParams**kwargs) -> SyncSearchHitsOffset[SearchModelSearchResponse]
POST/search/models
Search for models.
At least one of the following fields must have a value: query, filter, image, or images.
image, and images are mutually exclusive.
Parameters
hits_per_page: Optional[float]
Maximum number of documents returned for a page. Must be used with page.
maximum100
minimum1
image: Optional[str]
Search for model with image as a reference
Must be an existing AssetId or a valid data URL.
image_semantic_ratio: Optional[float]
Image embedding ratio for hybrid search, applied when image, images.like, or images.unlike
are provided
maximum1
minimum0
limit: Optional[float]
Maximum number of documents returned. Must be used with offset.
maximum100
minimum1
Model Search
import os
from scenario_sdk import Scenario
client = Scenario(
api_key=os.environ.get("SCENARIO_SDK_API_KEY"), # This is the default and can be omitted
api_secret=os.environ.get("SCENARIO_SDK_API_SECRET"), # This is the default and can be omitted
)
page = client.search.model_search()
page = page.hits[0]
print(page.id){
"hits": [
{
"id": "id",
"authorId": "authorId",
"capabilities": [
"string"
],
"collectionIds": [
"string"
],
"concepts": [
{
"modelId": "modelId"
}
],
"createdAt": "createdAt",
"exampleAssetIds": [
"string"
],
"name": "name",
"ownerId": "ownerId",
"privacy": "privacy",
"shortDescription": "shortDescription",
"source": "source",
"tags": [
"string"
],
"teamId": "teamId",
"trainingImagesNumber": 0,
"type": "type",
"updatedAt": "updatedAt",
"parentModelId": "parentModelId",
"score": 0,
"thumbnail": {
"assetId": "assetId",
"url": "url"
}
}
],
"limit": 0,
"offset": 0,
"estimatedTotalHits": 0,
"hitsPerPage": 0,
"page": 0,
"totalHits": 0,
"totalPages": 0
}Returns Examples
{
"hits": [
{
"id": "id",
"authorId": "authorId",
"capabilities": [
"string"
],
"collectionIds": [
"string"
],
"concepts": [
{
"modelId": "modelId"
}
],
"createdAt": "createdAt",
"exampleAssetIds": [
"string"
],
"name": "name",
"ownerId": "ownerId",
"privacy": "privacy",
"shortDescription": "shortDescription",
"source": "source",
"tags": [
"string"
],
"teamId": "teamId",
"trainingImagesNumber": 0,
"type": "type",
"updatedAt": "updatedAt",
"parentModelId": "parentModelId",
"score": 0,
"thumbnail": {
"assetId": "assetId",
"url": "url"
}
}
],
"limit": 0,
"offset": 0,
"estimatedTotalHits": 0,
"hitsPerPage": 0,
"page": 0,
"totalHits": 0,
"totalPages": 0
}