Skip to content

Commit ccde822

Browse files
committed
feat: add agent runtime example
1 parent 82ec7cd commit ccde822

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

rustv1/examples/bedrock-agent-runtime/src/bin/invoke-agent.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ async fn main() -> Result<(), Box<bedrockagentruntime::Error>> {
1212
Ok(())
1313
}
1414

15-
async fn invoke_bedrock_agent(
16-
prompt: String,
17-
session_id: String,
18-
) -> Result<String, bedrockagentruntime::Error> {
15+
async fn invoke_bedrock_agent(prompt: String, session_id: String) -> Result<String, bedrockagentruntime::Error> {
1916
let sdk_config: SdkConfig = aws_config::defaults(BehaviorVersion::latest())
2017
.region(BEDROCK_AGENT_REGION)
2118
.load()
@@ -45,7 +42,7 @@ async fn invoke_bedrock_agent(
4542
}
4643
Err(e) => {
4744
eprintln!("UTF-8 decoding error for chunk: {}", e);
48-
}
45+
}
4946
}
5047
}
5148
}
@@ -57,3 +54,5 @@ async fn invoke_bedrock_agent(
5754

5855
Ok(full_agent_text_response)
5956
}
57+
58+

0 commit comments

Comments
 (0)