知识库隔离与话术管理方案
This commit is contained in:
@@ -6,6 +6,37 @@ import (
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
)
|
||||
|
||||
// CreateChatReq 创建对话配置请求
|
||||
type CreateChatReq struct {
|
||||
Name string `json:"name"` // 对话配置名称
|
||||
DatasetIds []string `json:"dataset_ids"` // 关联的知识库ID列表
|
||||
Prompt *PromptConfig `json:"prompt"` // 提示词配置
|
||||
}
|
||||
|
||||
// PromptConfig 提示词配置
|
||||
type PromptConfig struct {
|
||||
Prompt string `json:"prompt"` // 提示词内容
|
||||
SimilarityThreshold float64 `json:"similarity_threshold"` // 相似度阈值
|
||||
KeywordsSimilarityWeight float64 `json:"keywords_similarity_weight"` // 关键词相似度权重
|
||||
TopN int `json:"top_n"` // 返回顶部N个chunk
|
||||
EmptyResponse string `json:"empty_response"` // 无匹配时回复
|
||||
Opener string `json:"opener"` // 开场白
|
||||
ShowQuote bool `json:"show_quote"` // 是否显示引用
|
||||
Variables []map[string]interface{} `json:"variables"` // 变量列表
|
||||
}
|
||||
|
||||
// CreateChatRes 创建对话配置响应
|
||||
type CreateChatRes struct {
|
||||
ChatId string `json:"id"` // 对话配置ID
|
||||
}
|
||||
|
||||
// UpdateChatReq 更新对话配置请求
|
||||
type UpdateChatReq struct {
|
||||
Name string `json:"name,omitempty"` // 对话配置名称
|
||||
DatasetIds []string `json:"dataset_ids,omitempty"` // 关联的知识库ID列表
|
||||
Prompt *PromptConfig `json:"prompt,omitempty"` // 提示词配置
|
||||
}
|
||||
|
||||
// 聊天助手管理
|
||||
// 参考: https://ragflow.com.cn/docs/dev/http_api_reference#聊天助手管理
|
||||
|
||||
@@ -54,24 +85,6 @@ type Variable struct {
|
||||
Optional bool `json:"optional"`
|
||||
}
|
||||
|
||||
// CreateChatReq 创建聊天助手请求
|
||||
type CreateChatReq struct {
|
||||
Name string `json:"name"`
|
||||
Avatar string `json:"avatar,omitempty"`
|
||||
DatasetIds []string `json:"dataset_ids,omitempty"`
|
||||
Llm *Llm `json:"llm,omitempty"`
|
||||
Prompt *Prompt `json:"prompt,omitempty"`
|
||||
}
|
||||
|
||||
// UpdateChatReq 更新聊天助手请求
|
||||
type UpdateChatReq struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Avatar string `json:"avatar,omitempty"`
|
||||
DatasetIds []string `json:"dataset_ids,omitempty"`
|
||||
Llm *Llm `json:"llm,omitempty"`
|
||||
Prompt *Prompt `json:"prompt,omitempty"`
|
||||
}
|
||||
|
||||
// ListChatsReq 列出聊天助手请求
|
||||
type ListChatsReq struct {
|
||||
Page int `json:"page,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user