Object Set Filtering using Array in AIP

I am unable to filter object set variable in AIP using an array. I want to filter on a particular column that matches all the elements of the array and store it as a subset ObjectSet. I did create a function to do so, But that function returns a Object list and not Objectset. I need the Objectset Type to feed it to LLM (LLM block was build on the input of an Objectset)

You should be able to use the “filter” method on object sets. You may also want to take a look at the API that we provide for composing filters: https://www.palantir.com/docs/foundry/functions/api-object-sets/#combining-filters

If you still need help, it would be best to provide a sample of your code and example inputs/outputs. That will help clarify exactly what you are trying to achieve.

I did try the “filter” method on Object sets. But it didn’t enable variable selection of type array. It only accepts either string or input:literals datatype.

In terms of API for combining filters, I tried that in code repository. It works, but the output of the function is an Object list. I want the function output to be an object set, so that I can call the function within the AIP file and utilize the output as an input to the LLM block.

LLM block is not accepting Object List as an input in the Task prompt.

I see. For array type properties, we only expose a “contains” operation as noted here: https://www.palantir.com/docs/foundry/functions/api-object-sets/#filtering

In order to perform filters on a property, you also need to make sure it’s searchable: https://www.palantir.com/docs/foundry/functions/api-object-sets/#api-object-sets

Again, it would be best to provide a full sample of your code and example inputs/outputs. It is still not clear exactly what kind of filter you are trying to apply (e.g., a “containsExactly”, “containsExactlyInAnyOrder”, “containsAll”, etc.)

We released a couple of features to help you get unblocked here

  1. If you’d like to feed your Object List into the UseLLM board, you can convert it to a struct and then pass it in.
  2. We also support Object List → Object Set conversion if you’d prefer doing that before sending it to the board.