@@ -37,6 +37,70 @@ describe('MiniMaxSDK.text', () => {
3737 expect ( result . id ) . toBe ( 'msg-123' ) ;
3838 } ) ;
3939
40+ it ( 'passes video content blocks through to chat requests' , async ( ) => {
41+ let requestBody : unknown ;
42+ server = createMockServer ( {
43+ routes : {
44+ '/anthropic/v1/messages' : async request => {
45+ requestBody = await request . json ( ) ;
46+ return jsonResponse ( {
47+ id : 'msg-video' ,
48+ type : 'message' ,
49+ role : 'assistant' ,
50+ content : [ { type : 'text' , text : 'A short clip.' } ] ,
51+ model : 'MiniMax-M3' ,
52+ stop_reason : 'end_turn' ,
53+ usage : { input_tokens : 20 , output_tokens : 4 } ,
54+ } ) ;
55+ } ,
56+ } ,
57+ } ) ;
58+
59+ const sdk = new MiniMaxSDK ( {
60+ apiKey : 'test-key' ,
61+ baseUrl : server . url ,
62+ } ) ;
63+
64+ await sdk . text . chat ( {
65+ messages : [ {
66+ role : 'user' ,
67+ content : [
68+ { type : 'text' , text : 'What happens in this clip?' } ,
69+ {
70+ type : 'video' ,
71+ source : {
72+ type : 'url' ,
73+ url : 'https://example.com/clip.mp4' ,
74+ detail : 'high' ,
75+ fps : 0.5 ,
76+ max_long_side_pixel : 1280 ,
77+ } ,
78+ } ,
79+ ] ,
80+ } ] ,
81+ } ) ;
82+
83+ expect ( requestBody ) . toMatchObject ( {
84+ model : 'MiniMax-M3' ,
85+ messages : [ {
86+ role : 'user' ,
87+ content : [
88+ { type : 'text' , text : 'What happens in this clip?' } ,
89+ {
90+ type : 'video' ,
91+ source : {
92+ type : 'url' ,
93+ url : 'https://example.com/clip.mp4' ,
94+ detail : 'high' ,
95+ fps : 0.5 ,
96+ max_long_side_pixel : 1280 ,
97+ } ,
98+ } ,
99+ ] ,
100+ } ] ,
101+ } ) ;
102+ } ) ;
103+
40104 it ( 'streaming skips empty SSE data events' , async ( ) => {
41105 const chunk = JSON . stringify ( {
42106 type : 'content_block_delta' ,
0 commit comments