vercel: Use proper model identifiers and add image support (#33377)

Follow up to previous PRs:
- Return `true` in `supports_images` - v0 supports images already
- Rename model id to match the exact version of the model `v0-1.5-md`
(For now we do not expose `sm`/`lg` variants since they seem not to be
available via the API)
- Provide autocompletion in settings for using `vercel` as a `provider`

Release Notes:

- N/A
This commit is contained in:
Bennet Bo Fenner 2025-06-25 15:26:41 +02:00 committed by GitHub
parent 18f1221a44
commit 59aeede50d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 18 deletions

View file

@ -303,14 +303,14 @@ impl LanguageModel for VercelLanguageModel {
}
fn supports_images(&self) -> bool {
false
true
}
fn supports_tool_choice(&self, choice: LanguageModelToolChoice) -> bool {
match choice {
LanguageModelToolChoice::Auto => true,
LanguageModelToolChoice::Any => true,
LanguageModelToolChoice::None => true,
LanguageModelToolChoice::Auto
| LanguageModelToolChoice::Any
| LanguageModelToolChoice::None => true,
}
}
@ -398,7 +398,7 @@ pub fn count_vercel_tokens(
}
// Map Vercel models to appropriate OpenAI models for token counting
// since Vercel uses OpenAI-compatible API
Model::VZero => {
Model::VZeroOnePointFiveMedium => {
// Vercel v0 is similar to GPT-4o, so use gpt-4o for token counting
tiktoken_rs::num_tokens_from_messages("gpt-4o", &messages)
}