File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import type {
2
2
MessageContentComplex ,
3
3
BaseMessage ,
4
4
UsageMetadata ,
5
+ DataContentBlock ,
5
6
} from "@langchain/core/messages" ;
6
7
import {
7
8
AIMessage ,
@@ -23,6 +24,7 @@ import type {
23
24
ReasoningContentBlock ,
24
25
ReasoningContentBlockDelta ,
25
26
ReasoningTextBlock ,
27
+ ToolResultContentBlock ,
26
28
} from "@aws-sdk/client-bedrock-runtime" ;
27
29
import type { DocumentType as __DocumentType } from "@smithy/types" ;
28
30
import { isLangChainTool } from "@langchain/core/utils/function_calling" ;
@@ -223,11 +225,9 @@ export function convertToConverseMessages(messages: BaseMessage[]): {
223
225
{
224
226
toolResult : {
225
227
toolUseId : castMsg . tool_call_id ,
226
- content : [
227
- {
228
- json : castMsg . content ,
229
- } ,
230
- ] ,
228
+ content : (
229
+ msg . content as ( MessageContentComplex | DataContentBlock ) [ ]
230
+ ) . map ( ( c ) => ( { json : c } as ToolResultContentBlock . JsonMember ) ) ,
231
231
} ,
232
232
} ,
233
233
] ,
You can’t perform that action at this time.
0 commit comments