config

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: MIT Imports: 15 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUpdateConfigFileFromCLI

func CreateUpdateConfigFileFromCLI(fileName string) (err error)

CreateUpdateConfigFileFromCLI reads and updates the configuration file based on command-line arguments.

Parameters:

  • fileName: The name of the configuration file.

Returns:

  • err: An error if there was an issue creating or updating the configuration file.

func GetGlobalConfigAsJSON

func GetGlobalConfigAsJSON() string

GetGlobalConfigAsJSON returns the global configuration as a JSON string.

Returns:

  • string: The global configuration as a JSON string.

func HandleLegacyPortDefinition added in v1.0.3

func HandleLegacyPortDefinition(configAddress string, legacyPort string) (webserverAddress string, err error)

HandleLegacyPortDefinition checks if the address is set, and if not, uses the legacy port to define the web server address. If both are empty, it returns an error.

Parameters:

  • address: The address to use for the web server.
  • legacyPort: The legacy port to use if the address is not set.

Returns:

  • webserverAddress: The web server address to use.
  • err: An error if both address and legacy port are empty.

func InitConfig

func InitConfig(requiredProperties []string, optionalDefaultValues map[string]interface{})

InitConfig initializes the configuration for the Aali service.

Parameters:

  • requiredProperties: The list of required properties.
  • optionalDefaultValues: The map of optional properties and their default values.

func InitGlobalConfigFromAzureKeyVault

func InitGlobalConfigFromAzureKeyVault() (err error)

InitGlobalConfigFromAzureKeyVault extracts the configuration from Azure Key Vault. It iterates over all secrets in the key vault and if the secret name matches a field in the Config struct, it sets the field to the value of the secret.

Returns:

  • err: An error if there was an issue extracting the configuration.

func InitGlobalConfigFromFile

func InitGlobalConfigFromFile(fileName string, requiredProperties []string, optionalDefaultValues map[string]interface{}) (err error)

InitGlobalConfigFromFile reads the configuration file and initializes the Config object.

Parameters:

  • fileName: The name of the configuration file.
  • requiredProperties: The list of required properties.
  • optionalDefaultValues: The map of optional properties and their default values.

Returns:

  • err: An error if there was an issue initializing the configuration.

func ValidateConfig

func ValidateConfig(config Config, requiredProperties []string) (err error)

ValidateConfig checks for mandatory entries in the configuration and validates chosen models.

Parameters:

  • config: The configuration object to validate.
  • requiredProperties: The list of required properties.

Returns:

  • err: An error if there was an issue validating the configuration.

Types

type Config

