Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .ranker import AmazonBedrockRanker, BedrockRanker
from .ranker import AmazonBedrockRanker

__all__ = ["AmazonBedrockRanker", "BedrockRanker"]
__all__ = ["AmazonBedrockRanker"]
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import warnings
from typing import Any, Dict, List, Optional

from botocore.exceptions import ClientError
Expand Down Expand Up @@ -265,20 +264,3 @@ def resolve_secret(secret: Optional[Secret]) -> Optional[str]:
except Exception as exception:
msg = f"Error during Amazon Bedrock API call: {exception}"
raise AmazonBedrockInferenceError(msg) from exception


class BedrockRanker(AmazonBedrockRanker):
"""
Deprecated alias for AmazonBedrockRanker.
This class will be removed in a future version.
Please use AmazonBedrockRanker instead.
"""

def __init__(self, *args, **kwargs):
warnings.warn(
"BedrockRanker is deprecated and will be removed in a future version. "
"Please use AmazonBedrockRanker instead.",
DeprecationWarning,
stacklevel=2,
)
super().__init__(*args, **kwargs)
4 changes: 2 additions & 2 deletions integrations/amazon_bedrock/tests/test_ranker.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from haystack_integrations.common.amazon_bedrock.errors import (
AmazonBedrockInferenceError,
)
from haystack_integrations.components.rankers.amazon_bedrock import AmazonBedrockRanker, BedrockRanker
from haystack_integrations.components.rankers.amazon_bedrock import AmazonBedrockRanker


@pytest.fixture
Expand All @@ -31,7 +31,7 @@ def test_amazon_bedrock_ranker_initialization(mock_aws_session):


def test_bedrock_ranker_run(mock_aws_session):
ranker = BedrockRanker(
ranker = AmazonBedrockRanker(
model="cohere.rerank-v3-5:0",
top_k=2,
aws_access_key_id=Secret.from_token("test_access_key"),
Expand Down
Loading