Documentation
¶
Index ¶
- type AskReq
- type Config
- type Conversation
- type ConversationHistory
- type ConversationReq
- type ConversationSummary
- type CreateConversationReq
- type CreateConversationResp
- type CreateKnowledgeBaseRequest
- type CreateKnowledgeBaseResponse
- type DeleteDocumentResponse
- type DeleteKnowledgeBaseResponse
- type Document
- type KnowledgeBase
- type ListDocumentsResponse
- type ListEmbeddingModelsResponse
- type ListKnowledgeBasesResponse
- type Message
- type RagChatRequest
- type RetrieveRequest
- type RetrieveResponse
- type RetrieveResult
- type SSEChoice
- type SSEDelta
- type SSEResponse
- type UploadDocumentResponse
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Server struct { Port string `mapstructure:"port"` } `mapstructure:"server"` Redis struct { Address string `mapstructure:"address"` Password string `mapstructure:"password"` DB int `mapstructure:"db"` } `mapstructure:"redis"` SQLite struct { Path string `mapstructure:"path"` MaxOpenConns int `mapstructure:"max_open_conns"` MaxIdleConns int `mapstructure:"max_idle_conns"` ConnMaxLifetime int `mapstructure:"conn_max_lifetime"` // 秒 } `mapstructure:"sqlite"` JWT struct { Secret string `mapstructure:"secret"` } `mapstructure:"jwt"` RAG struct { ServiceAddr string `mapstructure:"service_addr"` } `mapstructure:"rag"` }
type Conversation ¶
type ConversationHistory ¶
type ConversationReq ¶
type ConversationSummary ¶
type CreateConversationReq ¶
type CreateConversationResp ¶
type CreateKnowledgeBaseRequest ¶
type CreateKnowledgeBaseRequest struct { Name string `json:"kb_name" binding:"required"` EmbeddingModel string `json:"embedding_model,omitempty"` }
CreateKnowledgeBaseRequest 创建知识库请求
type CreateKnowledgeBaseResponse ¶
type CreateKnowledgeBaseResponse struct { Success bool `json:"success"` KBID string `json:"kb_id"` Message string `json:"message"` }
CreateKnowledgeBaseResponse 创建知识库响应
type DeleteDocumentResponse ¶
type DeleteDocumentResponse struct { Success bool `json:"success"` Message string `json:"message"` }
DeleteDocumentResponse 删除文档响应
type DeleteKnowledgeBaseResponse ¶
type DeleteKnowledgeBaseResponse struct { Success bool `json:"success"` Message string `json:"message"` }
DeleteKnowledgeBaseResponse 删除知识库响应
type Document ¶
type Document struct { ID string `json:"doc_id"` KBID string `json:"kb_id"` Name string `json:"doc_name"` FileType string `json:"file_type"` }
Document 文档模型
type KnowledgeBase ¶
type KnowledgeBase struct { ID string `json:"kb_id"` Name string `json:"kb_name"` EmbeddingModel string `json:"embedding_model,omitempty"` }
KnowledgeBase 知识库模型
type ListDocumentsResponse ¶
type ListDocumentsResponse struct { Success bool `json:"success"` Docs []Document `json:"docs"` Message string `json:"message"` }
ListDocumentsResponse 文档列表响应
type ListEmbeddingModelsResponse ¶
type ListEmbeddingModelsResponse struct { Success bool `json:"success"` Models []string `json:"models"` Message string `json:"message"` }
ListEmbeddingModelsResponse 嵌入模型列表响应
type ListKnowledgeBasesResponse ¶
type ListKnowledgeBasesResponse struct { Success bool `json:"success"` KBs []KnowledgeBase `json:"kbs"` Message string `json:"message"` }
ListKnowledgeBasesResponse 知识库列表响应
type RagChatRequest ¶
type RagChatRequest struct { ConversationID int64 `json:"conversation_id" binding:"required"` KBID string `json:"kb_id" binding:"required"` Message string `json:"message" binding:"required"` TopK int `json:"top_k,omitempty"` }
RagChatRequest 基于知识库的对话请求
type RetrieveRequest ¶
type RetrieveRequest struct { KBID string `json:"kb_id" binding:"required"` Query string `json:"query" binding:"required"` TopK int `json:"top_k,omitempty"` }
RetrieveRequest 检索请求
type RetrieveResponse ¶
type RetrieveResponse struct { Success bool `json:"success"` Results []RetrieveResult `json:"results"` Message string `json:"message"` }
RetrieveResponse 检索响应
type RetrieveResult ¶
type RetrieveResult struct { Content string `json:"content"` Score float32 `json:"score"` DocID string `json:"doc_id"` DocName string `json:"doc_name"` }
RetrieveResult 检索结果模型
type SSEDelta ¶
type SSEDelta struct {
Content string `json:"content"`
}
SSEDelta 定义结构体以匹配 JSON 数据格式
type SSEResponse ¶
type SSEResponse struct {
Choices []SSEChoice `json:"choices"`
}
type UploadDocumentResponse ¶
type UploadDocumentResponse struct { Success bool `json:"success"` DocID string `json:"doc_id"` Message string `json:"message"` }
UploadDocumentResponse 上传文档响应
Click to show internal directories.
Click to hide internal directories.