@@ -249,6 +249,18 @@ describe("DeepSeekHandler", () => {
249249 expect ( ( model . info as ModelInfo ) . reasoningEffort ) . toBe ( "high" )
250250 } )
251251
252+ it ( "should return vision model info for deepseek-v4-flash-vision-exp" , ( ) => {
253+ const handlerWithVision = new DeepSeekHandler ( {
254+ ...mockOptions ,
255+ apiModelId : "deepseek-v4-flash-vision-exp" ,
256+ } )
257+ const model = handlerWithVision . getModel ( )
258+ expect ( model . id ) . toBe ( "deepseek-v4-flash-vision-exp" )
259+ expect ( model . info . supportsImages ) . toBe ( true )
260+ expect ( model . info . supportsPromptCache ) . toBe ( true )
261+ expect ( ( model . info as ModelInfo ) . preserveReasoning ) . toBe ( true )
262+ } )
263+
252264 it ( "should return provided model ID with default model info if model does not exist" , ( ) => {
253265 const handlerWithInvalidModel = new DeepSeekHandler ( {
254266 ...mockOptions ,
@@ -412,6 +424,35 @@ describe("DeepSeekHandler", () => {
412424 const reasoningChunks = chunks . filter ( ( chunk ) => chunk . type === "reasoning" )
413425 expect ( reasoningChunks ) . toEqual ( [ { type : "reasoning" , text : "primary thought" } ] )
414426 } )
427+
428+ it ( "enables thinking and forwards image_url for the vision model" , async ( ) => {
429+ const visionHandler = new DeepSeekHandler ( {
430+ ...mockOptions ,
431+ apiModelId : "deepseek-v4-flash-vision-exp" ,
432+ } )
433+ const withImage : Anthropic . Messages . MessageParam [ ] = [
434+ {
435+ role : "user" ,
436+ content : [
437+ { type : "text" , text : "Describe:" } ,
438+ { type : "image" , source : { type : "base64" , media_type : "image/png" , data : "abc" } } ,
439+ ] ,
440+ } ,
441+ ]
442+
443+ await collectStream ( visionHandler . createMessage ( systemPrompt , withImage ) )
444+
445+ const callArgs = mockCreate . mock . calls [ 0 ] [ 0 ]
446+ expect ( callArgs . thinking ) . toEqual ( { type : "enabled" } )
447+ expect ( callArgs . messages ) . toEqual (
448+ expect . arrayContaining ( [
449+ expect . objectContaining ( {
450+ role : "user" ,
451+ content : expect . arrayContaining ( [ expect . objectContaining ( { type : "image_url" } ) ] ) ,
452+ } ) ,
453+ ] ) ,
454+ )
455+ } )
415456 } )
416457
417458 describe ( "processUsageMetrics" , ( ) => {
@@ -684,6 +725,36 @@ describe("DeepSeekHandler", () => {
684725 rawReasoningEffort : "max" ,
685726 mappedReasoningEffort : "max" ,
686727 } ,
728+ {
729+ modelId : "deepseek-v4-flash-vision-exp" ,
730+ rawReasoningEffort : "disable" ,
731+ mappedReasoningEffort : undefined ,
732+ } ,
733+ {
734+ modelId : "deepseek-v4-flash-vision-exp" ,
735+ rawReasoningEffort : "low" ,
736+ mappedReasoningEffort : "low" ,
737+ } ,
738+ {
739+ modelId : "deepseek-v4-flash-vision-exp" ,
740+ rawReasoningEffort : "medium" ,
741+ mappedReasoningEffort : "high" ,
742+ } ,
743+ {
744+ modelId : "deepseek-v4-flash-vision-exp" ,
745+ rawReasoningEffort : "high" ,
746+ mappedReasoningEffort : "high" ,
747+ } ,
748+ {
749+ modelId : "deepseek-v4-flash-vision-exp" ,
750+ rawReasoningEffort : "xhigh" ,
751+ mappedReasoningEffort : "high" ,
752+ } ,
753+ {
754+ modelId : "deepseek-v4-flash-vision-exp" ,
755+ rawReasoningEffort : "max" ,
756+ mappedReasoningEffort : "max" ,
757+ } ,
687758 ]
688759
689760 for ( const { modelId, rawReasoningEffort, mappedReasoningEffort } of mappings ) {
0 commit comments