Changeset 0.10.4 (#60)
This commit is contained in:
@@ -263,6 +263,7 @@ func (p *OpenAIProvider) ListModels(ctx context.Context, cfg ProviderConfig) ([]
|
||||
|
||||
out = append(out, Model{
|
||||
ID: m.ID,
|
||||
Type: m.Type, // passthrough from API if present (empty → "chat" at sync time)
|
||||
OwnedBy: m.OwnedBy,
|
||||
Capabilities: caps,
|
||||
})
|
||||
@@ -506,6 +507,7 @@ type openaiModelsResponse struct {
|
||||
Data []struct {
|
||||
ID string `json:"id"`
|
||||
OwnedBy string `json:"owned_by"`
|
||||
Type string `json:"type,omitempty"` // Some APIs (e.g. Venice-compat) include model type
|
||||
ContextLength int `json:"context_length,omitempty"` // Ollama, OpenRouter
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
@@ -141,6 +141,7 @@ type EmbeddingResponse struct {
|
||||
type Model struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Type string `json:"type,omitempty"` // "chat", "embedding", "image" — from provider API
|
||||
OwnedBy string `json:"owned_by,omitempty"`
|
||||
Capabilities models.ModelCapabilities `json:"capabilities"`
|
||||
Pricing *models.ModelPricing `json:"pricing,omitempty"`
|
||||
|
||||
@@ -99,9 +99,23 @@ func (p *VeniceProvider) ListModels(ctx context.Context, cfg ProviderConfig) ([]
|
||||
name = m.ID
|
||||
}
|
||||
|
||||
// Normalize Venice type → our model type
|
||||
// Venice returns: "text", "embedding", "image", "code"
|
||||
// We normalize to: "chat", "embedding", "image"
|
||||
modelType := "chat"
|
||||
switch m.Type {
|
||||
case "embedding":
|
||||
modelType = "embedding"
|
||||
case "image":
|
||||
modelType = "image"
|
||||
default:
|
||||
modelType = "chat" // "text", "code", etc. are all chat-capable
|
||||
}
|
||||
|
||||
out = append(out, Model{
|
||||
ID: m.ID,
|
||||
Name: name,
|
||||
Type: modelType,
|
||||
OwnedBy: "venice",
|
||||
Capabilities: caps,
|
||||
Pricing: pricing,
|
||||
|
||||
Reference in New Issue
Block a user