Skip to content

Commit fb8e7b6

Browse files
committed
add gen ai system attribute assertion in contract tests
1 parent eea68a8 commit fb8e7b6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

contract-tests/tests/test/amazon/botocore/botocore_test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
_GEN_AI_RESPONSE_FINISH_REASONS: str = "gen_ai.response.finish_reasons"
4444
_GEN_AI_USAGE_INPUT_TOKENS: str = "gen_ai.usage.input_tokens"
4545
_GEN_AI_USAGE_OUTPUT_TOKENS: str = "gen_ai.usage.output_tokens"
46+
_GEN_AI_SYSTEM: str = "gen_ai.system"
4647

4748
_AWS_SECRET_ARN: str = "aws.secretsmanager.secret.arn"
4849
_AWS_STATE_MACHINE_ARN: str = "aws.stepfunctions.state_machine.arn"
@@ -428,6 +429,7 @@ def test_bedrock_runtime_invoke_model_amazon_titan(self):
428429
cloudformation_primary_identifier="amazon.titan-text-premier-v1:0",
429430
request_specific_attributes={
430431
_GEN_AI_REQUEST_MODEL: "amazon.titan-text-premier-v1:0",
432+
_GEN_AI_SYSTEM: "aws.bedrock",
431433
_GEN_AI_REQUEST_MAX_TOKENS: 3072,
432434
_GEN_AI_REQUEST_TEMPERATURE: 0.7,
433435
_GEN_AI_REQUEST_TOP_P: 0.9,
@@ -455,6 +457,7 @@ def test_bedrock_runtime_invoke_model_anthropic_claude(self):
455457
cloudformation_primary_identifier="anthropic.claude-v2:1",
456458
request_specific_attributes={
457459
_GEN_AI_REQUEST_MODEL: "anthropic.claude-v2:1",
460+
_GEN_AI_SYSTEM: "aws.bedrock",
458461
_GEN_AI_REQUEST_MAX_TOKENS: 1000,
459462
_GEN_AI_REQUEST_TEMPERATURE: 0.99,
460463
_GEN_AI_REQUEST_TOP_P: 1,
@@ -482,6 +485,7 @@ def test_bedrock_runtime_invoke_model_meta_llama(self):
482485
cloudformation_primary_identifier="meta.llama2-13b-chat-v1",
483486
request_specific_attributes={
484487
_GEN_AI_REQUEST_MODEL: "meta.llama2-13b-chat-v1",
488+
_GEN_AI_SYSTEM: "aws.bedrock",
485489
_GEN_AI_REQUEST_MAX_TOKENS: 512,
486490
_GEN_AI_REQUEST_TEMPERATURE: 0.5,
487491
_GEN_AI_REQUEST_TOP_P: 0.9,
@@ -509,6 +513,7 @@ def test_bedrock_runtime_invoke_model_cohere_command(self):
509513
cloudformation_primary_identifier="cohere.command-r-v1:0",
510514
request_specific_attributes={
511515
_GEN_AI_REQUEST_MODEL: "cohere.command-r-v1:0",
516+
_GEN_AI_SYSTEM: "aws.bedrock",
512517
_GEN_AI_REQUEST_MAX_TOKENS: 512,
513518
_GEN_AI_REQUEST_TEMPERATURE: 0.5,
514519
_GEN_AI_REQUEST_TOP_P: 0.65,
@@ -538,6 +543,8 @@ def test_bedrock_runtime_invoke_model_ai21_jamba(self):
538543
cloudformation_primary_identifier="ai21.jamba-1-5-large-v1:0",
539544
request_specific_attributes={
540545
_GEN_AI_REQUEST_MODEL: "ai21.jamba-1-5-large-v1:0",
546+
_GEN_AI_SYSTEM: "aws.bedrock",
547+
_GEN_AI_SYSTEM: "aws.bedrock",
541548
_GEN_AI_REQUEST_MAX_TOKENS: 512,
542549
_GEN_AI_REQUEST_TEMPERATURE: 0.6,
543550
_GEN_AI_REQUEST_TOP_P: 0.8,
@@ -565,6 +572,7 @@ def test_bedrock_runtime_invoke_model_mistral(self):
565572
cloudformation_primary_identifier="mistral.mistral-7b-instruct-v0:2",
566573
request_specific_attributes={
567574
_GEN_AI_REQUEST_MODEL: "mistral.mistral-7b-instruct-v0:2",
575+
_GEN_AI_SYSTEM: "aws.bedrock",
568576
_GEN_AI_REQUEST_MAX_TOKENS: 4096,
569577
_GEN_AI_REQUEST_TEMPERATURE: 0.75,
570578
_GEN_AI_REQUEST_TOP_P: 0.99,

0 commit comments

Comments
 (0)