@@ -216,7 +216,7 @@ async def create_item(
216216 initial_headers : Optional [dict [str , str ]] = None ,
217217 priority : Optional [Literal ["High" , "Low" ]] = None ,
218218 no_response : Optional [bool ] = None ,
219- retry_write : Optional [bool ] = None ,
219+ retry_write : Optional [int ] = None ,
220220 throughput_bucket : Optional [int ] = None ,
221221 ** kwargs : Any
222222 ) -> CosmosDict :
@@ -246,9 +246,9 @@ async def create_item(
246246 :keyword bool no_response: Indicates whether service should be instructed to skip
247247 sending response payloads. When not specified explicitly here, the default value will be determined from
248248 client-level options.
249- :keyword bool retry_write: Indicates whether the SDK should automatically retry this write operation, even if
249+ :keyword int retry_write: Indicates how many times the SDK should automatically retry this write operation, even if
250250 the operation is not guaranteed to be idempotent. This should only be enabled if the application can
251- tolerate such risks or has logic to safely detect and handle duplicate operations.
251+ tolerate such risks or has logic to safely detect and handle duplicate operations. Default is None (no retries).
252252 :keyword int throughput_bucket: The desired throughput bucket for the client
253253 :raises ~azure.cosmos.exceptions.CosmosHttpResponseError: Item with the given ID already exists.
254254 :returns: A CosmosDict representing the new item. The dict will be empty if `no_response` is specified.
@@ -1103,7 +1103,7 @@ async def upsert_item(
11031103 match_condition : Optional [MatchConditions ] = None ,
11041104 priority : Optional [Literal ["High" , "Low" ]] = None ,
11051105 no_response : Optional [bool ] = None ,
1106- retry_write : Optional [bool ] = None ,
1106+ retry_write : Optional [int ] = None ,
11071107 throughput_bucket : Optional [int ] = None ,
11081108 ** kwargs : Any
11091109 ) -> CosmosDict :
@@ -1129,9 +1129,9 @@ async def upsert_item(
11291129 :keyword bool no_response: Indicates whether service should be instructed to skip
11301130 sending response payloads. When not specified explicitly here, the default value will be determined from
11311131 client-level options.
1132- :keyword bool retry_write: Indicates whether the SDK should automatically retry this write operation, even if
1132+ :keyword int retry_write: Indicates how many times the SDK should automatically retry this write operation, even if
11331133 the operation is not guaranteed to be idempotent. This should only be enabled if the application can
1134- tolerate such risks or has logic to safely detect and handle duplicate operations.
1134+ tolerate such risks or has logic to safely detect and handle duplicate operations. Default is None (no retries).
11351135 :keyword int throughput_bucket: The desired throughput bucket for the client
11361136 :keyword Sequence[str] excluded_locations: Excluded locations to be skipped from preferred locations. The locations
11371137 in this list are specified as the names of the azure Cosmos locations like, 'West US', 'East US' and so on.
@@ -1178,29 +1178,28 @@ async def upsert_item(
11781178 @distributed_trace_async
11791179 async def semantic_rerank (
11801180 self ,
1181- reranking_context : str ,
1181+ * ,
1182+ context : str ,
11821183 documents : list [str ],
1183- semantic_reranking_options : Optional [dict [str , Any ]] = None
1184+ options : Optional [dict [str , Any ]] = None
11841185 ) -> CosmosDict :
1185- """Rerank a list of documents using semantic reranking.
1186+ """ **provisional** Rerank a list of documents using semantic reranking.
11861187
11871188 This method uses a semantic reranker to score and reorder the provided documents
11881189 based on their relevance to the given reranking context.
11891190
1190- :param str reranking_context : The context or query string to use for reranking the documents.
1191- :param list[str] documents: A list of documents (as strings) to be reranked.
1192- :param dict[str, Any] semantic_reranking_options : Optional dictionary of additional options to customize the semantic reranking process.
1191+ :keyword str context : The reranking context or query string to use for reranking the documents.
1192+ :keyword list[str] documents: A list of documents (as strings) to be reranked.
1193+ :keyword dict[str, Any] options : Optional dictionary of additional request options to customize the semantic reranking process.
11931194
11941195 Supported options:
1195-
11961196 * **return_documents** (bool): Whether to return the document text in the response. If False, only scores and indices are returned. Default is True.
11971197 * **top_k** (int): Maximum number of documents to return in the reranked results. If not specified, all documents are returned.
11981198 * **batch_size** (int): Number of documents to process in each batch. Used for optimizing performance with large document sets.
11991199 * **sort** (bool): Whether to sort the results by relevance score in descending order. Default is True.
12001200 * **document_type** (str): Type of documents being reranked. Supported values are "string" and "json".
12011201 * **target_paths** (str): If document_type is "json", the list of JSON paths to extract text from for reranking. Comma-separated string.
12021202
1203- :type semantic_reranking_options: Optional[dict[str, Any]]
12041203 :returns: A CosmosDict containing the reranking results. The structure typically includes results list with reranked documents and their relevance scores. Each result contains index, relevance_score, and optionally document.
12051204 :rtype: ~azure.cosmos.CosmosDict[str, Any]
12061205 :raises ~azure.cosmos.exceptions.CosmosHttpResponseError: If the semantic reranking operation fails.
@@ -1214,9 +1213,9 @@ async def semantic_rerank(
12141213 )
12151214
12161215 result = await inference_service .rerank (
1217- reranking_context = reranking_context ,
1216+ reranking_context = context ,
12181217 documents = documents ,
1219- semantic_reranking_options = semantic_reranking_options
1218+ semantic_reranking_options = options
12201219 )
12211220
12221221 return result
@@ -1235,7 +1234,7 @@ async def replace_item(
12351234 match_condition : Optional [MatchConditions ] = None ,
12361235 priority : Optional [Literal ["High" , "Low" ]] = None ,
12371236 no_response : Optional [bool ] = None ,
1238- retry_write : Optional [bool ] = None ,
1237+ retry_write : Optional [int ] = None ,
12391238 throughput_bucket : Optional [int ] = None ,
12401239 ** kwargs : Any
12411240 ) -> CosmosDict :
@@ -1262,9 +1261,9 @@ async def replace_item(
12621261 :keyword bool no_response: Indicates whether service should be instructed to skip
12631262 sending response payloads. When not specified explicitly here, the default value will be determined from
12641263 client-level options.
1265- :keyword bool retry_write: Indicates whether the SDK should automatically retry this write operation, even if
1264+ :keyword int retry_write: Indicates how many times the SDK should automatically retry this write operation, even if
12661265 the operation is not guaranteed to be idempotent. This should only be enabled if the application can
1267- tolerate such risks or has logic to safely detect and handle duplicate operations.
1266+ tolerate such risks or has logic to safely detect and handle duplicate operations. Default is None (no retries).
12681267 :keyword int throughput_bucket: The desired throughput bucket for the client
12691268 :keyword Sequence[str] excluded_locations: Excluded locations to be skipped from preferred locations. The locations
12701269 in this list are specified as the names of the azure Cosmos locations like, 'West US', 'East US' and so on.
@@ -1322,7 +1321,7 @@ async def patch_item(
13221321 match_condition : Optional [MatchConditions ] = None ,
13231322 priority : Optional [Literal ["High" , "Low" ]] = None ,
13241323 no_response : Optional [bool ] = None ,
1325- retry_write : Optional [bool ] = None ,
1324+ retry_write : Optional [int ] = None ,
13261325 throughput_bucket : Optional [int ] = None ,
13271326 ** kwargs : Any
13281327 ) -> CosmosDict :
@@ -1355,9 +1354,9 @@ async def patch_item(
13551354 :keyword bool no_response: Indicates whether service should be instructed to skip
13561355 sending response payloads. When not specified explicitly here, the default value will be determined from
13571356 client-level options.
1358- :keyword bool retry_write: Indicates whether the SDK should automatically retry this write operation, even if
1357+ :keyword int retry_write: Indicates how many times the SDK should automatically retry this write operation, even if
13591358 the operation is not guaranteed to be idempotent. This should only be enabled if the application can
1360- tolerate such risks or has logic to safely detect and handle duplicate operations.
1359+ tolerate such risks or has logic to safely detect and handle duplicate operations. Default is None (no retries).
13611360 :keyword int throughput_bucket: The desired throughput bucket for the client
13621361 :keyword Sequence[str] excluded_locations: Excluded locations to be skipped from preferred locations. The locations
13631362 in this list are specified as the names of the azure Cosmos locations like, 'West US', 'East US' and so on.
@@ -1413,7 +1412,7 @@ async def delete_item(
14131412 etag : Optional [str ] = None ,
14141413 match_condition : Optional [MatchConditions ] = None ,
14151414 priority : Optional [Literal ["High" , "Low" ]] = None ,
1416- retry_write : Optional [bool ] = None ,
1415+ retry_write : Optional [int ] = None ,
14171416 throughput_bucket : Optional [int ] = None ,
14181417 ** kwargs : Any
14191418 ) -> None :
@@ -1443,9 +1442,9 @@ async def delete_item(
14431442 in this list are specified as the names of the azure Cosmos locations like, 'West US', 'East US' and so on.
14441443 If all preferred locations were excluded, primary/hub location will be used.
14451444 This excluded_location will override existing excluded_locations in client level.
1446- :keyword bool retry_write: Indicates whether the SDK should automatically retry this write operation, even if
1445+ :keyword int retry_write: Indicates how many times the SDK should automatically retry this write operation, even if
14471446 the operation is not guaranteed to be idempotent. This should only be enabled if the application can
1448- tolerate such risks or has logic to safely detect and handle duplicate operations.
1447+ tolerate such risks or has logic to safely detect and handle duplicate operations. Default is None (no retries).
14491448 :keyword response_hook: A callable invoked with the response metadata.
14501449 :paramtype response_hook: Callable[[Mapping[str, str], None], None]
14511450 :keyword int throughput_bucket: The desired throughput bucket for the client
0 commit comments