profile

package
v0.62.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Profile

type Profile struct {
	// Mode can be "prod" or "dev" or "demo"
	Mode string
	// Addr is the binding address for server
	Addr string
	// Port is the binding port for server
	Port int
	// UNIXSock is the IPC binding path. Overrides Addr and Port
	UNIXSock string
	// Data is the data directory
	Data string
	// DSN points to where divinesense stores its own data
	DSN string
	// Driver is the database driver (sqlite or postgres)
	Driver string
	// Version is the current version of server
	Version string
	// InstanceURL is the url of your divinesense instance.
	InstanceURL string

	// AI Configuration
	AIEnabled            bool   // DIVINESENSE_AI_ENABLED (legacy: MEMOS_AI_ENABLED)
	AIEmbeddingProvider  string // MEMOS_AI_EMBEDDING_PROVIDER (default: siliconflow)
	AILLMProvider        string // MEMOS_AI_LLM_PROVIDER (default: deepseek)
	AISiliconFlowAPIKey  string // MEMOS_AI_SILICONFLOW_API_KEY
	AISiliconFlowBaseURL string // MEMOS_AI_SILICONFLOW_BASE_URL (default: https://api.siliconflow.cn/v1)
	AIDeepSeekAPIKey     string // MEMOS_AI_DEEPSEEK_API_KEY
	AIDeepSeekBaseURL    string // MEMOS_AI_DEEPSEEK_BASE_URL (default: https://api.deepseek.com)
	AIOpenAIAPIKey       string // MEMOS_AI_OPENAI_API_KEY
	AIOpenAIBaseURL      string // MEMOS_AI_OPENAI_BASE_URL (default: https://api.openai.com/v1)
	AIOllamaBaseURL      string // MEMOS_AI_OLLAMA_BASE_URL (default: http://localhost:11434)
	AIEmbeddingModel     string // MEMOS_AI_EMBEDDING_MODEL (default: BAAI/bge-m3)
	AIRerankModel        string // MEMOS_AI_RERANK_MODEL (default: BAAI/bge-reranker-v2-m3)
	AILLMModel           string // MEMOS_AI_LLM_MODEL (default: deepseek-chat)

	// Attachment Processing Configuration
	OCREnabled         bool   // MEMOS_OCR_ENABLED (default: false)
	TextExtractEnabled bool   // MEMOS_TEXTEXTRACT_ENABLED (default: false)
	TesseractPath      string // MEMOS_OCR_TESSERACT_PATH (default: tesseract)
	TessdataPath       string // MEMOS_OCR_TESSDATA_PATH (default: "")
	OCRLanguages       string // MEMOS_OCR_LANGUAGES (default: chi_sim+eng)
	TikaServerURL      string // MEMOS_TEXTEXTRACT_TIKA_URL (default: http://localhost:9998)
}

Profile is the configuration to start main server.

func (*Profile) FromEnv

func (p *Profile) FromEnv()

FromEnv loads configuration from environment variables. Supports both DIVINESENSE_* (new) and MEMOS_* (legacy) prefixes.

func (*Profile) IsAIEnabled

func (p *Profile) IsAIEnabled() bool

IsAIEnabled returns true if AI is enabled and at least one API key or base URL is configured.

func (*Profile) IsDev

func (p *Profile) IsDev() bool

func (*Profile) Validate

func (p *Profile) Validate() error

Jump to

Keyboard shortcuts

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