实现ai
This commit is contained in:
19
internal/infra/ai/ai.go
Normal file
19
internal/infra/ai/ai.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package ai
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/infra/models"
|
||||
)
|
||||
|
||||
// AI 定义了通用的 AI 管理接口。
|
||||
// 它可以用于处理各种 AI 相关的任务,例如文本生成、内容审核等。
|
||||
type AI interface {
|
||||
// GenerateReview 根据提供的文本内容生成评论。
|
||||
// prompt: 用于生成评论的输入文本。
|
||||
// 返回生成的评论字符串和可能发生的错误。
|
||||
GenerateReview(ctx context.Context, prompt string) (string, error)
|
||||
|
||||
// AIModel 返回当前使用的 AI 模型。
|
||||
AIModel() models.AIModel
|
||||
}
|
||||
Reference in New Issue
Block a user