type Config struct {

	// Logging
	///////////
	LOG_LEVEL string `yaml:"LOG_LEVEL" json:"LOGLEVEL"`
	// Local Logs
	LOCAL_LOGS          bool   `yaml:"LOCAL_LOGS" json:"LOCALLOGS"`
	LOCAL_LOGS_LOCATION string `yaml:"LOCAL_LOGS_LOCATION" json:"LOCALLOGSLOCATION"`
	// Datadog Logs
	DATADOG_LOGS        bool   `yaml:"DATADOG_LOGS" json:"DATADOGLOGS"`
	STAGE               string `yaml:"STAGE" json:"STAGE"`
	VERSION             string `yaml:"VERSION" json:"VERSION"`
	SERVICE_NAME        string `yaml:"SERVICE_NAME" json:"SERVICENAME"`
	ERROR_FILE_LOCATION string `yaml:"ERROR_FILE_LOCATION" json:"ERRORFILELOCATION"`
	LOGGING_URL         string `yaml:"LOGGING_URL" json:"LOGGINGURL"`
	LOGGING_API_KEY     string `yaml:"LOGGING_API_KEY" json:"LOGGINGAPIKEY"`
	DATADOG_SOURCE      string `yaml:"DATADOG_SOURCE" json:"DATADOGSOURCE"`
	// Datadog Metrics
	DATADOG_METRICS bool   `yaml:"DATADOG_METRICS" json:"DATADOGMETRICS"`
	METRICS_URL     string `yaml:"METRICS_URL" json:"METRICSURL"`

	// SSL Settings
	/////////////////
	USE_SSL                   bool   `yaml:"USE_SSL" json:"USESSL"`
	SSL_CERT_PUBLIC_KEY_FILE  string `yaml:"SSL_CERT_PUBLIC_KEY_FILE" json:"SSLCERTPUBLICKEYFILE"`
	SSL_CERT_PRIVATE_KEY_FILE string `yaml:"SSL_CERT_PRIVATE_KEY_FILE" json:"SSLCERTPRIVATEKEYFILE"`

	// Azure Key Vault Settings
	////////////////////////////
	EXTRACT_CONFIG_FROM_AZURE_KEY_VAULT bool   `yaml:"EXTRACT_CONFIG_FROM_AZURE_KEY_VAULT" json:"EXTRACTCONFIGFROMAZUREKEYVAULT"`
	AZURE_KEY_VAULT_NAME                string `yaml:"AZURE_KEY_VAULT_NAME" json:"AZUREKEYVAULTNAME"`
	AZURE_MANAGED_IDENTITY_ID           string `yaml:"AZURE_MANAGED_IDENTITY_ID" json:"AZUREMANAGEDIDENTITYID"`

	// Aali Agent
	///////////////
	AGENT_ADDRESS              string `yaml:"AGENT_ADDRESS" json:"AGENTADDRESS"`
	PRODUCTION_MODE            bool   `yaml:"PRODUCTION_MODE" json:"PRODUCTIONMODE"` // If true, the agent error messages will be generic
	WORKFLOW_API_KEY           string `yaml:"WORKFLOW_API_KEY" json:"WORKFLOWAPIKEY"`
	WORKFLOW_STORE_PATH        string `yaml:"WORKFLOW_STORE_PATH" json:"WORKFLOWSTOREPATH"`
	BINARY_STORE_PATH          string `yaml:"BINARY_STORE_PATH" json:"BINARYSTOREPATH"`
	NUMBER_OF_WORKFLOW_WORKERS int    `yaml:"NUMBER_OF_WORKFLOW_WORKERS" json:"NUMBEROFWORKFLOWWORKERS"`
	// Flowkit Connection
	FLOWKIT_CONNECTIONS        []FlowkitConnection `yaml:"FLOWKIT_CONNECTIONS" json:"FLOWKITCONNECTIONS"`              // Contains the URL and API key for the FlowKit server
	FLOWKIT_PYTHON_CONNECTIONS []FlowkitConnection `yaml:"FLOWKIT_PYTHON_CONNECTIONS" json:"FLOWKITPYTHONCONNECTIONS"` // Contains the URL and API key for the FlowKit-Python server
	// External Function Endpoints (Legacy)
	EXTERNALFUNCTIONS_ENDPOINT string `yaml:"EXTERNALFUNCTIONS_ENDPOINT" json:"EXTERNALFUNCTIONSENDPOINT"`
	FLOWKIT_PYTHON_ENDPOINT    string `yaml:"FLOWKIT_PYTHON_ENDPOINT" json:"FLOWKITPYTHONENDPOINT"`
	// Authentication & Authorization
	ENABLE_AUTH                      bool   `yaml:"ENABLE_AUTH" json:"ENABLEAUTH"` // If true, the agent will require authentication/authorization for workflows
	AZURE_AD_AUTHENTICATION_URL      string `yaml:"AZURE_AD_AUTHENTICATION_URL" json:"AZUREADAUTHENTICATIONURL"`
	ANSYS_AUTHORIZATION_URL          string `yaml:"ANSYS_AUTHORIZATION_URL" json:"ANSYSAUTHORIZATIONURL"`
	ANSYS_GATING_AND_ENTITLEMENT_URL string `yaml:"ANSYS_GATING_AND_ENTITLEMENT_URL" json:"ANSYSGATINGANDENTITLEMENTURL"`
	ANSYS_AUTHORIZATION_CRYPT_KEY    string `yaml:"ANSYS_AUTHORIZATION_CRYPT_KEY" json:"ANSYSAUTHORIZATIONCRYPTKEY"`
	ANSYS_AUTHORIZATION_SECRET_KEY   string `yaml:"ANSYS_AUTHORIZATION_SECRET_KEY" json:"ANSYSAUTHORIZATIONSECRETKEY"`
	ANSYS_DISCO_CRYPT_PRIVAT_KEY     string `yaml:"ANSYS_DISCO_CRYPT_PRIVAT_KEY" json:"ANSYSDISCOCRYPTPRIVATKEY"`
	ANSYS_DISOC_SIGN_PUBLIC_KEY      string `yaml:"ANSYS_DISOC_SIGN_PUBLIC_KEY" json:"ANSYSDISOCSIGNPUBLICKEY"`
	// Workflows
	DISABLE_PUBLIC_WORKFLOWS  bool     `yaml:"DISABLE_PUBLIC_WORKFLOWS" json:"DISABLEPUBLICWORKFLOWS"`
	LOAD_PRIVATE_WORKFLOWS    bool     `yaml:"LOAD_PRIVATE_WORKFLOWS" json:"LOADPRIVATEWORKFLOWS"`
	GITHUB_USER               string   `yaml:"GITHUB_USER" json:"GITHUBUSER"`
	GITHUB_TOKEN              string   `yaml:"GITHUB_TOKEN" json:"GITHUBTOKEN"`
	PRIVATE_WORKFLOWS_FOLDERS []string `yaml:"PRIVATE_WORKFLOWS_FOLDERS" json:"PRIVATEWORKFLOWSFOLDERS"`
	// Exec Settings
	EXEC_ENDPOINT                        string `yaml:"EXEC_ENDPOINT" json:"EXECENDPOINT"`
	EXEC_AGENT_API_KEY                   string `yaml:"EXEC_AGENT_API_KEY" json:"EXECAGENTAPIKEY"`
	MONGO_DB_FOR_MULTI_AGENT             bool   `yaml:"MONGO_DB_FOR_MULTI_AGENT" json:"MONGODBFORMULTIAGENT"`
	MONGO_DB_ENDPOINT                    string `yaml:"MONGO_DB_ENDPOINT" json:"MONGODBENDPOINT"`
	MILLISECONDS_MONGODB_UPDATE_INTERVAL int    `yaml:"MILLISECONDS_MONGODB_UPDATE_INTERVAL" json:"MILLISECONDSMONGODBUPDATEINTERVAL"`
	EXEC_FILE_STORE_PATH                 string `yaml:"EXEC_FILE_STORE_PATH" json:"EXECFILESTOREPATH"`
	// DB Connection
	KVDB_ENDPOINT string `yaml:"KVDB_ENDPOINT" json:"KVDBENDPOINT"`
	// Workflow Store
	WORKFLOW_CONFIG_VARIABLES map[string]string `yaml:"WORKFLOW_CONFIG_VARIABLES" json:"WORKFLOWCONFIGVARIABLES"`

	// Aali LLM
	/////////////
	LLM_ADDRESS            string `yaml:"LLM_ADDRESS" json:"LLMADDRESS"`
	MODELS_CONFIG_LOCATION string `yaml:"MODELS_CONFIG_LOCATION" json:"MODELSCONFIGLOCATION"`
	LLM_API_KEY            string `yaml:"LLM_API_KEY" json:"LLMAPIKEY"`

	// Aali Exec
	//////////////
	EXEC_ADDRESS string `yaml:"EXEC_ADDRESS" json:"EXECADDRESS"`
	EXEC_ID      string `yaml:"EXEC_ID" json:"EXECID"`
	EXEC_API_KEY string `yaml:"EXEC_API_KEY" json:"EXECAPIKEY"`
	// Python executable name
	PYTHON_EXECUTABLE string `yaml:"PYTHON_EXECUTABLE" json:"PYTHONEXECUTABLE"`
	BASH_EXECUTABLE   string `yaml:"BASH_EXECUTABLE" json:"BASHEXECUTABLE"`
	// File transfer
	WATCH_FOLDER_PATH              string `yaml:"WATCH_FOLDER_PATH" json:"WATCHFOLDERPATH"`
	MILLISECONDS_SINCE_LAST_CHANGE int    `yaml:"MILLISECONDS_SINCE_LAST_CHANGE" json:"MILLISECONDSSINCELASTCHANGE"`
	// Agent connection
	AGENT_ENDPOINT string `yaml:"AGENT_ENDPOINT" json:"AGENTENDPOINT"`

	// Aali KVDB
	/////////////////
	KVDB_ADDRESS   string `yaml:"KVDB_ADDRESS" json:"KVDBADDRESS"`
	KVDB_PATH      string `yaml:"KVDB_PATH" json:"KVDBPATH"`
	KVDB_IN_MEMORY bool   `yaml:"KVDB_IN_MEMORY" json:"KVDBINMEMORY"`

	// Aali Flowkit
	/////////////////
	FLOWKIT_ADDRESS string `yaml:"FLOWKIT_ADDRESS" json:"FLOWKITADDRESS"`
	FLOWKIT_API_KEY string `yaml:"FLOWKIT_API_KEY" json:"FLOWKITAPIKEY"`
	// Connections to other Modules
	LLM_HANDLER_ENDPOINT  string `yaml:"LLM_HANDLER_ENDPOINT" json:"LLMHANDLERENDPOINT"`
	KNOWLEDGE_DB_ENDPOINT string `yaml:"KNOWLEDGE_DB_ENDPOINT" json:"KNOWLEDGEDBENDPOINT"`
	GRAPHDB_ADDRESS       string `yaml:"GRAPHDB_ADDRESS" json:"GRAPHDBADDRESS"`
	QDRANT_HOST           string `yaml:"QDRANT_HOST" json:"QDRANTHOST"`
	QDRANT_PORT           int    `yaml:"QDRANT_PORT" json:"QDRANTPORT"`

	// Aali Flowkit Python
	//////////////////////
	FLOWKIT_PYTHON_ADDRESS string `yaml:"FLOWKIT_PYTHON_ADDRESS" json:"FLOWKITPYTHONADDRESS"`
	FLOWKIT_PYTHON_API_KEY string `yaml:"FLOWKIT_PYTHON_API_KEY" json:"FLOWKITPYTHONAPIKEY"`

	// Legacy Port definitions (are overwritten by the new ADDRESS variables)
	/////////////////////////////////////////////////////////////////////////
	AGENT_PORT                  string `yaml:"AGENT_PORT" json:"AGENTPORT"`
	EXTERNALFUNCTIONS_GRPC_PORT string `yaml:"EXTERNALFUNCTIONS_GRPC_PORT" json:"EXTERNALFUNCTIONSGRPCPORT"`
	WEBSERVER_PORT              string `yaml:"WEBSERVER_PORT" json:"WEBSERVERPORT"`
	WEBSERVER_PORT_EXEC         string `yaml:"WEBSERVER_PORT_EXEC" json:"WEBSERVERPORTEXEC"`
}

Config contains all the configuration settings for the Aali service.

var GlobalConfig *Config

Initialize conifg dict

type FlowkitConnection added in v1.0.3

type FlowkitConnection struct {
	URL     string `yaml:"URL" json:"URL"`        // URL of the FlowKit server
	API_KEY string `yaml:"API_KEY" json:"APIKEY"` // API key for the FlowKit server
}

FlowkitConnections contains the configuration for connecting to the FlowKit server.

Jump to

Keyboard shortcuts

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