Skip to content

Commit 909fadc

Browse files
author
awstools
committed
feat(client-bedrock-agent-runtime): Changes for enhanced metadata in trace
1 parent 11300e3 commit 909fadc

File tree

5 files changed

+389
-103
lines changed

5 files changed

+389
-103
lines changed

clients/client-bedrock-agent-runtime/src/commands/InvokeAgentCommand.ts

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,17 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
424424
* // },
425425
* // },
426426
* // ],
427+
* // metadata: { // Metadata
428+
* // startTime: new Date("TIMESTAMP"),
429+
* // endTime: new Date("TIMESTAMP"),
430+
* // totalTimeMs: Number("long"),
431+
* // operationTotalTimeMs: Number("long"),
432+
* // clientRequestId: "STRING_VALUE",
433+
* // usage: { // Usage
434+
* // inputTokens: Number("int"),
435+
* // outputTokens: Number("int"),
436+
* // },
437+
* // },
427438
* // },
428439
* // preProcessingTrace: { // PreProcessingTrace Union: only one key present
429440
* // modelInvocationInput: { // ModelInvocationInput
@@ -453,8 +464,13 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
453464
* // rawResponse: { // RawResponse
454465
* // content: "STRING_VALUE",
455466
* // },
456-
* // metadata: { // Metadata
457-
* // usage: { // Usage
467+
* // metadata: {
468+
* // startTime: new Date("TIMESTAMP"),
469+
* // endTime: new Date("TIMESTAMP"),
470+
* // totalTimeMs: Number("long"),
471+
* // operationTotalTimeMs: Number("long"),
472+
* // clientRequestId: "STRING_VALUE",
473+
* // usage: {
458474
* // inputTokens: Number("int"),
459475
* // outputTokens: Number("int"),
460476
* // },
@@ -575,6 +591,7 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
575591
* // type: "ACTION_GROUP" || "AGENT_COLLABORATOR" || "KNOWLEDGE_BASE" || "FINISH" || "ASK_USER" || "REPROMPT",
576592
* // actionGroupInvocationOutput: { // ActionGroupInvocationOutput
577593
* // text: "STRING_VALUE",
594+
* // metadata: "<Metadata>",
578595
* // },
579596
* // agentCollaboratorInvocationOutput: { // AgentCollaboratorInvocationOutput
580597
* // agentCollaboratorName: "STRING_VALUE",
@@ -628,6 +645,7 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
628645
* // invocationId: "STRING_VALUE",
629646
* // },
630647
* // },
648+
* // metadata: "<Metadata>",
631649
* // },
632650
* // knowledgeBaseLookupOutput: { // KnowledgeBaseLookupOutput
633651
* // retrievedReferences: [
@@ -676,9 +694,11 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
676694
* // },
677695
* // },
678696
* // ],
697+
* // metadata: "<Metadata>",
679698
* // },
680699
* // finalResponse: { // FinalResponse
681700
* // text: "STRING_VALUE",
701+
* // metadata: "<Metadata>",
682702
* // },
683703
* // repromptResponse: { // RepromptResponse
684704
* // text: "STRING_VALUE",
@@ -691,6 +711,7 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
691711
* // "STRING_VALUE",
692712
* // ],
693713
* // executionTimeout: true || false,
714+
* // metadata: "<Metadata>",
694715
* // },
695716
* // },
696717
* // modelInvocationInput: {
@@ -716,12 +737,7 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
716737
* // rawResponse: {
717738
* // content: "STRING_VALUE",
718739
* // },
719-
* // metadata: {
720-
* // usage: {
721-
* // inputTokens: Number("int"),
722-
* // outputTokens: Number("int"),
723-
* // },
724-
* // },
740+
* // metadata: "<Metadata>",
725741
* // reasoningContent: {// Union: only one key present
726742
* // reasoningText: {
727743
* // text: "STRING_VALUE", // required
@@ -758,12 +774,7 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
758774
* // rawResponse: {
759775
* // content: "STRING_VALUE",
760776
* // },
761-
* // metadata: {
762-
* // usage: {
763-
* // inputTokens: Number("int"),
764-
* // outputTokens: Number("int"),
765-
* // },
766-
* // },
777+
* // metadata: "<Metadata>",
767778
* // reasoningContent: {// Union: only one key present
768779
* // reasoningText: {
769780
* // text: "STRING_VALUE", // required
@@ -868,6 +879,7 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
868879
* // type: "ACTION_GROUP" || "AGENT_COLLABORATOR" || "KNOWLEDGE_BASE" || "FINISH" || "ASK_USER" || "REPROMPT",
869880
* // actionGroupInvocationOutput: {
870881
* // text: "STRING_VALUE",
882+
* // metadata: "<Metadata>",
871883
* // },
872884
* // agentCollaboratorInvocationOutput: {
873885
* // agentCollaboratorName: "STRING_VALUE",
@@ -921,6 +933,7 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
921933
* // invocationId: "STRING_VALUE",
922934
* // },
923935
* // },
936+
* // metadata: "<Metadata>",
924937
* // },
925938
* // knowledgeBaseLookupOutput: {
926939
* // retrievedReferences: [
@@ -969,9 +982,11 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
969982
* // },
970983
* // },
971984
* // ],
985+
* // metadata: "<Metadata>",
972986
* // },
973987
* // finalResponse: {
974988
* // text: "STRING_VALUE",
989+
* // metadata: "<Metadata>",
975990
* // },
976991
* // repromptResponse: {
977992
* // text: "STRING_VALUE",
@@ -984,6 +999,7 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
984999
* // "STRING_VALUE",
9851000
* // ],
9861001
* // executionTimeout: true || false,
1002+
* // metadata: "<Metadata>",
9871003
* // },
9881004
* // },
9891005
* // modelInvocationInput: {
@@ -1009,17 +1025,14 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
10091025
* // rawResponse: {
10101026
* // content: "STRING_VALUE",
10111027
* // },
1012-
* // metadata: {
1013-
* // usage: {
1014-
* // inputTokens: Number("int"),
1015-
* // outputTokens: Number("int"),
1016-
* // },
1017-
* // },
1028+
* // metadata: "<Metadata>",
10181029
* // },
10191030
* // },
10201031
* // failureTrace: { // FailureTrace
10211032
* // traceId: "STRING_VALUE",
10221033
* // failureReason: "STRING_VALUE",
1034+
* // failureCode: Number("int"),
1035+
* // metadata: "<Metadata>",
10231036
* // },
10241037
* // customOrchestrationTrace: { // CustomOrchestrationTrace
10251038
* // traceId: "STRING_VALUE",

