client

package
v0.0.0-...-15e837a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RagClient

type RagClient struct {
	// contains filtered or unexported fields
}

RagClient 封装了对 RAG 服务的调用

func NewRagClient

func NewRagClient() (*RagClient, error)

NewRagClient 创建新的 RAG 客户端

func (*RagClient) Close

func (c *RagClient) Close()

Close 关闭 gRPC 连接

func (*RagClient) CreateKnowledgeBase

func (c *RagClient) CreateKnowledgeBase(ctx context.Context, uid, kbName, embeddingModel string) (*pb.CreateKBResponse, error)

CreateKnowledgeBase 创建知识库

func (*RagClient) DeleteDocument

func (c *RagClient) DeleteDocument(ctx context.Context, uid, kbID, docID string) (*pb.DeleteDocResponse, error)

DeleteDocument 删除文档

func (*RagClient) DeleteKnowledgeBase

func (c *RagClient) DeleteKnowledgeBase(ctx context.Context, uid, kbID string) (*pb.DeleteKBResponse, error)

DeleteKnowledgeBase 删除知识库

func (*RagClient) ListDocuments

func (c *RagClient) ListDocuments(ctx context.Context, kbID string) (*pb.ListDocsResponse, error)

ListDocuments 获取知识库中的文档列表

func (*RagClient) ListEmbeddingModels

func (c *RagClient) ListEmbeddingModels(ctx context.Context) (*pb.ListEmbeddingModelsResponse, error)

ListEmbeddingModels 获取支持的嵌入模型列表

func (*RagClient) ListKnowledgeBases

func (c *RagClient) ListKnowledgeBases(ctx context.Context, uid string) (*pb.ListKBsResponse, error)

ListKnowledgeBases 获取用户的知识库列表

func (*RagClient) RetrieveInfo

func (c *RagClient) RetrieveInfo(ctx context.Context, kbID, query string, topK int) (*pb.RetrieveResponse, error)

RetrieveInfo 从知识库检索信息

func (*RagClient) UploadDocument

func (c *RagClient) UploadDocument(ctx context.Context, uid, kbID, docName string, fileContent []byte, fileType string) (*pb.UploadDocResponse, error)

UploadDocument 上传文档

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL