Add tag filter information to model query (#516)

This commit is contained in:
pollfly 2023-03-30 10:40:28 +03:00 committed by GitHub
parent 828d9659a6
commit 53aea009e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,8 +108,6 @@ the [`InputModel.query_models`](../references/sdk/model_inputmodel.md#inputmodel
methods return a list of model objects that match the queries. The list is ordered according to the models last update
time.
When you query models by tags, use the `-` prefix in order to filter out models with that tag.
```python
model_list = Model.query_models(
# Only models from `examples` project
@ -129,6 +127,23 @@ model_list = Model.query_models(
)
```
### Tag Filters
The `tags` field supports advanced queries through combining tag names and operators into a list.
The supported operators are:
* `not`
* `and`
* `or`
Input the operators in the following format: `"__$<op>"`. To exclude a tag, you can also use the `-` prefix before the
tag name, unless the tag name begins with the dash character (`-`), in which case you can use `"__$not"`.
The `or`, and `and` operators apply to all tags that follow them until another operator is specified. The `not` operator
applies only to the immediately following tag.
The default operator for a query is `or`, unless `and` is placed at the beginning of the query.
## SDK Reference
For information about all model methods, see the following SDK reference pages: