knowledgebases

package
v0.0.0-...-67c0019 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SharedPrefix string = "kb-" // Shared knowledge base prefix
)

Variables

This section is empty.

Functions

func NewSharedKnowledgeBaseID

func NewSharedKnowledgeBaseID() string

Types

type Config

type Config struct {
	KnowledgeRetrievalAPIURL string `usage:"Knowledge retrieval API URL" env:"CLICKY_CHATS_KNOWLEDGE_RETRIEVAL_API_URL"`
}

type CreateKnowledgeBaseRequest

type CreateKnowledgeBaseRequest struct {
	ID       string `json:"id"`
	EmbedDim int    `json:"embed_dim"`
}

type CreateKnowledgeBaseResponse

type CreateKnowledgeBaseResponse struct {
	CreateKnowledgeBaseRequest `json:",inline"`
}

type IngestFileRequest

type IngestFileRequest struct {
	Filename string `json:"filename,omitempty"`
	FileID   string `json:"file_id,omitempty"`
	Content  string `json:"content,omitempty"` // Base64 encoded content
}

type KnowledgeBaseManager

type KnowledgeBaseManager struct {
	Config
	// contains filtered or unexported fields
}

func NewKnowledgeBaseManager

func NewKnowledgeBaseManager(ctx context.Context, config Config, db *db.DB) (*KnowledgeBaseManager, error)

func (*KnowledgeBaseManager) AddFile

func (m *KnowledgeBaseManager) AddFile(ctx context.Context, id string, fileID string) error

func (*KnowledgeBaseManager) CreateKnowledgeBase

func (m *KnowledgeBaseManager) CreateKnowledgeBase(ctx context.Context, id string) (string, error)

func (*KnowledgeBaseManager) DeleteKnowledgeBase

func (m *KnowledgeBaseManager) DeleteKnowledgeBase(ctx context.Context, id string) error

func (*KnowledgeBaseManager) ListFiles

func (m *KnowledgeBaseManager) ListFiles(ctx context.Context, id string) ([]string, error)

func (*KnowledgeBaseManager) NewAssistantKnowledgeBase

func (m *KnowledgeBaseManager) NewAssistantKnowledgeBase(ctx context.Context, assistantID string) (string, error)

func (*KnowledgeBaseManager) NewSharedKnowledgeBase

func (m *KnowledgeBaseManager) NewSharedKnowledgeBase(ctx context.Context) (string, error)

func (*KnowledgeBaseManager) RemoveFile

func (m *KnowledgeBaseManager) RemoveFile(ctx context.Context, id string, fileID string) error

Jump to

Keyboard shortcuts

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