Skip to content

Commit 172abbd

Browse files
Changes for enhanced metadata in trace
1 parent 2a53e38 commit 172abbd

19 files changed

+440
-8
lines changed

generator/ServiceModels/bedrock-agent-runtime/bedrock-agent-runtime-2023-07-26.api.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@
548548
"ActionGroupInvocationOutput":{
549549
"type":"structure",
550550
"members":{
551+
"metadata":{"shape":"Metadata"},
551552
"text":{"shape":"ActionGroupOutputString"}
552553
}
553554
},
@@ -666,6 +667,7 @@
666667
"members":{
667668
"agentCollaboratorAliasArn":{"shape":"AgentAliasArn"},
668669
"agentCollaboratorName":{"shape":"String"},
670+
"metadata":{"shape":"Metadata"},
669671
"output":{"shape":"AgentCollaboratorOutputPayload"}
670672
}
671673
},
@@ -928,7 +930,8 @@
928930
"executionError":{"shape":"String"},
929931
"executionOutput":{"shape":"String"},
930932
"executionTimeout":{"shape":"Boolean"},
931-
"files":{"shape":"Files"}
933+
"files":{"shape":"Files"},
934+
"metadata":{"shape":"Metadata"}
932935
}
933936
},
934937
"CollaborationInstruction":{
@@ -1276,7 +1279,9 @@
12761279
"FailureTrace":{
12771280
"type":"structure",
12781281
"members":{
1282+
"failureCode":{"shape":"Integer"},
12791283
"failureReason":{"shape":"FailureReasonString"},
1284+
"metadata":{"shape":"Metadata"},
12801285
"traceId":{"shape":"TraceId"}
12811286
},
12821287
"sensitive":true
@@ -1365,6 +1370,7 @@
13651370
"FinalResponse":{
13661371
"type":"structure",
13671372
"members":{
1373+
"metadata":{"shape":"Metadata"},
13681374
"text":{"shape":"FinalResponseString"}
13691375
}
13701376
},
@@ -2131,6 +2137,7 @@
21312137
"members":{
21322138
"action":{"shape":"GuardrailAction"},
21332139
"inputAssessments":{"shape":"GuardrailAssessmentList"},
2140+
"metadata":{"shape":"Metadata"},
21342141
"outputAssessments":{"shape":"GuardrailAssessmentList"},
21352142
"traceId":{"shape":"TraceId"}
21362143
},
@@ -2711,6 +2718,7 @@
27112718
"KnowledgeBaseLookupOutput":{
27122719
"type":"structure",
27132720
"members":{
2721+
"metadata":{"shape":"Metadata"},
27142722
"retrievedReferences":{"shape":"RetrievedReferences"}
27152723
}
27162724
},
@@ -2892,6 +2900,10 @@
28922900
"tags":{"shape":"TagsMap"}
28932901
}
28942902
},
2903+
"Long":{
2904+
"type":"long",
2905+
"box":true
2906+
},
28952907
"MaxResults":{
28962908
"type":"integer",
28972909
"box":true,
@@ -2959,6 +2971,11 @@
29592971
"Metadata":{
29602972
"type":"structure",
29612973
"members":{
2974+
"clientRequestId":{"shape":"String"},
2975+
"endTime":{"shape":"SyntheticTimestamp_date_time"},
2976+
"operationTotalTimeMs":{"shape":"Long"},
2977+
"startTime":{"shape":"SyntheticTimestamp_date_time"},
2978+
"totalTimeMs":{"shape":"Long"},
29622979
"usage":{"shape":"Usage"}
29632980
},
29642981
"sensitive":true

generator/ServiceModels/bedrock-agent-runtime/bedrock-agent-runtime-2023-07-26.docs.json

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,6 +1496,7 @@
14961496
"base": null,
14971497
"refs": {
14981498
"ApiResult$httpStatusCode": "<p>http status code from API execution response (for example: 200, 400, 500).</p>",
1499+
"FailureTrace$failureCode": "<p>The failure code for the trace.</p>",
14991500
"Usage$inputTokens": "<p>Contains information about the input tokens from the foundation model usage.</p>",
15001501
"Usage$outputTokens": "<p>Contains information about the output tokens from the foundation model usage.</p>"
15011502
}
@@ -1796,6 +1797,13 @@
17961797
"refs": {
17971798
}
17981799
},
1800+
"Long": {
1801+
"base": null,
1802+
"refs": {
1803+
"Metadata$operationTotalTimeMs": "<p>The total time it took for the agent to complete execution. This field is only set for the final response.</p>",
1804+
"Metadata$totalTimeMs": "<p> The total execution time for the specific invocation being processed (model, knowledge base, guardrail, agent collaborator, or code interpreter). It represents how long the individual invocation took.</p>"
1805+
}
1806+
},
17991807
"MaxResults": {
18001808
"base": "<p>Max Results.</p>",
18011809
"refs": {
@@ -1864,8 +1872,15 @@
18641872
}
18651873
},
18661874
"Metadata": {
1867-
"base": "<p>Provides details of the foundation model.</p>",
1868-
"refs": {
1875+
"base": "<p>Provides information about the execution process for different types of invocations, such as model invocation, knowledge base invocation, agent collaborator invocation, guardrail invocation, and code interpreter Invocation.</p>",
1876+
"refs": {
1877+
"ActionGroupInvocationOutput$metadata": "<p>Contains information about the action group output.</p>",
1878+
"AgentCollaboratorInvocationOutput$metadata": "<p>Contains information about the output from the agent collaborator.</p>",
1879+
"CodeInterpreterInvocationOutput$metadata": "<p>Contains information about the output from the code interpreter.</p>",
1880+
"FailureTrace$metadata": "<p>Information about the failure that occurred.</p>",
1881+
"FinalResponse$metadata": "<p>Contains information about the invoke agent operation.</p>",
1882+
"GuardrailTrace$metadata": "<p>Contains information about the Guardrail output.</p>",
1883+
"KnowledgeBaseLookupOutput$metadata": "<p>Contains information about the knowledge base output.</p>",
18691884
"OrchestrationModelInvocationOutput$metadata": "<p>Contains information about the foundation model output from the orchestration step.</p>",
18701885
"PostProcessingModelInvocationOutput$metadata": "<p> Contains information about the foundation model output from the post-processing step. </p>",
18711886
"PreProcessingModelInvocationOutput$metadata": "<p> Contains information about the foundation model output from the pre-processing step. </p>",
@@ -3075,6 +3090,7 @@
30753090
"InlineSessionState$invocationId": "<p> The identifier of the invocation of an action. This value must match the <code>invocationId</code> returned in the <code>InvokeInlineAgent</code> response for the action whose results are provided in the <code>returnControlInvocationResults</code> field. For more information, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/agents-returncontrol.html\">Return control to the agent developer</a>. </p>",
30763091
"InputFile$name": "<p>The name of the source file.</p>",
30773092
"InternalServerException$reason": "<p>The reason for the exception. If the reason is <code>BEDROCK_MODEL_INVOCATION_SERVICE_UNAVAILABLE</code>, the model invocation service is unavailable. Retry your request.</p>",
3093+
"Metadata$clientRequestId": "<p>A unique identifier associated with the downstream invocation. This ID can be used for tracing, debugging, and identifying specific invocations in customer logs or systems.</p>",
30783094
"OutputFile$name": "<p>The name of the file containing response from code interpreter.</p>",
30793095
"Parameter$name": "<p>The name of the parameter.</p>",
30803096
"Parameter$type": "<p>The type of the parameter.</p>",
@@ -3119,6 +3135,8 @@
31193135
"base": null,
31203136
"refs": {
31213137
"InlineAgentTracePart$eventTime": "<p>The time that trace occurred. </p>",
3138+
"Metadata$endTime": "<p>In the final response, <code>endTime</code> is the end time time of the agent invocation operation.</p>",
3139+
"Metadata$startTime": "<p>In the final response, <code>startTime</code> is the start time of the agent invocation operation.</p>",
31223140
"TracePart$eventTime": "<p> The time of the trace. </p>"
31233141
}
31243142
},
@@ -3316,7 +3334,7 @@
33163334
"Usage": {
33173335
"base": "<p>Contains information of the usage of the foundation model.</p>",
33183336
"refs": {
3319-
"Metadata$usage": "<p>Contains details of the foundation model usage.</p>"
3337+
"Metadata$usage": "<p>Specific to model invocation and contains details about the usage of a foundation model.</p>"
33203338
}
33213339
},
33223340
"Uuid": {

generator/ServiceModels/bedrock-agent-runtime/bedrock-agent-runtime-2023-07-26.normal.json

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,10 @@
613613
"ActionGroupInvocationOutput":{
614614
"type":"structure",
615615
"members":{
616+
"metadata":{
617+
"shape":"Metadata",
618+
"documentation":"<p>Contains information about the action group output.</p>"
619+
},
616620
"text":{
617621
"shape":"ActionGroupOutputString",
618622
"documentation":"<p>The JSON-formatted string returned by the API invoked by the action group.</p>"
@@ -783,6 +787,10 @@
783787
"shape":"String",
784788
"documentation":"<p>The output's agent collaborator name.</p>"
785789
},
790+
"metadata":{
791+
"shape":"Metadata",
792+
"documentation":"<p>Contains information about the output from the agent collaborator.</p>"
793+
},
786794
"output":{
787795
"shape":"AgentCollaboratorOutputPayload",
788796
"documentation":"<p>The output's output.</p>"
@@ -1215,6 +1223,10 @@
12151223
"files":{
12161224
"shape":"Files",
12171225
"documentation":"<p>Contains output files, if generated by code execution.</p>"
1226+
},
1227+
"metadata":{
1228+
"shape":"Metadata",
1229+
"documentation":"<p>Contains information about the output from the code interpreter.</p>"
12181230
}
12191231
},
12201232
"documentation":"<p>Contains the JSON-formatted string returned by the API invoked by the code interpreter.</p>"
@@ -1735,10 +1747,18 @@
17351747
"FailureTrace":{
17361748
"type":"structure",
17371749
"members":{
1750+
"failureCode":{
1751+
"shape":"Integer",
1752+
"documentation":"<p>The failure code for the trace.</p>"
1753+
},
17381754
"failureReason":{
17391755
"shape":"FailureReasonString",
17401756
"documentation":"<p>The reason the interaction failed.</p>"
17411757
},
1758+
"metadata":{
1759+
"shape":"Metadata",
1760+
"documentation":"<p>Information about the failure that occurred.</p>"
1761+
},
17421762
"traceId":{
17431763
"shape":"TraceId",
17441764
"documentation":"<p>The unique identifier of the trace.</p>"
@@ -1856,6 +1876,10 @@
18561876
"FinalResponse":{
18571877
"type":"structure",
18581878
"members":{
1879+
"metadata":{
1880+
"shape":"Metadata",
1881+
"documentation":"<p>Contains information about the invoke agent operation.</p>"
1882+
},
18591883
"text":{
18601884
"shape":"FinalResponseString",
18611885
"documentation":"<p>The text in the response to the user.</p>"
@@ -3059,6 +3083,10 @@
30593083
"shape":"GuardrailAssessmentList",
30603084
"documentation":"<p>The details of the input assessments used in the Guardrail Trace.</p>"
30613085
},
3086+
"metadata":{
3087+
"shape":"Metadata",
3088+
"documentation":"<p>Contains information about the Guardrail output.</p>"
3089+
},
30623090
"outputAssessments":{
30633091
"shape":"GuardrailAssessmentList",
30643092
"documentation":"<p>The details of the output assessments used in the Guardrail Trace.</p>"
@@ -4035,6 +4063,10 @@
40354063
"KnowledgeBaseLookupOutput":{
40364064
"type":"structure",
40374065
"members":{
4066+
"metadata":{
4067+
"shape":"Metadata",
4068+
"documentation":"<p>Contains information about the knowledge base output.</p>"
4069+
},
40384070
"retrievedReferences":{
40394071
"shape":"RetrievedReferences",
40404072
"documentation":"<p>Contains metadata about the sources cited for the generated response.</p>"
@@ -4304,6 +4336,10 @@
43044336
}
43054337
}
43064338
},
4339+
"Long":{
4340+
"type":"long",
4341+
"box":true
4342+
},
43074343
"MaxResults":{
43084344
"type":"integer",
43094345
"documentation":"<p>Max Results.</p>",
@@ -4399,12 +4435,32 @@
43994435
"Metadata":{
44004436
"type":"structure",
44014437
"members":{
4438+
"clientRequestId":{
4439+
"shape":"String",
4440+
"documentation":"<p>A unique identifier associated with the downstream invocation. This ID can be used for tracing, debugging, and identifying specific invocations in customer logs or systems.</p>"
4441+
},
4442+
"endTime":{
4443+
"shape":"SyntheticTimestamp_date_time",
4444+
"documentation":"<p>In the final response, <code>endTime</code> is the end time time of the agent invocation operation.</p>"
4445+
},
4446+
"operationTotalTimeMs":{
4447+
"shape":"Long",
4448+
"documentation":"<p>The total time it took for the agent to complete execution. This field is only set for the final response.</p>"
4449+
},
4450+
"startTime":{
4451+
"shape":"SyntheticTimestamp_date_time",
4452+
"documentation":"<p>In the final response, <code>startTime</code> is the start time of the agent invocation operation.</p>"
4453+
},
4454+
"totalTimeMs":{
4455+
"shape":"Long",
4456+
"documentation":"<p> The total execution time for the specific invocation being processed (model, knowledge base, guardrail, agent collaborator, or code interpreter). It represents how long the individual invocation took.</p>"
4457+
},
44024458
"usage":{
44034459
"shape":"Usage",
4404-
"documentation":"<p>Contains details of the foundation model usage.</p>"
4460+
"documentation":"<p>Specific to model invocation and contains details about the usage of a foundation model.</p>"
44054461
}
44064462
},
4407-
"documentation":"<p>Provides details of the foundation model.</p>",
4463+
"documentation":"<p>Provides information about the execution process for different types of invocations, such as model invocation, knowledge base invocation, agent collaborator invocation, guardrail invocation, and code interpreter Invocation.</p>",
44084464
"sensitive":true
44094465
},
44104466
"MetadataAttributeSchema":{

sdk/src/Services/BedrockAgentRuntime/Generated/Model/ActionGroupInvocationOutput.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,28 @@ namespace Amazon.BedrockAgentRuntime.Model
3434
/// </summary>
3535
public partial class ActionGroupInvocationOutput
3636
{
37+
private Metadata _metadata;
3738
private string _text;
3839

40+
/// <summary>
41+
/// Gets and sets the property Metadata.
42+
/// <para>
43+
/// Contains information about the action group output.
44+
/// </para>
45+
/// </summary>
46+
[AWSProperty(Sensitive=true)]
47+
public Metadata Metadata
48+
{
49+
get { return this._metadata; }
50+
set { this._metadata = value; }
51+
}
52+
53+
// Check to see if Metadata property is set
54+
internal bool IsSetMetadata()
55+
{
56+
return this._metadata != null;
57+
}
58+
3959
/// <summary>
4060
/// Gets and sets the property Text.
4161
/// <para>

sdk/src/Services/BedrockAgentRuntime/Generated/Model/AgentCollaboratorInvocationOutput.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public partial class AgentCollaboratorInvocationOutput
3636
{
3737
private string _agentCollaboratorAliasArn;
3838
private string _agentCollaboratorName;
39+
private Metadata _metadata;
3940
private AgentCollaboratorOutputPayload _output;
4041

4142
/// <summary>
@@ -75,6 +76,25 @@ internal bool IsSetAgentCollaboratorName()
7576
return this._agentCollaboratorName != null;
7677
}
7778

79+
/// <summary>
80+
/// Gets and sets the property Metadata.
81+
/// <para>
82+
/// Contains information about the output from the agent collaborator.
83+
/// </para>
84+
/// </summary>
85+
[AWSProperty(Sensitive=true)]
86+
public Metadata Metadata
87+
{
88+
get { return this._metadata; }
89+
set { this._metadata = value; }
90+
}
91+
92+
// Check to see if Metadata property is set
93+
internal bool IsSetMetadata()
94+
{
95+
return this._metadata != null;
96+
}
97+
7898
/// <summary>
7999
/// Gets and sets the property Output.
80100
/// <para>

sdk/src/Services/BedrockAgentRuntime/Generated/Model/CodeInterpreterInvocationOutput.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public partial class CodeInterpreterInvocationOutput
3838
private string _executionOutput;
3939
private bool? _executionTimeout;
4040
private List<string> _files = AWSConfigs.InitializeCollections ? new List<string>() : null;
41+
private Metadata _metadata;
4142

4243
/// <summary>
4344
/// Gets and sets the property ExecutionError.
@@ -111,5 +112,24 @@ internal bool IsSetFiles()
111112
return this._files != null && (this._files.Count > 0 || !AWSConfigs.InitializeCollections);
112113
}
113114

115+
/// <summary>
116+
/// Gets and sets the property Metadata.
117+
/// <para>
118+
/// Contains information about the output from the code interpreter.
119+
/// </para>
120+
/// </summary>
121+
[AWSProperty(Sensitive=true)]
122+
public Metadata Metadata
123+
{
124+
get { return this._metadata; }
125+
set { this._metadata = value; }
126+
}
127+
128+
// Check to see if Metadata property is set
129+
internal bool IsSetMetadata()
130+
{
131+
return this._metadata != null;
132+
}
133+
114134
}
115135
}

0 commit comments

Comments
 (0)