ai-css/library/modelprovider/provider.go
2026-02-12 08:50:11 +00:00

21 lines
645 B
Go
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package modelprovider
import "context"
type Capability struct {
Vendor string
SupportsStreaming bool
MaxContextTokens int
}
// Provider将统一 DTO ↔ 各家云 API适配器接口
type Provider interface {
InvokeCompletion(ctx context.Context, req *ChatRequest) (*ChatResponse, error)
StreamCompletion(ctx context.Context, req *ChatRequest, h StreamChatCallback) error
Capabilities() Capability
//ListModels 列出该 provider 可用模型(返回“供应商真实模型 ID”列表及能力
ListModels(ctx context.Context) ([]ModelInfo, error)
// GetDefaultModel 默认模型
GetDefaultModel() string
}