File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
rustv1/examples/bedrock-agent-runtime/src Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -5,13 +5,14 @@ const BEDROCK_AGENT_ID: &str = "AJBHXXILZN";
5
5
const BEDROCK_AGENT_ALIAS_ID : & str = "AVKP1ITZAA" ;
6
6
7
7
#[ :: tokio:: main]
8
- async fn main ( ) -> Result < ( ) , bedrockagentruntime:: Error > {
8
+ async fn main ( ) -> Result < ( ) , Box < bedrockagentruntime:: Error > > {
9
9
let result = invoke_bedrock_agent ( "a prompt" . to_string ( ) , "random session id" . to_string ( ) ) . await ?;
10
- Ok ( println ! ( "{}" , result) )
10
+ println ! ( "{}" , result) ;
11
+ Ok ( ( ) )
11
12
}
12
13
13
14
async fn invoke_bedrock_agent ( prompt : String , session_id : String ) -> Result < String , bedrockagentruntime:: Error > {
14
- let aws_config: SdkConfig = aws_config:: load_from_env ( ) . await ;
15
+ let aws_config: SdkConfig = aws_config:: load_defaults ( BehaviorVersion :: latest ( ) ) . await ;
15
16
let bedrock_client = bedrockagentruntime:: Client :: new ( & aws_config) ;
16
17
17
18
let command_builder = bedrock_client
You can’t perform that action at this time.
0 commit comments