Documentation
¶
Index ¶
- Constants
- type AzureConfig
- func (a *AzureConfig) ChatAPIKey() string
- func (a *AzureConfig) ChatAPIVersion() string
- func (a *AzureConfig) ChatEndpoint() string
- func (a *AzureConfig) ChatModel() string
- func (a *AzureConfig) EmbedAPIKey() string
- func (a *AzureConfig) EmbedAPIVersion() string
- func (a *AzureConfig) EmbedEndpoint() string
- func (a *AzureConfig) EmbedModel() string
- type AzureServiceConfig
- type CommunityConfig
- type Config
- type IndexingConfig
- type LLMConfig
- type OllamaConfig
- type ServerConfig
Constants ¶
const DefaultProjectSlug = "_default"
DefaultProjectSlug is the slug used when no ?project= / X-Project value is supplied on a request, and when `docsiq migrate` has no explicit --into target. Locked by Phase-1 spec.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AzureConfig ¶
type AzureConfig struct {
// Shared defaults — used when chat/embed-specific values are not set.
Endpoint string `mapstructure:"endpoint"`
APIKey string `mapstructure:"api_key"`
APIVersion string `mapstructure:"api_version"`
Chat AzureServiceConfig `mapstructure:"chat"`
Embed AzureServiceConfig `mapstructure:"embed"`
}
AzureConfig supports shared defaults with per-service overrides. Top-level fields (endpoint, api_key, api_version) are shared defaults. Chat/Embed sub-configs override specific fields when set.
Env vars (prefix DOCSIQ — legacy DOCSCONTEXT_* is still accepted as a deprecated alias and rewritten to DOCSIQ_* at Load() time):
DOCSIQ_LLM_AZURE_ENDPOINT — shared endpoint DOCSIQ_LLM_AZURE_API_KEY — shared API key DOCSIQ_LLM_AZURE_API_VERSION — shared API version DOCSIQ_LLM_AZURE_CHAT_ENDPOINT — chat-specific endpoint DOCSIQ_LLM_AZURE_CHAT_API_KEY — chat-specific API key DOCSIQ_LLM_AZURE_CHAT_MODEL — chat model name DOCSIQ_LLM_AZURE_EMBED_ENDPOINT — embedding-specific endpoint DOCSIQ_LLM_AZURE_EMBED_API_KEY — embedding-specific API key DOCSIQ_LLM_AZURE_EMBED_MODEL — embedding model name
func (*AzureConfig) ChatAPIKey ¶
func (a *AzureConfig) ChatAPIKey() string
func (*AzureConfig) ChatAPIVersion ¶
func (a *AzureConfig) ChatAPIVersion() string
func (*AzureConfig) ChatEndpoint ¶
func (a *AzureConfig) ChatEndpoint() string
func (*AzureConfig) ChatModel ¶
func (a *AzureConfig) ChatModel() string
func (*AzureConfig) EmbedAPIKey ¶
func (a *AzureConfig) EmbedAPIKey() string
func (*AzureConfig) EmbedAPIVersion ¶
func (a *AzureConfig) EmbedAPIVersion() string
func (*AzureConfig) EmbedEndpoint ¶
func (a *AzureConfig) EmbedEndpoint() string
func (*AzureConfig) EmbedModel ¶
func (a *AzureConfig) EmbedModel() string
type AzureServiceConfig ¶
type CommunityConfig ¶
type Config ¶
type Config struct {
DataDir string `mapstructure:"data_dir"`
DefaultProject string `mapstructure:"default_project"`
LLM LLMConfig `mapstructure:"llm"`
Indexing IndexingConfig `mapstructure:"indexing"`
Community CommunityConfig `mapstructure:"community"`
Server ServerConfig `mapstructure:"server"`
// Phase-5: per-project LLM overrides. Keyed by project slug.
// When a slug is missing from the map, callers fall back to the
// top-level LLM field. Not bound to env vars — configure via
// YAML only (env flat-string rewriting doesn't nest well).
LLMOverrides map[string]LLMConfig `mapstructure:"llm_overrides"`
}
func (*Config) DBPath ¶
DBPath returns the legacy single-DB path ($DATA_DIR/DocsContext.db). Kept for backwards-compatibility with pre-Phase-1 code paths; new per-project code should use ProjectDBPath instead.
func (*Config) LLMConfigForProject ¶
LLMConfigForProject returns the override for slug if present, otherwise the root LLM config. A missing or empty slug yields the root config. The Provider field is treated as the presence sentinel — a YAML block with no `provider:` key leaves Provider empty, so we treat that as "no override declared" and fall back to the root.
func (*Config) NotesDir ¶
NotesDir returns the per-project notes directory: $DATA_DIR/projects/<slug>/notes. Callers that actually intend to read or write notes should use os.MkdirAll on this path first — the config helper does not touch the filesystem.
func (*Config) ProjectDBPath ¶
ProjectDBPath returns the per-project SQLite path for the given slug: $DATA_DIR/projects/<slug>/docscontext.db. Does NOT validate the slug — callers should use project.IsValidSlug or store.OpenForProject (which performs the check) when the slug came from untrusted input.
type IndexingConfig ¶
type IndexingConfig struct {
ChunkSize int `mapstructure:"chunk_size"`
ChunkOverlap int `mapstructure:"chunk_overlap"`
BatchSize int `mapstructure:"batch_size"`
Workers int `mapstructure:"workers"`
ExtractGraph bool `mapstructure:"extract_graph"`
ExtractClaims bool `mapstructure:"extract_claims"`
MaxGleanings int `mapstructure:"max_gleanings"`
}
type LLMConfig ¶
type LLMConfig struct {
Provider string `mapstructure:"provider"`
Azure AzureConfig `mapstructure:"azure"`
Ollama OllamaConfig `mapstructure:"ollama"`
}