Shortcuts

MiddlewareConfig

class geodesic.boson.MiddlewareConfig(*args, **kwargs)[source]

Bases: geodesic.bases._APIObject

Configures the Middleware for a Dataset

Middleware can be applied to a dataset to perform actions on the data before it is returned to the user, but without influencing the underlying data. This can be useful for things like filtering, transforming, or enhancing the data in some way. Middleware can be applied to the search and pixels handlers of a dataset.

Middleware is broken into a few different pieces:

  • Search Filters: These are filters that are applied to the search results of a dataset. They can be used to

    filter the results of a search based on some criteria. These should ONLY be applied to providers that don’t offer filtering themselves. When in doubt DON’T apply filters. Most providers have them implemented and this is generally not needed. If you’ve implemented a remote provider with a relatively small number of features, this can be useful since implementing filtering on the provider side can be difficult.

  • Search Transforms: These are transforms that are applied to the search results of a dataset. They can be used

    to rename fields, combine fields, or otherwise modify the results of a search. These can be applied either before or after search filters. In the former case, set search_transforms_before and in the latter case, set search_transforms_after.

  • Pixels Transforms: These are transforms that are applied to the pixels handler of a dataset. They can be used

    to apply colormaps, rescale pixel values, or otherwise modify the pixels data. Many of them can create new assets in the dataset while some may modifiy existing assets.

search_filters

(SearchFilter, dict) - Which filter actions to perform applied to the result of a dataset.

Descriptor: _ListDescr

search_transforms_before

(SearchTransform, dict) - transforms to be applied to each feature/item in a search response. This is applied BEFORE any filtering takes place

Descriptor: _ListDescr

search_transforms_after

(SearchTransform, dict) - transforms to be applied to each feature/item in a search response. This is applied AFTER any filtering takes place

Descriptor: _ListDescr

pixels_transforms

(PixelsTransform, dict) - transforms the request/response of a pixels handler. Useful for things like applying colormaps or more complex transformations on the pixels data.

Descriptor: _ListDescr

Docs

Developer documentation for Seer AI APIs

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources