fix: Fix the image support for the GitHub Copilot models (#5379)

This commit is contained in:
AO2233 2025-04-27 02:55:19 +09:00 committed by GitHub
parent 3f42c7bace
commit 2392cba477
2 changed files with 6 additions and 4 deletions

View File

@ -2202,9 +2202,10 @@ export function isVisionModel(model: Model): boolean {
if (!model) {
return false
}
if (model.provider === 'copilot') {
return false
}
// 新添字段 copilot-vision-request 后可使用 vision
// if (model.provider === 'copilot') {
// return false
// }
if (model.provider === 'doubao') {
return VISION_REGEX.test(model.name) || model.type?.includes('vision') || false

View File

@ -70,7 +70,8 @@ export default class OpenAIProvider extends BaseProvider {
baseURL: this.getBaseURL(),
defaultHeaders: {
...this.defaultHeaders(),
...(this.provider.id === 'copilot' ? { 'editor-version': 'vscode/1.97.2' } : {})
...(this.provider.id === 'copilot' ? { 'editor-version': 'vscode/1.97.2' } : {}),
...(this.provider.id === 'copilot' ? { 'copilot-vision-request': 'true' } : {})
}
})
}