Skip to content

Commit e05daff

Browse files
committed
Add assertion for the manually added assistant message
1 parent 723e504 commit e05daff

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_bedrock.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,14 +1459,19 @@ def test_invoke_model_with_content_assistant_content_as_string(
14591459
user_content = {"content": "say this is a test"}
14601460
assert_message_in_logs(logs[0], "gen_ai.user.message", user_content, span)
14611461

1462-
message = {
1462+
assistant_content = {"content": "{"}
1463+
assert_message_in_logs(
1464+
logs[1], "gen_ai.assistant.message", assistant_content, span
1465+
)
1466+
1467+
assistant_response_message = {
14631468
"role": "assistant",
14641469
"content": [{"type": "text", "text": "this is a test}"}],
14651470
}
14661471
choice_body = {
14671472
"index": 0,
14681473
"finish_reason": "end_turn",
1469-
"message": message,
1474+
"message": assistant_response_message,
14701475
}
14711476
assert_message_in_logs(logs[2], "gen_ai.choice", choice_body, span)
14721477

0 commit comments

Comments
 (0)