16 lines
398 B
Go
16 lines
398 B
Go
package provider
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.kingecg.top/kingecg/goaiagent/model"
|
|
)
|
|
|
|
// Provider 定义统一的大模型接口
|
|
type Provider interface {
|
|
CreateChatCompletionStream(ctx context.Context, req model.ChatRequest) (*StreamReader, error)
|
|
CreateChatCompletion(ctx context.Context, req model.ChatRequest) (model.ChatResponse, error)
|
|
CountTokens(text string) int
|
|
GetModelName() string
|
|
}
|