tensorlakeai / indexify

A realtime serving engine for Data-Intensive Generative AI Applications
https://docs.tensorlake.ai
Apache License 2.0
925 stars 120 forks source link

Support non pydantic models as accumulators #1040

Open seriousben opened 6 days ago

seriousben commented 6 days ago

Currently when using a list or other non pydantic models as an accumulator, it returns an error AttributeError: 'list' object has no attribute model_validate.

Having normal python types like a list, string, dict, ... as an accumulator should be supported.

Example that is not supported

@indexify_function(
    accumulate=list(),
)
def accumulate(acc: List[str], data: str) -> List[str]:
  ...