Skip to content

Commit ed3d3e1

Browse files
authored
Update models used in bedrock system tests (#55229)
The anthropic.claude-3-sonnet-20240229-v1:0 model is being deprecated so we need to move to a new model. Also updating the input schema that the newer model expects.
1 parent c160ab7 commit ed3d3e1

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

providers/amazon/tests/system/amazon/aws/example_bedrock_batch_inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
# the Amazon Bedrock console and may take up to 24 hours to apply:
6868
#######################################################################
6969

70-
CLAUDE_MODEL_ID = "anthropic.claude-3-sonnet-20240229-v1:0"
70+
CLAUDE_MODEL_ID = "anthropic.claude-3-5-sonnet-20241022-v2:0"
7171
ANTHROPIC_VERSION = "bedrock-2023-05-31"
7272

7373
# Batch inferences currently require a minimum of 100 prompts per batch.

providers/amazon/tests/system/amazon/aws/example_bedrock_retrieve_and_generate.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@
8181
# the Amazon Bedrock console and may take up to 24 hours to apply:
8282
#######################################################################
8383

84-
CLAUDE_MODEL_ID = "anthropic.claude-v2"
84+
CLAUDE_MODEL_ID = "anthropic.claude-3-5-sonnet-20241022-v2:0"
8585
TITAN_MODEL_ID = "amazon.titan-embed-text-v1"
86+
ANTHROPIC_VERSION = "bedrock-2023-05-31"
8687

8788
# Externally fetched variables:
8889
ROLE_ARN_KEY = "ROLE_ARN"
@@ -487,7 +488,13 @@ def delete_opensearch_policies(collection_name: str):
487488
invoke_claude_completions = BedrockInvokeModelOperator(
488489
task_id="invoke_claude_completions",
489490
model_id=CLAUDE_MODEL_ID,
490-
input_data={"max_tokens_to_sample": 4000, "prompt": f"\n\nHuman: {PROMPT}\n\nAssistant:"},
491+
input_data={
492+
"max_tokens": 4000,
493+
"anthropic_version": ANTHROPIC_VERSION,
494+
"messages": [
495+
{"role": "user", "content": f"\n\nHuman: {PROMPT}\n\nAssistant:"},
496+
],
497+
},
491498
)
492499
# [END howto_operator_invoke_claude_model]
493500

0 commit comments

Comments
 (0)