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
Expand Up @@ -41,7 +41,7 @@
_GUARDRAIL_ID: str = "guardrailId"
_GUARDRAIL_ARN: str = "guardrailArn"
_MODEL_ID: str = "modelId"
_AWS_BEDROCK_SYSTEM: str = "aws_bedrock"
_AWS_BEDROCK_SYSTEM: str = "aws.bedrock"

_logger = logging.getLogger(__name__)
# Set logger level to DEBUG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
_BEDROCK_DATASOURCE_ID: str = "DataSourceId"
_BEDROCK_GUARDRAIL_ID: str = "GuardrailId"
_BEDROCK_KNOWLEDGEBASE_ID: str = "KnowledgeBaseId"
_GEN_AI_SYSTEM: str = "aws_bedrock"
_GEN_AI_SYSTEM: str = "aws.bedrock"
_GEN_AI_REQUEST_MODEL: str = "genAiReuqestModelId"
_SECRET_ARN: str = "arn:aws:secretsmanager:us-west-2:000000000000:secret:testSecret-ABCDEF"
_TOPIC_ARN: str = "topicArn"
Expand Down
7 changes: 7 additions & 0 deletions contract-tests/tests/test/amazon/botocore/botocore_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
_GEN_AI_RESPONSE_FINISH_REASONS: str = "gen_ai.response.finish_reasons"
_GEN_AI_USAGE_INPUT_TOKENS: str = "gen_ai.usage.input_tokens"
_GEN_AI_USAGE_OUTPUT_TOKENS: str = "gen_ai.usage.output_tokens"
_GEN_AI_SYSTEM: str = "gen_ai.system"

_AWS_SECRET_ARN: str = "aws.secretsmanager.secret.arn"
_AWS_STATE_MACHINE_ARN: str = "aws.stepfunctions.state_machine.arn"
Expand Down Expand Up @@ -428,6 +429,7 @@ def test_bedrock_runtime_invoke_model_amazon_titan(self):
cloudformation_primary_identifier="amazon.titan-text-premier-v1:0",
request_specific_attributes={
_GEN_AI_REQUEST_MODEL: "amazon.titan-text-premier-v1:0",
_GEN_AI_SYSTEM: "aws.bedrock",
_GEN_AI_REQUEST_MAX_TOKENS: 3072,
_GEN_AI_REQUEST_TEMPERATURE: 0.7,
_GEN_AI_REQUEST_TOP_P: 0.9,
Expand Down Expand Up @@ -455,6 +457,7 @@ def test_bedrock_runtime_invoke_model_anthropic_claude(self):
cloudformation_primary_identifier="anthropic.claude-v2:1",
request_specific_attributes={
_GEN_AI_REQUEST_MODEL: "anthropic.claude-v2:1",
_GEN_AI_SYSTEM: "aws.bedrock",
_GEN_AI_REQUEST_MAX_TOKENS: 1000,
_GEN_AI_REQUEST_TEMPERATURE: 0.99,
_GEN_AI_REQUEST_TOP_P: 1,
Expand Down Expand Up @@ -482,6 +485,7 @@ def test_bedrock_runtime_invoke_model_meta_llama(self):
cloudformation_primary_identifier="meta.llama2-13b-chat-v1",
request_specific_attributes={
_GEN_AI_REQUEST_MODEL: "meta.llama2-13b-chat-v1",
_GEN_AI_SYSTEM: "aws.bedrock",
_GEN_AI_REQUEST_MAX_TOKENS: 512,
_GEN_AI_REQUEST_TEMPERATURE: 0.5,
_GEN_AI_REQUEST_TOP_P: 0.9,
Expand Down Expand Up @@ -509,6 +513,7 @@ def test_bedrock_runtime_invoke_model_cohere_command(self):
cloudformation_primary_identifier="cohere.command-r-v1:0",
request_specific_attributes={
_GEN_AI_REQUEST_MODEL: "cohere.command-r-v1:0",
_GEN_AI_SYSTEM: "aws.bedrock",
_GEN_AI_REQUEST_MAX_TOKENS: 512,
_GEN_AI_REQUEST_TEMPERATURE: 0.5,
_GEN_AI_REQUEST_TOP_P: 0.65,
Expand Down Expand Up @@ -538,6 +543,7 @@ def test_bedrock_runtime_invoke_model_ai21_jamba(self):
cloudformation_primary_identifier="ai21.jamba-1-5-large-v1:0",
request_specific_attributes={
_GEN_AI_REQUEST_MODEL: "ai21.jamba-1-5-large-v1:0",
_GEN_AI_SYSTEM: "aws.bedrock",
_GEN_AI_REQUEST_MAX_TOKENS: 512,
_GEN_AI_REQUEST_TEMPERATURE: 0.6,
_GEN_AI_REQUEST_TOP_P: 0.8,
Expand Down Expand Up @@ -565,6 +571,7 @@ def test_bedrock_runtime_invoke_model_mistral(self):
cloudformation_primary_identifier="mistral.mistral-7b-instruct-v0:2",
request_specific_attributes={
_GEN_AI_REQUEST_MODEL: "mistral.mistral-7b-instruct-v0:2",
_GEN_AI_SYSTEM: "aws.bedrock",
_GEN_AI_REQUEST_MAX_TOKENS: 4096,
_GEN_AI_REQUEST_TEMPERATURE: 0.75,
_GEN_AI_REQUEST_TOP_P: 0.99,
Expand Down
Loading