config

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepCopyJSON

func DeepCopyJSON[T any](src T) (T, error)

DeepCopyJSON creates a deep copy of JSON-serializable structs

func OpenAIConfigFromServiceConfig

func OpenAIConfigFromServiceConfig(serviceConfig llm.ServiceConfig, botConfig llm.BotConfig) openai.Config

func OpenAIConfigFromServiceConfigWithOptions added in v1.7.0

func OpenAIConfigFromServiceConfigWithOptions(serviceConfig llm.ServiceConfig, botConfig llm.BotConfig, disableStreamOptions bool, useMaxTokens bool) openai.Config

OpenAIConfigFromServiceConfigWithOptions creates an OpenAI config with additional options for OpenAI-compatible APIs. SendUserID is preserved from the operator's service config rather than overridden here; providers that don't support it should hide the toggle in the UI so it defaults to false.

Types

type Config

type Config struct {
	Services                        []llm.ServiceConfig              `json:"services"`
	Bots                            []llm.BotConfig                  `json:"bots"`
	DefaultBotName                  string                           `json:"defaultBotName"`
	TranscriptGenerator             string                           `json:"transcriptBackend"`
	EnableLLMTrace                  bool                             `json:"enableLLMTrace"`
	EnableTokenUsageLogging         bool                             `json:"enableTokenUsageLogging"`
	EnableTokenUsageLogToPlugin     *bool                            `json:"enableTokenUsageLogToPlugin,omitempty"`
	EnableTokenUsageLogToFile       *bool                            `json:"enableTokenUsageLogToFile,omitempty"`
	AllowedUpstreamHostnames        string                           `json:"allowedUpstreamHostnames"`
	AllowUnsafeLinks                bool                             `json:"allowUnsafeLinks"`
	EnableChannelMentionToolCalling bool                             `json:"enableChannelMentionToolCalling"`
	AllowNativeWebSearchInChannels  bool                             `json:"allowNativeWebSearchInChannels"`
	EmbeddingSearchConfig           embeddings.EmbeddingSearchConfig `json:"embeddingSearchConfig"`
	MCP                             MCPConfig                        `json:"mcp"`
	WebSearch                       WebSearchConfig                  `json:"webSearch"`
}

func (*Config) Clone

func (c *Config) Clone() *Config

func (*Config) GetServiceByID added in v1.5.0

func (c *Config) GetServiceByID(id string) (llm.ServiceConfig, bool)

GetServiceByID returns the service configuration for the given ID

type Container

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

func (*Container) AllowNativeWebSearchInChannels added in v1.8.1

func (c *Container) AllowNativeWebSearchInChannels() bool
func (c *Container) AllowUnsafeLinks() bool

func (*Container) Config

func (c *Container) Config() *Config

Config retruns the whole configuration readonly. Avoid using this method, prefer using config though interfaces.

func (*Container) EmbeddingSearchConfig

func (c *Container) EmbeddingSearchConfig() embeddings.EmbeddingSearchConfig

func (*Container) EnableChannelMentionToolCalling added in v1.9.0

func (c *Container) EnableChannelMentionToolCalling() bool

func (*Container) EnableLLMLogging

func (c *Container) EnableLLMLogging() bool

func (*Container) EnableTokenUsageLogToFile added in v1.10.0

func (c *Container) EnableTokenUsageLogToFile() bool

func (*Container) EnableTokenUsageLogToPlugin added in v1.10.0

func (c *Container) EnableTokenUsageLogToPlugin() bool

func (*Container) EnableTokenUsageLogging added in v1.4.0

func (c *Container) EnableTokenUsageLogging() bool

func (*Container) GetBots

func (c *Container) GetBots() []llm.BotConfig

func (*Container) GetDefaultBotName

func (c *Container) GetDefaultBotName() string

func (*Container) GetEnableLLMTrace

func (c *Container) GetEnableLLMTrace() bool

func (*Container) GetServiceByID added in v1.5.0

func (c *Container) GetServiceByID(id string) (llm.ServiceConfig, bool)

GetServiceByID returns the service configuration for the given ID

func (*Container) GetTranscriptGenerator

func (c *Container) GetTranscriptGenerator() string

func (*Container) MCP

func (c *Container) MCP() MCPConfig

func (*Container) RegisterUpdateListener

func (c *Container) RegisterUpdateListener(listener UpdateListener)

func (*Container) Update

func (c *Container) Update(newConfig *Config)

Updates the current configuration The new configuration is deep-copied to ensure the new and old configurations are independent of each other.

type MCPConfig added in v1.14.0

type MCPConfig struct {
	Enabled            bool                    `json:"enabled"`
	EnablePluginServer bool                    `json:"enablePluginServer"`
	Servers            []MCPServerConfig       `json:"servers"`
	EmbeddedServer     MCPEmbeddedServerConfig `json:"embeddedServer"`
	IdleTimeoutMinutes int                     `json:"idleTimeoutMinutes"`
}

MCPConfig contains the configuration for the MCP servers

type MCPEmbeddedServerConfig added in v1.14.0

type MCPEmbeddedServerConfig struct {
	Enabled bool `json:"enabled"`
}

MCPEmbeddedServerConfig contains configuration for the embedded MCP server

type MCPServerConfig added in v1.14.0

type MCPServerConfig struct {
	Name         string            `json:"name"`
	Enabled      bool              `json:"enabled"`
	BaseURL      string            `json:"baseURL"`
	Headers      map[string]string `json:"headers,omitempty"`
	ClientID     string            `json:"clientID,omitempty"`
	ClientSecret string            `json:"clientSecret,omitempty"`
}

MCPServerConfig contains the configuration for a single MCP server

type UpdateListener

type UpdateListener func()

type WebSearchBraveConfig added in v1.8.0

type WebSearchBraveConfig struct {
	APIKey       string `json:"apiKey"`
	APIURL       string `json:"apiURL"`
	ResultLimit  int    `json:"resultLimit"`
	PollTimeout  int    `json:"pollTimeout"`
	PollInterval int    `json:"pollInterval"`
}

type WebSearchConfig added in v1.8.0

type WebSearchConfig struct {
	Enabled        bool                  `json:"enabled"`
	Provider       string                `json:"provider"`
	Google         WebSearchGoogleConfig `json:"google"`
	Brave          WebSearchBraveConfig  `json:"brave"`
	DomainDenylist []string              `json:"domainDenylist"`
}

type WebSearchGoogleConfig added in v1.8.0

type WebSearchGoogleConfig struct {
	APIKey         string `json:"apiKey"`
	SearchEngineID string `json:"searchEngineId"`
	ResultLimit    int    `json:"resultLimit"`
	APIURL         string `json:"apiURL"`
}

Jump to

Keyboard shortcuts

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