21 lines
645 B
Go
21 lines
645 B
Go
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
|
||
}
|