developmentseed/labs-gpt-stac

Enable more complex STAC filters

Opened this issue · 0 comments

Currently, we only use the bbox and datetime parameters to search STAC: https://github.com/developmentseed/labs-gpt-stac/blob/main/main.py#L167

We should give ChatGPT access to the full range of search options, allowing it to make more nuanced queries based on user input.

This would likely involve:

  • Augmenting the stac action in main.py to accept a cql2-json JSON object with filter parameters
  • "Teach" ChatGPT in the prompt how to write cql2-json, what its different options are to filter by on properties, etc. and ask it to create valid cql2-json which we parse in the stac action.

This might be a bit more work to handle edge cases / where ChatGPT fails to write valid cql2-json - we may need to add a validator and ask it to validate its json until it gets it right.

It's unclear how well this would or wouldn't work, but definitely something we should try out - it would be cool to be able to ask it questions to filter out images with clouds, or from a particular satellite, etc.

cc @geohacker