clients/client-bedrock-agent-runtime/src/commands/InvokeInlineAgentCommand.ts

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,17 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
637637
* // },
638638
* // },
639639
* // ],
640+
* // metadata: { // Metadata
641+
* // startTime: new Date("TIMESTAMP"),
642+
* // endTime: new Date("TIMESTAMP"),
643+
* // totalTimeMs: Number("long"),
644+
* // operationTotalTimeMs: Number("long"),
645+
* // clientRequestId: "STRING_VALUE",
646+
* // usage: { // Usage
647+
* // inputTokens: Number("int"),
648+
* // outputTokens: Number("int"),
649+
* // },
650+
* // },
640651
* // },
641652
* // preProcessingTrace: { // PreProcessingTrace Union: only one key present
642653
* // modelInvocationInput: { // ModelInvocationInput
@@ -666,8 +677,13 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
666677
* // rawResponse: { // RawResponse
667678
* // content: "STRING_VALUE",
668679
* // },
669-
* // metadata: { // Metadata
670-
* // usage: { // Usage
680+
* // metadata: {
681+
* // startTime: new Date("TIMESTAMP"),
682+
* // endTime: new Date("TIMESTAMP"),
683+
* // totalTimeMs: Number("long"),
684+
* // operationTotalTimeMs: Number("long"),
685+
* // clientRequestId: "STRING_VALUE",
686+
* // usage: {
671687
* // inputTokens: Number("int"),
672688
* // outputTokens: Number("int"),
673689
* // },
@@ -788,6 +804,7 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
788804
* // type: "ACTION_GROUP" || "AGENT_COLLABORATOR" || "KNOWLEDGE_BASE" || "FINISH" || "ASK_USER" || "REPROMPT",
789805
* // actionGroupInvocationOutput: { // ActionGroupInvocationOutput
790806
* // text: "STRING_VALUE",
807+
* // metadata: "<Metadata>",
791808
* // },
792809
* // agentCollaboratorInvocationOutput: { // AgentCollaboratorInvocationOutput
793810
* // agentCollaboratorName: "STRING_VALUE",
@@ -841,6 +858,7 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
841858
* // invocationId: "STRING_VALUE",
842859
* // },
843860
* // },
861+
* // metadata: "<Metadata>",
844862
* // },
845863
* // knowledgeBaseLookupOutput: { // KnowledgeBaseLookupOutput
846864
* // retrievedReferences: [
@@ -889,9 +907,11 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
889907
* // },
890908
* // },
891909
* // ],
910+
* // metadata: "<Metadata>",
892911
* // },
893912
* // finalResponse: { // FinalResponse
894913
* // text: "STRING_VALUE",
914+
* // metadata: "<Metadata>",
895915
* // },
896916
* // repromptResponse: { // RepromptResponse
897917
* // text: "STRING_VALUE",
@@ -904,6 +924,7 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
904924
* // "STRING_VALUE",
905925
* // ],
906926
* // executionTimeout: true || false,
927+
* // metadata: "<Metadata>",
907928
* // },
908929
* // },
909930
* // modelInvocationInput: {
@@ -929,12 +950,7 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
929950
* // rawResponse: {
930951
* // content: "STRING_VALUE",
931952
* // },
932-
* // metadata: {
933-
* // usage: {
934-
* // inputTokens: Number("int"),
935-
* // outputTokens: Number("int"),
936-
* // },
937-
* // },
953+
* // metadata: "<Metadata>",
938954
* // reasoningContent: {// Union: only one key present
939955
* // reasoningText: {
940956
* // text: "STRING_VALUE", // required
@@ -971,12 +987,7 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
971987
* // rawResponse: {
972988
* // content: "STRING_VALUE",
973989
* // },
974-
* // metadata: {
975-
* // usage: {
976-
* // inputTokens: Number("int"),
977-
* // outputTokens: Number("int"),
978-
* // },
979-
* // },
990+
* // metadata: "<Metadata>",
980991
* // reasoningContent: {// Union: only one key present
981992
* // reasoningText: {
982993
* // text: "STRING_VALUE", // required
@@ -1081,6 +1092,7 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
10811092
* // type: "ACTION_GROUP" || "AGENT_COLLABORATOR" || "KNOWLEDGE_BASE" || "FINISH" || "ASK_USER" || "REPROMPT",
10821093
* // actionGroupInvocationOutput: {
10831094
* // text: "STRING_VALUE",
1095+
* // metadata: "<Metadata>",
10841096
* // },
10851097
* // agentCollaboratorInvocationOutput: {
10861098
* // agentCollaboratorName: "STRING_VALUE",
@@ -1134,6 +1146,7 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
11341146
* // invocationId: "STRING_VALUE",
11351147
* // },
11361148
* // },
1149+
* // metadata: "<Metadata>",
11371150
* // },
11381151
* // knowledgeBaseLookupOutput: {
11391152
* // retrievedReferences: [
@@ -1182,9 +1195,11 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
11821195
* // },
11831196
* // },
11841197
* // ],
1198+
* // metadata: "<Metadata>",
11851199
* // },
11861200
* // finalResponse: {
11871201
* // text: "STRING_VALUE",
1202+
* // metadata: "<Metadata>",
11881203
* // },
11891204
* // repromptResponse: {
11901205
* // text: "STRING_VALUE",
@@ -1197,6 +1212,7 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
11971212
* // "STRING_VALUE",
11981213
* // ],
11991214
* // executionTimeout: true || false,
1215+
* // metadata: "<Metadata>",
12001216
* // },
12011217
* // },
12021218
* // modelInvocationInput: {
@@ -1222,17 +1238,14 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
12221238
* // rawResponse: {
12231239
* // content: "STRING_VALUE",
12241240
* // },
1225-
* // metadata: {
1226-
* // usage: {
1227-
* // inputTokens: Number("int"),
1228-
* // outputTokens: Number("int"),
1229-
* // },
1230-
* // },
1241+
* // metadata: "<Metadata>",
12311242
* // },
12321243
* // },
12331244
* // failureTrace: { // FailureTrace
12341245
* // traceId: "STRING_VALUE",
12351246
* // failureReason: "STRING_VALUE",
1247+
* // failureCode: Number("int"),
1248+
* // metadata: "<Metadata>",
12361249
* // },
12371250
* // customOrchestrationTrace: { // CustomOrchestrationTrace
12381251
* // traceId: "STRING_VALUE",

0 commit comments

Comments
 (0)