def foo(self, docs: DocumentArray, **kwargs): def bar(d: Document): d.text = 'hello' return d docs.apply(bar) return docs
async def foo(self, docs: DocumentArray, **kwargs): docs.apply(set_hello) return docs