From d18390fd2e95ef098a140bca1f65de59b8e30abc Mon Sep 17 00:00:00 2001 From: Billy Trend Date: Wed, 4 Dec 2024 17:19:53 +0000 Subject: [PATCH] Throw when trying to rerank with v1 --- src/cohere/bedrock_client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cohere/bedrock_client.py b/src/cohere/bedrock_client.py index 0246a288b..3c1d33512 100644 --- a/src/cohere/bedrock_client.py +++ b/src/cohere/bedrock_client.py @@ -25,6 +25,8 @@ def __init__( timeout=timeout, ) + def rerank(self, *, query, documents, model = ..., top_n = ..., rank_fields = ..., return_documents = ..., max_chunks_per_doc = ..., request_options = None): + raise NotImplementedError("Please use cohere.BedrockClientV2 instead: method rerank is not available in the v1 client, cohere.BedrockClient.") class BedrockClientV2(AwsClientV2): def __init__(