The function signature for documents.import_ is incorrect. The function signature requires that either return_id or return_doc be passed as a parameter as part one of:
DocumentImportParameters: typing.TypeAlias = typing.Union[
DocumentImportParametersReturnId,
DocumentImportParametersReturnDoc,
DocumentImportParametersReturnDocAndId,
]
but the documentation does not require either. you should just be able to just pass the import action:
documents = [{
'id': '124',
'company_name': 'Stark Industries',
'num_employees': 5215,
'country': 'USA'
}]
# IMPORTANT: Be sure to increase connection_timeout_seconds to at least 5 minutes or more for imports,
# when instantiating the client
client.collections['companies'].documents.import_(documents, {'action': 'create'})
https://typesense.org/docs/28.0/api/documents.html#index-multiple-documents