core[patch]: Clarify upsert response semantics (#23921)

This commit is contained in:
Eugene Yurtsev 2024-07-05 15:59:47 -04:00 committed by GitHub
parent fcd018be47
commit e0186df56b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -428,6 +428,19 @@ class UpsertResponse(TypedDict):
The upsert response will be used by abstractions that implement an upsert
operation for content that can be upserted by ID.
Upsert APIs that accept inputs with IDs and generate IDs internally
will return a response that includes the IDs that succeeded and the IDs
that failed.
If there are no failures, the failed list will be empty, and the order
of the IDs in the succeeded list will match the order of the input documents.
If there are failures, the response becomes ill defined, and a user of the API
cannot determine which generated ID corresponds to which input document.
It is recommended for users explicitly attach the IDs to the items being
indexed to avoid this issue.
"""
succeeded: List[str]