opencode-cursor-agent/pkg/domain/repository/account.go

28 lines
735 B
Go

package repository
import (
"context"
"cursor-api-proxy/pkg/domain/entity"
)
// AccountPool defines the interface for account pool management
type AccountPool interface {
GetNextConfigDir() string
ReportRequestStart(configDir string)
ReportRequestEnd(configDir string)
ReportRequestSuccess(configDir string, latencyMs int64)
ReportRequestError(configDir string, latencyMs int64)
ReportRateLimit(configDir string, penaltyMs int64)
GetStats() []entity.AccountStat
Count() int
}
// Provider defines the interface for AI providers
type Provider interface {
Name() string
Generate(ctx context.Context, model string, messages []entity.Message,
tools []entity.Tool, callback func(entity.StreamChunk)) error
Close() error
}