File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -331,9 +331,7 @@ pub fn converse_output_to_complete_response(
331
331
_ => { }
332
332
}
333
333
}
334
-
335
334
let metadata = converse_output_to_response_metadata ( & response) ;
336
-
337
335
Ok ( llm:: CompleteResponse {
338
336
// bedrock does not return an id as part of the response struct.
339
337
// there may be one present in `additional_model_response_fields`
@@ -344,10 +342,8 @@ pub fn converse_output_to_complete_response(
344
342
tool_calls,
345
343
metadata,
346
344
} )
347
-
348
345
}
349
346
}
350
-
351
347
}
352
348
353
349
fn bedrock_tool_use_to_llm_tool_call ( tool : ToolUseBlock ) -> Result < llm:: ToolCall , llm:: Error > {
Original file line number Diff line number Diff line change @@ -69,11 +69,13 @@ impl ExtendedGuest for BedrockComponent {
69
69
}
70
70
71
71
fn get_bedrock_client ( ) -> Result < Arc < Bedrock > , llm:: Error > {
72
- BEDROCK_CLIENT . with_borrow_mut ( |client_opt| {
73
- if client_opt. is_none ( ) {
74
- * client_opt = Some ( Arc :: new ( Bedrock :: new ( ) ?) ) ;
72
+ BEDROCK_CLIENT . with_borrow_mut ( |client_opt| match client_opt {
73
+ Some ( client) => Ok ( client. clone ( ) ) ,
74
+ None => {
75
+ let client = Arc :: new ( Bedrock :: new ( ) ?) ;
76
+ * client_opt = Some ( client. clone ( ) ) ;
77
+ Ok ( client)
75
78
}
76
- Ok ( client_opt. as_ref ( ) . map ( Arc :: clone) . unwrap ( ) )
77
79
} )
78
80
}
79
81
You can’t perform that action at this time.
0 commit comments