utils Module
Classes
| OptionsUpdateFunctionType |
Type definition for the options update function in Text Search. |
Functions
create_options
Create search options.
If options are supplied, they are checked for the right type, and the kwargs are used to update the options.
If options are not supplied, they are created from the kwargs. If that fails, an empty options object is returned.
create_options(options_class: type[SearchOptions], options: SearchOptions | None, **kwargs: Any) -> SearchOptions
Parameters
| Name | Description |
|---|---|
|
options_class
Required
|
The class of the options. |
|
options
Required
|
The existing options to update. |
|
**kwargs
Required
|
The keyword arguments to use to create the options. |
Returns
| Type | Description |
|---|---|
|
The options. |
Exceptions
| Type | Description |
|---|---|
|
ValidationError
|
If the options are not valid. |
default_options_update_function
The default options update function.
This function is used to update the query and options with the kwargs. You can supply your own version of this function to customize the behavior.
default_options_update_function(query: str, options: SearchOptions, parameters: list[KernelParameterMetadata] | None = None, **kwargs: Any) -> tuple[str, SearchOptions]
Parameters
| Name | Description |
|---|---|
|
query
Required
|
The query. |
|
options
Required
|
The options. |
|
parameters
|
The parameters to use to create the options. Default value: None
|
|
**kwargs
Required
|
The keyword arguments to use to update the options. |
Returns
| Type | Description |
|---|---|
|
The updated query and options |