@@ -187,6 +187,74 @@ test("converts Copilot AIC token prices to USD per million tokens", async () =>
187187 expect ( models [ "ignored-non-chat-record" ] ) . toBeUndefined ( )
188188} )
189189
190+ test ( "detects PDF input support when vision and media type are advertised" , async ( ) => {
191+ globalThis . fetch = mock ( ( ) =>
192+ Promise . resolve (
193+ new Response (
194+ JSON . stringify ( {
195+ data : [
196+ {
197+ model_picker_enabled : true ,
198+ id : "pdf-model" ,
199+ name : "PDF Model" ,
200+ version : "pdf-model-2026-06-01" ,
201+ capabilities : {
202+ family : "pdf-model" ,
203+ limits : {
204+ max_context_window_tokens : 128000 ,
205+ max_output_tokens : 16384 ,
206+ max_prompt_tokens : 128000 ,
207+ vision : {
208+ max_prompt_image_size : 10000000 ,
209+ max_prompt_images : 10 ,
210+ supported_media_types : [ "application/pdf" ] ,
211+ } ,
212+ } ,
213+ supports : {
214+ streaming : true ,
215+ vision : true ,
216+ tool_calls : true ,
217+ } ,
218+ } ,
219+ } ,
220+ {
221+ model_picker_enabled : true ,
222+ id : "vision-only-model" ,
223+ name : "Vision Only Model" ,
224+ version : "vision-only-model-2026-06-01" ,
225+ capabilities : {
226+ family : "vision-only-model" ,
227+ limits : {
228+ max_context_window_tokens : 128000 ,
229+ max_output_tokens : 16384 ,
230+ max_prompt_tokens : 128000 ,
231+ vision : {
232+ max_prompt_image_size : 10000000 ,
233+ max_prompt_images : 10 ,
234+ supported_media_types : [ "image/png" ] ,
235+ } ,
236+ } ,
237+ supports : {
238+ streaming : true ,
239+ vision : true ,
240+ tool_calls : true ,
241+ } ,
242+ } ,
243+ } ,
244+ ] ,
245+ } ) ,
246+ { status : 200 } ,
247+ ) ,
248+ ) ,
249+ ) as unknown as typeof fetch
250+
251+ const models = ( await CopilotModels . get ( "https://api.githubcopilot.com" ) ) . models
252+ const model = models [ "pdf-model" ]
253+
254+ expect ( model . capabilities . input . pdf ) . toBe ( true )
255+ expect ( models [ "vision-only-model" ] . capabilities . input . pdf ) . toBe ( false )
256+ } )
257+
190258test ( "uses zero cost when Copilot reports a zero billing batch size" , async ( ) => {
191259 globalThis . fetch = mock ( ( ) =>
192260 Promise . resolve (
0 commit comments