Models
QueryBuilder
Query_Builder utilities for data models and type definitions used throughout the maxim sdk.
QueryBuilder
This class represents a query builder. Users can use this class to build a query rule for fetching prompts, agents or workflow from Maxim server.
and_
Sets the operator for combining query rules to ‘AND’.
Returns:
Name | Description |
---|---|
[QueryBuilder](/sdk/python/references/models/query_builder) | The current QueryBuilder instance for method chaining. |
or_
Sets the operator for combining query rules to ‘OR’.
Returns:
Name | Description |
---|---|
[QueryBuilder](/sdk/python/references/models/query_builder) | The current QueryBuilder instance for method chaining. |
folder
Sets the folder scope for the query.
Arguments:
Name | Type | Description |
---|---|---|
folderId | str | The ID of the folder to set as the scope. |
Returns:
Name | Description |
---|---|
[QueryBuilder](/sdk/python/references/models/query_builder) | The current QueryBuilder instance for method chaining. |
exact_match
Sets the exact match flag to True.
Returns:
Name | Description |
---|---|
[QueryBuilder](/sdk/python/references/models/query_builder) | The current QueryBuilder instance for method chaining. |
deployment_var
Adds a deployment variable rule to the query.
Arguments:
Name | Type | Description |
---|---|---|
key | str | The key of the deployment variable. |
value | Union[str, int, bool] | The value of the deployment variable. |
enforce | bool, optional | Whether to enforce the deployment variable. Defaults to True. |
Returns:
Name | Description |
---|---|
[QueryBuilder](/sdk/python/references/models/query_builder) | The current QueryBuilder instance for method chaining. |
tag
Adds a tag rule to the query.
Arguments:
Name | Type | Description |
---|---|---|
key | str | The key of the tag. |
value | Union[str, int, bool] | The value of the tag. |
enforce | bool, optional | Whether to enforce the tag. Defaults to False. |
Returns:
Name | Description |
---|---|
[QueryBuilder](/sdk/python/references/models/query_builder) | The current QueryBuilder instance for method chaining. |
build
Builds the final query rule.
Raises:
ValueError
- If the query is empty after trimming.
Returns:
Name | Description |
---|---|
QueryRule | A QueryRule instance with the built query. |