File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change 22
33import path from "path"
44import { fileURLToPath } from "url"
5- import { streamText , type ModelMessage } from "ai"
5+ import { generateText , type ModelMessage } from "ai"
66
77const __filename = fileURLToPath ( import . meta. url )
88const __dirname = path . dirname ( __filename )
@@ -169,20 +169,14 @@ async function probeModel(input: {
169169 const model = await Provider . getModel ( input . providerID , input . modelID )
170170 const language = await Provider . getLanguage ( model )
171171
172- const stream = await streamText ( {
172+ // GitHub Copilot Responses API currently requires max_output_tokens >= 16.
173+ await generateText ( {
173174 model : language ,
174175 messages,
175- maxOutputTokens : 8 ,
176+ maxOutputTokens : 16 ,
176177 abortSignal : AbortSignal . timeout ( input . timeoutMs ) ,
177178 } )
178179
179- for await ( const part of stream . fullStream ) {
180- // Any successful stream event is enough to consider the route supported.
181- if ( part . type === "text-delta" || part . type === "reasoning-delta" || part . type === "start" ) {
182- break
183- }
184- }
185-
186180 return { ok : true }
187181 } catch ( e : any ) {
188182 const message = e ?. message ? String ( e . message ) : String ( e )
You can’t perform that action at this time.
0 commit comments