Skip to content
This repository was archived by the owner on Jul 8, 2025. It is now read-only.

fix: id format for provider, model muxing rule #360

Merged
merged 3 commits into from
Mar 3, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function groupModelsByProviderName(
id: providerName,
textValue: providerName,
items: items.map((item) => ({
id: `${item.provider_id}:${item.name}`,
id: `${item.provider_id}@${item.name}`,
textValue: item.name,
})),
}))
Expand Down Expand Up @@ -116,8 +116,10 @@ export function WorkspaceModelsDropdown({
const selectedValue = v.values().next().value
if (!selectedValue && typeof selectedValue !== 'string') return
if (typeof selectedValue === 'string') {
const [provider_id, modelName] = selectedValue.split(':')
if (!provider_id || !modelName) return
const atIndex = selectedValue.indexOf('@')
const provider_id = selectedValue.slice(0, atIndex)
const modelName = selectedValue.slice(atIndex + 1)
if (atIndex === -1 && (!provider_id || !modelName)) return
onChange({
model: modelName,
provider_id,
Expand Down
Loading