{"repo": "carv-protocol/d.a.t.a", "files": {"src/internal/conf/conf.go": {"e41b2a98b5f5d6d5ba56ef7e19d9cad33ac2932a": {"t": 1785746095.581666, "n": 9588, "h": "bf7b6c10addbdb3b", "c": "package conf\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/carv-protocol/d.a.t.a/src/pkg/logger\"\n\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/viper\"\n)\n\nconst (\n\tTwitterModeAPI TwitterMode = \"api\"\n\tTwitterModeScraper TwitterMode = \"scraper\"\n\n\tThoughtStepTypeTask ThoughtStepType = \"task\"\n\tThoughtStepTypeAction ThoughtStepType = \"action\"\n\n\tDatabasePostgres DatabaseType = \"postgres\"\n\tDatabaseSqlite DatabaseType = \"sqlite\"\n)\n\nvar (\n\tErrInvalidLLMConfig = errors.New(\"invalid LLM configuration\")\n\tErrInvalidDBConfig = errors.New(\"invalid database configuration\")\n)\n\ntype (\n\tTwitterMode string\n\tThoughtStepType string\n\tDatabaseType string\n)\n\ntype LLMConfig struct {\n\tProvider string `mapstructure:\"provider\"`\n\tAPIKey string `mapstructure:\"api_key\"`\n\tBaseURL string `mapstructure:\"base_url\"`\n\tModel string `mapstructure:\"model\"`\n}\n\ntype CarvConfig struct {\n\tAPIKey string `mapstructure:\"api_key\"`\n\tBaseURL string `mapstructure:\"base_url\"`\n}\n\ntype TwitterConfig struct {\n\tMode TwitterMode `mapstructure:\"mode\"` // Mode of operation: \"api\" or \"scraper\"\n\tUsername string `mapstructure:\"username\"` // Twitter username\n\tPassword string `mapstructure:\"password\"` // Twitter password\n\tAPIKey string `mapstructure:\"api_key\"`\n\tAPIKeySecret string `mapstructure:\"api_key_secret\"`\n\tAccessToken string `mapstructure:\"access_token\"`\n\tTokenSecret string `mapstructure:\"token_secret\"`\n\tMonitorWindow int `mapstructure:\"monitor_window\"` // Duration in minutes, e.g. 20\n}\n\ntype DiscordConfig struct {\n\tAPIToken string `mapstructure:\"api_token\"`\n}\n\ntype TelegramConfig struct {\n\tToken string `mapstructure:\"bot_token\"` // Bot token from BotFather\n\tChannelID int64 `mapstructure:\"channel_id\"` // Default channel ID for broadcasts\n\tDebug bool `mapstructure:\"debug\"` // Enable debug mode\n}\n\ntype PromptTemplates struct {\n\tSystem struct {\n\t\tBaseTemplate string `mapstructure:\"base_template\"`\n\t\tInfoFormat map[string]string `mapstructure:\"info_format\"`\n\t} `mapstructure:\"system\"`\n\n\tMessage struct {\n\t\tAnalysis string `mapstructure:\"analysis\"`\n\t\tAction string `mapstructure:\"action\"`\n\t} `mapstructure:\"message\"`\n\n\tThoughtSteps map[ThoughtStepType]struct {\n\t\tInitial string `mapstructure:\"initial\"`\n\t\tExploration string `mapstructure:\"exploration\"`\n\t\tAnalysis string `mapstructure:\"analysis\"`\n\t\tReconsider string `mapstructure:\"reconsider\"`\n\t\tRefinement string `mapstructure:\"refinement\"`\n\t\tConcrete string `mapstructure:\"concrete\"`\n\t} `mapstructure:\"thought_steps\"`\n}\n\ntype PluginConfig struct {\n\tName string `mapstructure:\"name\"`\n\tEnabled bool `mapstructure:\"enabled\"`\n\tVersion string `mapstructure:\"version\"`\n\tAuthor string `mapstructure:\"author\"`\n\tDescription string `mapstructure:\"description\"`\n\tDependencies []string `mapstructure:\"dependencies\"`\n\tOptions map[string]interface{} `mapstructure:\"options\"`\n}\n\ntype Character struct {\n\tName string `mapstructure:\"name\"`\n\tPath string `mapstructure:\"path\"`\n}\n\ntype Config struct {\n\tSettings struct {\n\t\tShutdownTimeout int `mapstructure:\"shutdown_timeout\"`\n\t} `mapstructure:\"settings\"`\n\n\tCharacter `mapstructure:\"character\"`\n\n\tDatabase struct {\n\t\tType DatabaseType `mapstructure:\"type\"`\n\t\tPath string `mapstructure:\"path\"`\n\t} `mapstructure:\"database\"`\n\n\tLLMConfig `mapstructure:\"llm_config\"`\n\n\tData struct {\n\t\tCarvConfig `mapstructure:\"carv\"`\n\t} `mapstructure:\"data\"`\n\n\tSocial struct {\n\t\tTwitterConfig `mapstructure:\"twitter\"`\n\t\tDiscordConfig `mapstructure:\"discord\"`\n\t\tTelegramConfig `mapstructure:\"telegram\"`\n\t} `mapstructure:\"social\"`\n\n\tToken struct {\n\t\tNetwork string `mapstructure:\"network\"`\n\t\tTicker string `mapstructure:\"ticker\"`\n\t\tContractAddr string `mapstructure:\"contract_addr\"`\n\t} `mapstructure:\"token\"`\n\n\tWeb struct {\n\t\tPort int `mapstructure:\"port\"`\n\t} `mapstructure:\"web\"`\n\n\tUserTemplates *PromptTemplates `mapstructure:\"user_templates\"`\n\tDefaultTemplates *PromptTemplates `mapstructure:\"default_templates\"`\n\n\tPlugins map[string]PluginConfig `mapstructure:\"plugins\"`\n}\n\n// LoadConfig loads and validates the application configuration\nfunc LoadConfig(confPath string) (*Config, error) {\n\tsetDefaultConfig()\n\n\tif err := loadYamlConfig(confPath); err != nil {\n\t\treturn nil, fmt.Errorf(\"error load yaml config: %w\", err)\n\t}\n\n\tif err := loadEnvConfig(confPath); err != nil {\n\t\treturn nil, fmt.Errorf(\"error load env config: %w\", err)\n\t}\n\n\tfillDefaultOptions()\n\n\tvar conf Config\n\tif err := viper.Unmarshal(&conf); err != nil {\n\t\treturn nil, fmt.Errorf(\"error unmarshaling config: %w\", err)\n\t}\n\n\t// Validate config\n\tif err := validateConfig(&conf, confPath); err != nil {\n\t\treturn nil, fmt.Errorf(\"config validation failed: %w\", err)\n\t}\n\n\treturn &conf, nil\n}\n\nfunc loadYamlConfig(confPath string) error {\n\tviper.SetConfigName(\"config\")\n\tviper.SetConfigType(\"yaml\")\n\tviper.AddConfigPath(confPath)\n\n\t// Load main config\n\tif err := viper.ReadInConfig(); err != nil {\n\t\tif !errors.As(err, &viper.ConfigFileNotFoundError{}) {\n\t\t\treturn fmt.Errorf(\"error reading config file: %w\", err)\n\t\t}\n\t\tlogger.GetLogger().Infoln(\"No config file found, using defaults\")\n\t} else {\n\t\tlogger.GetLogger().Infof(\"Loaded config from file: %s\", viper.ConfigFileUsed())\n\t}\n\n\treturn nil\n}\n\nfunc loadEnvConfig(confPath string) error {\n\tviper.SetConfigName(\".env\")\n\tviper.SetConfigType(\"env\")\n\tviper.AddConfigPath(confPath)\n\n\tif err := viper.MergeInConfig(); err != nil {\n\t\tif errors.As(err, &viper.ConfigFileNotFoundError{}) {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"error reading .env: %w\", err)\n\t}\n\n\t// Map environment variables to config\n\tenvMappings := map[string]string{\n\t\t\"LLM_PROVIDER\": \"llm_config.provider\",\n\t\t\"LLM_API_KEY\": \"llm_config.api_key\",\n\t\t\"TWITTER_BEARER_TOKEN\": \"social.twitter.bearer_token\",\n\t\t\"TWITTER_API_KEY\": \"social.twitter.api_key\",\n\t\t\"TWITTER_API_KEY_SECRET\": \"social.twitter.api_key_secret\",\n\t\t\"TWITTER_ACCESS_TOKEN\": \"social.twitter.access_token\",\n\t\t\"TWITTER_TOKEN_SECRET\": \"social.twitter.token_secret\",\n\t\t\"TWITTER_MONITOR_WINDOW\": \"social.twitter.monitor_window\",\n\t\t\"DISCORD_API_TOKEN\": \"social.discord.api_token\",\n\t\t\"TELEGRAM_BOT_TOKEN\": \"social.telegram.bot_token\",\n\t\t\"CARV_DATA_BASE_URL\": \"data.carv.base_url\",\n\t\t\"CARV_DATA_API_KEY\": \"data.carv.api_key\",\n\t\t\"WALLET_PRIVATE_KEY\": \"wallet.private_key\",\n\t}\n\n\t// override config values with environment variables\n\tfor env, conf := range envMappings {\n\t\tviper.Set(conf, viper.Get(env))\n\t}\n\n\treturn nil\n}\n\nfunc setDefaultConfig() {\n\tviper.SetDefault(\"database.type\", \"sqlite\")\n\tviper.SetDefault(\"database.path\", \"./data/data.db\")\n\tviper.SetDefault(\"llm_config.provider\", \"openai\")\n\tviper.SetDefault(\"llm_config.base_url\", \"https://api.openai.com/v1\")\n\tviper.SetDefault(\"llm_config.model\", \"gpt-4o\") // Default model for OpenAI\n\tviper.SetDefault(\"shutdown_timeout\", 30) // shutdown timeout in seconds\n\tviper.SetDefault(\"plugin.plugins\", map[string]PluginConfig{}) // Default empty plugins map\n}\n\nfunc fillDefaultOptions() {\n\tswitch viper.GetString(\"llm_config.provider\") {\n\tcase \"deepseek\":\n\t\tif !viper.IsSet(\"llm_config.base_url\") {\n\t\t\tviper.Set(\"llm_config.base_url\", \"https://api.deepseek.com\")\n\t\t}\n\t\tif !viper.IsSet(\"llm_config.model\") {\n\t\t\tviper.Set(\"llm_config.model\", \"deepseek-chat\")\n\t\t}\n\tcase \"openai\":\n\t\tif !viper.IsSet(\"llm_config.base_url\") {\n\t\t\tviper.Set(\"llm_config.base_url\", \"https://api.openai.com/v1\")\n\t\t}\n\t\tif !viper.IsSet(\"llm_config.model\") {\n\t\t\tviper.Set(\"llm_config.model\", \"gpt-3.5-turbo\")\n\t\t}\n\t}\n\n\t// Special handling for Telegram channel ID\n\tif channelID := viper.GetString(\"TELEGRAM_CHANNEL_ID\"); channelID != \"\" {\n\t\tviper.Set(\"social.telegram.channel_id\", strings.Trim(channelID, \"${}\"))\n\t}\n}\n\n// loadDefaultTemplates loads templates from default_templates.yaml\nfunc loadDefaultTemplates(configPath string) (*PromptTemplates, error) {\n\tdefaultViper := viper.New()\n\tdefaultViper.SetConfigName(\"default_templates\")\n\tdefaultViper.SetConfigType(\"yaml\")\n\tdefaultViper.AddConfigPath(configPath)\n\n\tif err := defaultViper.ReadInConfig(); err != nil {\n\t\treturn nil, fmt.Errorf(\"error reading default templates: %w\", err)\n\t}\n\n\tvar defaultTemplates PromptTemplates\n\tif err := defaultViper.UnmarshalKey(\"default_templates\", &defaultTemplates); err != nil {\n\t\treturn nil, fmt.Errorf(\"error unmarshaling default templates: %w\", err)\n\t}\n\n\treturn &defaultTemplates, nil\n}\n\nfunc validateConfig(conf *Config, confPath string) error {\n\t// Check if user templates are defined, if not load default templates\n\tif conf.UserTemplates == nil {\n\t\tlogger.GetLogger().Infoln(\"User templates not defined, loading default templates\")\n\t\tdefaultTemplates, err := loadDefaultTemplates(confPath)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to load default templates: %w\", err)\n\t\t}\n\t\tconf.DefaultTemplates = defaultTemplates\n\t\tconf.UserTemplates = conf.DefaultTemplates\n\t} else {\n\t\tlogger.GetLogger().Infoln(\"Using user-defined templates\")\n\t}\n\n\tif conf.LLMConfig.APIKey == \"\" {\n\t\treturn fmt.Errorf(\"%w: missing API key\", ErrInvalidLLMConfig)\n\t}\n\tif conf.LLMConfig.Provider == \"\" {\n\t\treturn fmt.Errorf(\"%w: missing provider\", ErrInvalidLLMConfig)\n\t}\n\tif conf.LLMConfig.Model == \"\" {\n\t\treturn fmt.Errorf(\"%w: missing model\", ErrInvalidLLMConfig)\n\t}\n\tif conf.Database.Path == \"\" {\n\t\treturn ErrInvalidDBConfig\n\t}\n\tif conf.DefaultTemplates == nil && conf.UserTemplates == nil {\n\t\treturn fmt.Errorf(\"missing prompt templates\")\n\t}\n\n\treturn nil\n}\n"}, "8ffb414026429b02fa15ea498a25cbdcb7fcfa5c": {"t": 1785759814.7385292, "n": 9588, "h": "bf7b6c10addbdb3b", "c": "package conf\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/carv-protocol/d.a.t.a/src/pkg/logger\"\n\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/viper\"\n)\n\nconst (\n\tTwitterModeAPI TwitterMode = \"api\"\n\tTwitterModeScraper TwitterMode = \"scraper\"\n\n\tThoughtStepTypeTask ThoughtStepType = \"task\"\n\tThoughtStepTypeAction ThoughtStepType = \"action\"\n\n\tDatabasePostgres DatabaseType = \"postgres\"\n\tDatabaseSqlite DatabaseType = \"sqlite\"\n)\n\nvar (\n\tErrInvalidLLMConfig = errors.New(\"invalid LLM configuration\")\n\tErrInvalidDBConfig = errors.New(\"invalid database configuration\")\n)\n\ntype (\n\tTwitterMode string\n\tThoughtStepType string\n\tDatabaseType string\n)\n\ntype LLMConfig struct {\n\tProvider string `mapstructure:\"provider\"`\n\tAPIKey string `mapstructure:\"api_key\"`\n\tBaseURL string `mapstructure:\"base_url\"`\n\tModel string `mapstructure:\"model\"`\n}\n\ntype CarvConfig struct {\n\tAPIKey string `mapstructure:\"api_key\"`\n\tBaseURL string `mapstructure:\"base_url\"`\n}\n\ntype TwitterConfig struct {\n\tMode TwitterMode `mapstructure:\"mode\"` // Mode of operation: \"api\" or \"scraper\"\n\tUsername string `mapstructure:\"username\"` // Twitter username\n\tPassword string `mapstructure:\"password\"` // Twitter password\n\tAPIKey string `mapstructure:\"api_key\"`\n\tAPIKeySecret string `mapstructure:\"api_key_secret\"`\n\tAccessToken string `mapstructure:\"access_token\"`\n\tTokenSecret string `mapstructure:\"token_secret\"`\n\tMonitorWindow int `mapstructure:\"monitor_window\"` // Duration in minutes, e.g. 20\n}\n\ntype DiscordConfig struct {\n\tAPIToken string `mapstructure:\"api_token\"`\n}\n\ntype TelegramConfig struct {\n\tToken string `mapstructure:\"bot_token\"` // Bot token from BotFather\n\tChannelID int64 `mapstructure:\"channel_id\"` // Default channel ID for broadcasts\n\tDebug bool `mapstructure:\"debug\"` // Enable debug mode\n}\n\ntype PromptTemplates struct {\n\tSystem struct {\n\t\tBaseTemplate string `mapstructure:\"base_template\"`\n\t\tInfoFormat map[string]string `mapstructure:\"info_format\"`\n\t} `mapstructure:\"system\"`\n\n\tMessage struct {\n\t\tAnalysis string `mapstructure:\"analysis\"`\n\t\tAction string `mapstructure:\"action\"`\n\t} `mapstructure:\"message\"`\n\n\tThoughtSteps map[ThoughtStepType]struct {\n\t\tInitial string `mapstructure:\"initial\"`\n\t\tExploration string `mapstructure:\"exploration\"`\n\t\tAnalysis string `mapstructure:\"analysis\"`\n\t\tReconsider string `mapstructure:\"reconsider\"`\n\t\tRefinement string `mapstructure:\"refinement\"`\n\t\tConcrete string `mapstructure:\"concrete\"`\n\t} `mapstructure:\"thought_steps\"`\n}\n\ntype PluginConfig struct {\n\tName string `mapstructure:\"name\"`\n\tEnabled bool `mapstructure:\"enabled\"`\n\tVersion string `mapstructure:\"version\"`\n\tAuthor string `mapstructure:\"author\"`\n\tDescription string `mapstructure:\"description\"`\n\tDependencies []string `mapstructure:\"dependencies\"`\n\tOptions map[string]interface{} `mapstructure:\"options\"`\n}\n\ntype Character struct {\n\tName string `mapstructure:\"name\"`\n\tPath string `mapstructure:\"path\"`\n}\n\ntype Config struct {\n\tSettings struct {\n\t\tShutdownTimeout int `mapstructure:\"shutdown_timeout\"`\n\t} `mapstructure:\"settings\"`\n\n\tCharacter `mapstructure:\"character\"`\n\n\tDatabase struct {\n\t\tType DatabaseType `mapstructure:\"type\"`\n\t\tPath string `mapstructure:\"path\"`\n\t} `mapstructure:\"database\"`\n\n\tLLMConfig `mapstructure:\"llm_config\"`\n\n\tData struct {\n\t\tCarvConfig `mapstructure:\"carv\"`\n\t} `mapstructure:\"data\"`\n\n\tSocial struct {\n\t\tTwitterConfig `mapstructure:\"twitter\"`\n\t\tDiscordConfig `mapstructure:\"discord\"`\n\t\tTelegramConfig `mapstructure:\"telegram\"`\n\t} `mapstructure:\"social\"`\n\n\tToken struct {\n\t\tNetwork string `mapstructure:\"network\"`\n\t\tTicker string `mapstructure:\"ticker\"`\n\t\tContractAddr string `mapstructure:\"contract_addr\"`\n\t} `mapstructure:\"token\"`\n\n\tWeb struct {\n\t\tPort int `mapstructure:\"port\"`\n\t} `mapstructure:\"web\"`\n\n\tUserTemplates *PromptTemplates `mapstructure:\"user_templates\"`\n\tDefaultTemplates *PromptTemplates `mapstructure:\"default_templates\"`\n\n\tPlugins map[string]PluginConfig `mapstructure:\"plugins\"`\n}\n\n// LoadConfig loads and validates the application configuration\nfunc LoadConfig(confPath string) (*Config, error) {\n\tsetDefaultConfig()\n\n\tif err := loadYamlConfig(confPath); err != nil {\n\t\treturn nil, fmt.Errorf(\"error load yaml config: %w\", err)\n\t}\n\n\tif err := loadEnvConfig(confPath); err != nil {\n\t\treturn nil, fmt.Errorf(\"error load env config: %w\", err)\n\t}\n\n\tfillDefaultOptions()\n\n\tvar conf Config\n\tif err := viper.Unmarshal(&conf); err != nil {\n\t\treturn nil, fmt.Errorf(\"error unmarshaling config: %w\", err)\n\t}\n\n\t// Validate config\n\tif err := validateConfig(&conf, confPath); err != nil {\n\t\treturn nil, fmt.Errorf(\"config validation failed: %w\", err)\n\t}\n\n\treturn &conf, nil\n}\n\nfunc loadYamlConfig(confPath string) error {\n\tviper.SetConfigName(\"config\")\n\tviper.SetConfigType(\"yaml\")\n\tviper.AddConfigPath(confPath)\n\n\t// Load main config\n\tif err := viper.ReadInConfig(); err != nil {\n\t\tif !errors.As(err, &viper.ConfigFileNotFoundError{}) {\n\t\t\treturn fmt.Errorf(\"error reading config file: %w\", err)\n\t\t}\n\t\tlogger.GetLogger().Infoln(\"No config file found, using defaults\")\n\t} else {\n\t\tlogger.GetLogger().Infof(\"Loaded config from file: %s\", viper.ConfigFileUsed())\n\t}\n\n\treturn nil\n}\n\nfunc loadEnvConfig(confPath string) error {\n\tviper.SetConfigName(\".env\")\n\tviper.SetConfigType(\"env\")\n\tviper.AddConfigPath(confPath)\n\n\tif err := viper.MergeInConfig(); err != nil {\n\t\tif errors.As(err, &viper.ConfigFileNotFoundError{}) {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"error reading .env: %w\", err)\n\t}\n\n\t// Map environment variables to config\n\tenvMappings := map[string]string{\n\t\t\"LLM_PROVIDER\": \"llm_config.provider\",\n\t\t\"LLM_API_KEY\": \"llm_config.api_key\",\n\t\t\"TWITTER_BEARER_TOKEN\": \"social.twitter.bearer_token\",\n\t\t\"TWITTER_API_KEY\": \"social.twitter.api_key\",\n\t\t\"TWITTER_API_KEY_SECRET\": \"social.twitter.api_key_secret\",\n\t\t\"TWITTER_ACCESS_TOKEN\": \"social.twitter.access_token\",\n\t\t\"TWITTER_TOKEN_SECRET\": \"social.twitter.token_secret\",\n\t\t\"TWITTER_MONITOR_WINDOW\": \"social.twitter.monitor_window\",\n\t\t\"DISCORD_API_TOKEN\": \"social.discord.api_token\",\n\t\t\"TELEGRAM_BOT_TOKEN\": \"social.telegram.bot_token\",\n\t\t\"CARV_DATA_BASE_URL\": \"data.carv.base_url\",\n\t\t\"CARV_DATA_API_KEY\": \"data.carv.api_key\",\n\t\t\"WALLET_PRIVATE_KEY\": \"wallet.private_key\",\n\t}\n\n\t// override config values with environment variables\n\tfor env, conf := range envMappings {\n\t\tviper.Set(conf, viper.Get(env))\n\t}\n\n\treturn nil\n}\n\nfunc setDefaultConfig() {\n\tviper.SetDefault(\"database.type\", \"sqlite\")\n\tviper.SetDefault(\"database.path\", \"./data/data.db\")\n\tviper.SetDefault(\"llm_config.provider\", \"openai\")\n\tviper.SetDefault(\"llm_config.base_url\", \"https://api.openai.com/v1\")\n\tviper.SetDefault(\"llm_config.model\", \"gpt-4o\") // Default model for OpenAI\n\tviper.SetDefault(\"shutdown_timeout\", 30) // shutdown timeout in seconds\n\tviper.SetDefault(\"plugin.plugins\", map[string]PluginConfig{}) // Default empty plugins map\n}\n\nfunc fillDefaultOptions() {\n\tswitch viper.GetString(\"llm_config.provider\") {\n\tcase \"deepseek\":\n\t\tif !viper.IsSet(\"llm_config.base_url\") {\n\t\t\tviper.Set(\"llm_config.base_url\", \"https://api.deepseek.com\")\n\t\t}\n\t\tif !viper.IsSet(\"llm_config.model\") {\n\t\t\tviper.Set(\"llm_config.model\", \"deepseek-chat\")\n\t\t}\n\tcase \"openai\":\n\t\tif !viper.IsSet(\"llm_config.base_url\") {\n\t\t\tviper.Set(\"llm_config.base_url\", \"https://api.openai.com/v1\")\n\t\t}\n\t\tif !viper.IsSet(\"llm_config.model\") {\n\t\t\tviper.Set(\"llm_config.model\", \"gpt-3.5-turbo\")\n\t\t}\n\t}\n\n\t// Special handling for Telegram channel ID\n\tif channelID := viper.GetString(\"TELEGRAM_CHANNEL_ID\"); channelID != \"\" {\n\t\tviper.Set(\"social.telegram.channel_id\", strings.Trim(channelID, \"${}\"))\n\t}\n}\n\n// loadDefaultTemplates loads templates from default_templates.yaml\nfunc loadDefaultTemplates(configPath string) (*PromptTemplates, error) {\n\tdefaultViper := viper.New()\n\tdefaultViper.SetConfigName(\"default_templates\")\n\tdefaultViper.SetConfigType(\"yaml\")\n\tdefaultViper.AddConfigPath(configPath)\n\n\tif err := defaultViper.ReadInConfig(); err != nil {\n\t\treturn nil, fmt.Errorf(\"error reading default templates: %w\", err)\n\t}\n\n\tvar defaultTemplates PromptTemplates\n\tif err := defaultViper.UnmarshalKey(\"default_templates\", &defaultTemplates); err != nil {\n\t\treturn nil, fmt.Errorf(\"error unmarshaling default templates: %w\", err)\n\t}\n\n\treturn &defaultTemplates, nil\n}\n\nfunc validateConfig(conf *Config, confPath string) error {\n\t// Check if user templates are defined, if not load default templates\n\tif conf.UserTemplates == nil {\n\t\tlogger.GetLogger().Infoln(\"User templates not defined, loading default templates\")\n\t\tdefaultTemplates, err := loadDefaultTemplates(confPath)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to load default templates: %w\", err)\n\t\t}\n\t\tconf.DefaultTemplates = defaultTemplates\n\t\tconf.UserTemplates = conf.DefaultTemplates\n\t} else {\n\t\tlogger.GetLogger().Infoln(\"Using user-defined templates\")\n\t}\n\n\tif conf.LLMConfig.APIKey == \"\" {\n\t\treturn fmt.Errorf(\"%w: missing API key\", ErrInvalidLLMConfig)\n\t}\n\tif conf.LLMConfig.Provider == \"\" {\n\t\treturn fmt.Errorf(\"%w: missing provider\", ErrInvalidLLMConfig)\n\t}\n\tif conf.LLMConfig.Model == \"\" {\n\t\treturn fmt.Errorf(\"%w: missing model\", ErrInvalidLLMConfig)\n\t}\n\tif conf.Database.Path == \"\" {\n\t\treturn ErrInvalidDBConfig\n\t}\n\tif conf.DefaultTemplates == nil && conf.UserTemplates == nil {\n\t\treturn fmt.Errorf(\"missing prompt templates\")\n\t}\n\n\treturn nil\n}\n"}, "8c3755398331aae9a4cdd4f27762072b29579d90": {"t": 1785759816.2430093, "n": 9539, "h": "66e15bf2a999d94f", "c": "package conf\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/carv-protocol/d.a.t.a/src/pkg/logger\"\n\t\"github.com/pkg/errors\"\n\n\t\"github.com/spf13/viper\"\n)\n\nconst (\n\tTwitterModeAPI TwitterMode = \"api\"\n\tTwitterModeScraper TwitterMode = \"scraper\"\n\n\tThoughtStepTypeTask ThoughtStepType = \"task\"\n\tThoughtStepTypeAction ThoughtStepType = \"action\"\n\n\tDatabasePostgres DatabaseType = \"postgres\"\n\tDatabaseSqlite DatabaseType = \"sqlite\"\n)\n\nvar (\n\tErrInvalidLLMConfig = errors.New(\"invalid LLM configuration\")\n\tErrInvalidDBConfig = errors.New(\"invalid database configuration\")\n)\n\ntype (\n\tTwitterMode string\n\tThoughtStepType string\n\tDatabaseType string\n)\n\ntype LLMConfig struct {\n\tProvider string `mapstructure:\"provider\"`\n\tAPIKey string `mapstructure:\"api_key\"`\n\tBaseURL string `mapstructure:\"base_url\"`\n\tModel string `mapstructure:\"model\"`\n}\n\ntype CarvConfig struct {\n\tAPIKey string `mapstructure:\"api_key\"`\n\tBaseURL string `mapstructure:\"base_url\"`\n}\n\ntype TwitterConfig struct {\n\tMode TwitterMode `mapstructure:\"mode\"` // Mode of operation: \"api\" or \"scraper\"\n\tUsername string `mapstructure:\"username\"` // Twitter username\n\tPassword string `mapstructure:\"password\"` // Twitter password\n\tAPIKey string `mapstructure:\"api_key\"`\n\tAPIKeySecret string `mapstructure:\"api_key_secret\"`\n\tAccessToken string `mapstructure:\"access_token\"`\n\tTokenSecret string `mapstructure:\"token_secret\"`\n\tMonitorWindow int `mapstructure:\"monitor_window\"` // Duration in minutes, e.g. 20\n}\n\ntype DiscordConfig struct {\n\tAPIToken string `mapstructure:\"api_token\"`\n}\n\ntype TelegramConfig struct {\n\tToken string `mapstructure:\"bot_token\"` // Bot token from BotFather\n\tChannelID int64 `mapstructure:\"channel_id\"` // Default channel ID for broadcasts\n\tDebug bool `mapstructure:\"debug\"` // Enable debug mode\n}\n\ntype PromptTemplates struct {\n\tSystem struct {\n\t\tBaseTemplate string `mapstructure:\"base_template\"`\n\t\tInfoFormat map[string]string `mapstructure:\"info_format\"`\n\t} `mapstructure:\"system\"`\n\n\tMessage struct {\n\t\tAnalysis string `mapstructure:\"analysis\"`\n\t\tAction string `mapstructure:\"action\"`\n\t} `mapstructure:\"message\"`\n\n\tThoughtSteps map[ThoughtStepType]struct {\n\t\tInitial string `mapstructure:\"initial\"`\n\t\tExploration string `mapstructure:\"exploration\"`\n\t\tAnalysis string `mapstructure:\"analysis\"`\n\t\tReconsider string `mapstructure:\"reconsider\"`\n\t\tRefinement string `mapstructure:\"refinement\"`\n\t\tConcrete string `mapstructure:\"concrete\"`\n\t} `mapstructure:\"thought_steps\"`\n}\n\ntype PluginConfig struct {\n\tName string `mapstructure:\"name\"`\n\tEnabled bool `mapstructure:\"enabled\"`\n\tVersion string `mapstructure:\"version\"`\n\tAuthor string `mapstructure:\"author\"`\n\tDescription string `mapstructure:\"description\"`\n\tDependencies []string `mapstructure:\"dependencies\"`\n\tOptions map[string]interface{} `mapstructure:\"options\"`\n}\n\ntype Config struct {\n\tSettings struct {\n\t\tShutdownTimeout int `mapstructure:\"shutdown_timeout\"`\n\t} `mapstructure:\"settings\"`\n\n\tCharacter struct {\n\t\tPath string `mapstructure:\"path\"`\n\t} `mapstructure:\"character\"`\n\n\tDatabase struct {\n\t\tType DatabaseType `mapstructure:\"type\"`\n\t\tPath string `mapstructure:\"path\"`\n\t} `mapstructure:\"database\"`\n\n\tLLMConfig `mapstructure:\"llm_config\"`\n\n\tData struct {\n\t\tCarvConfig `mapstructure:\"carv\"`\n\t} `mapstructure:\"data\"`\n\n\tSocial struct {\n\t\tTwitterConfig `mapstructure:\"twitter\"`\n\t\tDiscordConfig `mapstructure:\"discord\"`\n\t\tTelegramConfig `mapstructure:\"telegram\"`\n\t} `mapstructure:\"social\"`\n\n\tToken struct {\n\t\tNetwork string `mapstructure:\"network\"`\n\t\tTicker string `mapstructure:\"ticker\"`\n\t\tContractAddr string `mapstructure:\"contract_addr\"`\n\t} `mapstructure:\"token\"`\n\n\tWeb struct {\n\t\tPort int `mapstructure:\"port\"`\n\t} `mapstructure:\"web\"`\n\n\tUserTemplates *PromptTemplates `mapstructure:\"user_templates\"`\n\tDefaultTemplates *PromptTemplates `mapstructure:\"default_templates\"`\n\n\tPlugins map[string]PluginConfig `mapstructure:\"plugins\"`\n}\n\n// LoadConfig loads and validates the application configuration\nfunc LoadConfig(confPath string) (*Config, error) {\n\tsetDefaultConfig()\n\n\tif err := loadYamlConfig(confPath); err != nil {\n\t\treturn nil, fmt.Errorf(\"error load yaml config: %w\", err)\n\t}\n\n\tif err := loadEnvConfig(confPath); err != nil {\n\t\treturn nil, fmt.Errorf(\"error load env config: %w\", err)\n\t}\n\n\tfillDefaultOptions()\n\n\tvar conf Config\n\tif err := viper.Unmarshal(&conf); err != nil {\n\t\treturn nil, fmt.Errorf(\"error unmarshaling config: %w\", err)\n\t}\n\n\t// Validate config\n\tif err := validateConfig(&conf, confPath); err != nil {\n\t\treturn nil, fmt.Errorf(\"config validation failed: %w\", err)\n\t}\n\n\treturn &conf, nil\n}\n\nfunc loadYamlConfig(confPath string) error {\n\tviper.SetConfigName(\"config\")\n\tviper.SetConfigType(\"yaml\")\n\tviper.AddConfigPath(confPath)\n\n\t// Load main config\n\tif err := viper.ReadInConfig(); err != nil {\n\t\tif !errors.As(err, &viper.ConfigFileNotFoundError{}) {\n\t\t\treturn fmt.Errorf(\"error reading config file: %w\", err)\n\t\t}\n\t\tlogger.GetLogger().Infoln(\"No config file found, using defaults\")\n\t} else {\n\t\tlogger.GetLogger().Infof(\"Loaded config from file: %s\", viper.ConfigFileUsed())\n\t}\n\n\treturn nil\n}\n\nfunc loadEnvConfig(confPath string) error {\n\tviper.SetConfigName(\".env\")\n\tviper.SetConfigType(\"env\")\n\tviper.AddConfigPath(confPath)\n\n\tif err := viper.MergeInConfig(); err != nil {\n\t\tif errors.As(err, &viper.ConfigFileNotFoundError{}) {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"error reading .env: %w\", err)\n\t}\n\n\t// Map environment variables to config\n\tenvMappings := map[string]string{\n\t\t\"LLM_PROVIDER\": \"llm_config.provider\",\n\t\t\"LLM_API_KEY\": \"llm_config.api_key\",\n\t\t\"TWITTER_BEARER_TOKEN\": \"social.twitter.bearer_token\",\n\t\t\"TWITTER_API_KEY\": \"social.twitter.api_key\",\n\t\t\"TWITTER_API_KEY_SECRET\": \"social.twitter.api_key_secret\",\n\t\t\"TWITTER_ACCESS_TOKEN\": \"social.twitter.access_token\",\n\t\t\"TWITTER_TOKEN_SECRET\": \"social.twitter.token_secret\",\n\t\t\"TWITTER_MONITOR_WINDOW\": \"social.twitter.monitor_window\",\n\t\t\"DISCORD_API_TOKEN\": \"social.discord.api_token\",\n\t\t\"TELEGRAM_BOT_TOKEN\": \"social.telegram.bot_token\",\n\t\t\"CARV_DATA_BASE_URL\": \"data.carv.base_url\",\n\t\t\"CARV_DATA_API_KEY\": \"data.carv.api_key\",\n\t\t\"WALLET_PRIVATE_KEY\": \"wallet.private_key\",\n\t}\n\n\t// override config values with environment variables\n\tfor env, conf := range envMappings {\n\t\tviper.Set(conf, viper.Get(env))\n\t}\n\n\treturn nil\n}\n\nfunc setDefaultConfig() {\n\tviper.SetDefault(\"database.type\", \"sqlite\")\n\tviper.SetDefault(\"database.path\", \"./data/data.db\")\n\tviper.SetDefault(\"llm_config.provider\", \"openai\")\n\tviper.SetDefault(\"llm_config.base_url\", \"https://api.openai.com/v1\")\n\tviper.SetDefault(\"llm_config.model\", \"gpt-4o\") // Default model for OpenAI\n\tviper.SetDefault(\"shutdown_timeout\", 30) // shutdown timeout in seconds\n\tviper.SetDefault(\"plugin.plugins\", map[string]PluginConfig{}) // Default empty plugins map\n}\n\nfunc fillDefaultOptions() {\n\tswitch viper.GetString(\"llm_config.provider\") {\n\tcase \"deepseek\":\n\t\tif !viper.IsSet(\"llm_config.base_url\") {\n\t\t\tviper.Set(\"llm_config.base_url\", \"https://api.deepseek.com\")\n\t\t}\n\t\tif !viper.IsSet(\"llm_config.model\") {\n\t\t\tviper.Set(\"llm_config.model\", \"deepseek-chat\")\n\t\t}\n\tcase \"openai\":\n\t\tif !viper.IsSet(\"llm_config.base_url\") {\n\t\t\tviper.Set(\"llm_config.base_url\", \"https://api.openai.com/v1\")\n\t\t}\n\t\tif !viper.IsSet(\"llm_config.model\") {\n\t\t\tviper.Set(\"llm_config.model\", \"gpt-3.5-turbo\")\n\t\t}\n\t}\n\n\t// Special handling for Telegram channel ID\n\tif channelID := viper.GetString(\"TELEGRAM_CHANNEL_ID\"); channelID != \"\" {\n\t\tviper.Set(\"social.telegram.channel_id\", strings.Trim(channelID, \"${}\"))\n\t}\n}\n\n// loadDefaultTemplates loads templates from default_templates.yaml\nfunc loadDefaultTemplates(configPath string) (*PromptTemplates, error) {\n\tdefaultViper := viper.New()\n\tdefaultViper.SetConfigName(\"default_templates\")\n\tdefaultViper.SetConfigType(\"yaml\")\n\tdefaultViper.AddConfigPath(configPath)\n\n\tif err := defaultViper.ReadInConfig(); err != nil {\n\t\treturn nil, fmt.Errorf(\"error reading default templates: %w\", err)\n\t}\n\n\tvar defaultTemplates PromptTemplates\n\tif err := defaultViper.UnmarshalKey(\"default_templates\", &defaultTemplates); err != nil {\n\t\treturn nil, fmt.Errorf(\"error unmarshaling default templates: %w\", err)\n\t}\n\n\treturn &defaultTemplates, nil\n}\n\nfunc validateConfig(conf *Config, confPath string) error {\n\t// Check if user templates are defined, if not load default templates\n\tif conf.UserTemplates == nil {\n\t\tlogger.GetLogger().Infoln(\"User templates not defined, loading default templates\")\n\t\tdefaultTemplates, err := loadDefaultTemplates(confPath)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to load default templates: %w\", err)\n\t\t}\n\t\tconf.DefaultTemplates = defaultTemplates\n\t\tconf.UserTemplates = conf.DefaultTemplates\n\t} else {\n\t\tlogger.GetLogger().Infoln(\"Using user-defined templates\")\n\t}\n\n\tif conf.LLMConfig.APIKey == \"\" {\n\t\treturn fmt.Errorf(\"%w: missing API key\", ErrInvalidLLMConfig)\n\t}\n\tif conf.LLMConfig.Provider == \"\" {\n\t\treturn fmt.Errorf(\"%w: missing provider\", ErrInvalidLLMConfig)\n\t}\n\tif conf.LLMConfig.Model == \"\" {\n\t\treturn fmt.Errorf(\"%w: missing model\", ErrInvalidLLMConfig)\n\t}\n\tif conf.Database.Path == \"\" {\n\t\treturn ErrInvalidDBConfig\n\t}\n\tif conf.DefaultTemplates == nil && conf.UserTemplates == nil {\n\t\treturn fmt.Errorf(\"missing prompt templates\")\n\t}\n\n\treturn nil\n}\n"}, "9b1b3825dbca40777d829a944957b1935d464787": {"t": 1785759817.5404289, "n": 9414, "h": "4178f111c2710eb2", "c": "package conf\n\nimport (\n\t\"fmt\"\n\t\"github.com/carv-protocol/d.a.t.a/src/pkg/logger\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/viper\"\n\t\"strings\"\n)\n\nconst (\n\tTwitterModeAPI TwitterMode = \"api\"\n\tTwitterModeScraper TwitterMode = \"scraper\"\n\n\tThoughtStepTypeTask ThoughtStepType = \"task\"\n\tThoughtStepTypeAction ThoughtStepType = \"action\"\n)\n\nvar (\n\tErrInvalidLLMConfig = errors.New(\"invalid LLM configuration\")\n\tErrInvalidDBConfig = errors.New(\"invalid database configuration\")\n)\n\ntype (\n\tTwitterMode string\n\tThoughtStepType string\n)\n\ntype LLMConfig struct {\n\tProvider string `mapstructure:\"provider\"`\n\tAPIKey string `mapstructure:\"api_key\"`\n\tBaseURL string `mapstructure:\"base_url\"`\n\tModel string `mapstructure:\"model\"`\n}\n\ntype CarvConfig struct {\n\tAPIKey string `mapstructure:\"api_key\"`\n\tBaseURL string `mapstructure:\"base_url\"`\n}\n\ntype TwitterConfig struct {\n\tMode TwitterMode `mapstructure:\"mode\"` // Mode of operation: \"api\" or \"scraper\"\n\tUsername string `mapstructure:\"username\"` // Twitter username\n\tPassword string `mapstructure:\"password\"` // Twitter password\n\tAPIKey string `mapstructure:\"api_key\"`\n\tAPIKeySecret string `mapstructure:\"api_key_secret\"`\n\tAccessToken string `mapstructure:\"access_token\"`\n\tTokenSecret string `mapstructure:\"token_secret\"`\n\tMonitorWindow int `mapstructure:\"monitor_window\"` // Duration in minutes, e.g. 20\n}\n\ntype DiscordConfig struct {\n\tAPIToken string `mapstructure:\"api_token\"`\n}\n\ntype TelegramConfig struct {\n\tToken string `mapstructure:\"bot_token\"` // Bot token from BotFather\n\tChannelID int64 `mapstructure:\"channel_id\"` // Default channel ID for broadcasts\n\tDebug bool `mapstructure:\"debug\"` // Enable debug mode\n}\n\ntype PromptTemplates struct {\n\tSystem struct {\n\t\tBaseTemplate string `mapstructure:\"base_template\"`\n\t\tInfoFormat map[string]string `mapstructure:\"info_format\"`\n\t} `mapstructure:\"system\"`\n\n\tMessage struct {\n\t\tAnalysis string `mapstructure:\"analysis\"`\n\t\tAction string `mapstructure:\"action\"`\n\t} `mapstructure:\"message\"`\n\n\tThoughtSteps map[ThoughtStepType]struct {\n\t\tInitial string `mapstructure:\"initial\"`\n\t\tExploration string `mapstructure:\"exploration\"`\n\t\tAnalysis string `mapstructure:\"analysis\"`\n\t\tReconsider string `mapstructure:\"reconsider\"`\n\t\tRefinement string `mapstructure:\"refinement\"`\n\t\tConcrete string `mapstructure:\"concrete\"`\n\t} `mapstructure:\"thought_steps\"`\n}\n\ntype PluginConfig struct {\n\tName string `mapstructure:\"name\"`\n\tEnabled bool `mapstructure:\"enabled\"`\n\tVersion string `mapstructure:\"version\"`\n\tAuthor string `mapstructure:\"author\"`\n\tDescription string `mapstructure:\"description\"`\n\tDependencies []string `mapstructure:\"dependencies\"`\n\tOptions map[string]interface{} `mapstructure:\"options\"`\n}\n\ntype Config struct {\n\tSettings struct {\n\t\tShutdownTimeout int `mapstructure:\"shutdown_timeout\"`\n\t} `mapstructure:\"settings\"`\n\n\tCharacter struct {\n\t\tPath string `mapstructure:\"path\"`\n\t} `mapstructure:\"character\"`\n\n\tDatabase struct {\n\t\tType string `mapstructure:\"type\"`\n\t\tPath string `mapstructure:\"path\"`\n\t} `mapstructure:\"database\"`\n\n\tLLMConfig `mapstructure:\"llm_config\"`\n\n\tData struct {\n\t\tCarvConfig `mapstructure:\"carv\"`\n\t} `mapstructure:\"data\"`\n\n\tSocial struct {\n\t\tTwitterConfig `mapstructure:\"twitter\"`\n\t\tDiscordConfig `mapstructure:\"discord\"`\n\t\tTelegramConfig `mapstructure:\"telegram\"`\n\t} `mapstructure:\"social\"`\n\n\tToken struct {\n\t\tNetwork string `mapstructure:\"network\"`\n\t\tTicker string `mapstructure:\"ticker\"`\n\t\tContractAddr string `mapstructure:\"contract_addr\"`\n\t} `mapstructure:\"token\"`\n\n\tWeb struct {\n\t\tPort int `mapstructure:\"port\"`\n\t} `mapstructure:\"web\"`\n\n\tUserTemplates *PromptTemplates `mapstructure:\"user_templates\"`\n\tDefaultTemplates *PromptTemplates `mapstructure:\"default_templates\"`\n\n\tPlugins map[string]PluginConfig `mapstructure:\"plugins\"`\n}\n\n// LoadConfig loads and validates the application configuration\nfunc LoadConfig(confPath string) (*Config, error) {\n\tsetDefaultConfig()\n\n\tif err := loadYamlConfig(confPath); err != nil {\n\t\treturn nil, fmt.Errorf(\"error load yaml config: %w\", err)\n\t}\n\n\tif err := loadEnvConfig(confPath); err != nil {\n\t\treturn nil, fmt.Errorf(\"error load env config: %w\", err)\n\t}\n\n\tfillDefaultOptions()\n\n\tvar conf Config\n\tif err := viper.Unmarshal(&conf); err != nil {\n\t\treturn nil, fmt.Errorf(\"error unmarshaling config: %w\", err)\n\t}\n\n\t// Validate config\n\tif err := validateConfig(&conf, confPath); err != nil {\n\t\treturn nil, fmt.Errorf(\"config validation failed: %w\", err)\n\t}\n\n\treturn &conf, nil\n}\n\nfunc loadYamlConfig(confPath string) error {\n\tviper.SetConfigName(\"config\")\n\tviper.SetConfigType(\"yaml\")\n\tviper.AddConfigPath(confPath)\n\n\t// Load main config\n\tif err := viper.ReadInConfig(); err != nil {\n\t\tif !errors.As(err, &viper.ConfigFileNotFoundError{}) {\n\t\t\treturn fmt.Errorf(\"error reading config file: %w\", err)\n\t\t}\n\t\tlogger.GetLogger().Infoln(\"No config file found, using defaults\")\n\t} else {\n\t\tlogger.GetLogger().Infof(\"Loaded config from file: %s\", viper.ConfigFileUsed())\n\t}\n\n\treturn nil\n}\n\nfunc loadEnvConfig(confPath string) error {\n\tviper.SetConfigName(\".env\")\n\tviper.SetConfigType(\"env\")\n\tviper.AddConfigPath(confPath)\n\n\tif err := viper.MergeInConfig(); err != nil {\n\t\tif errors.As(err, &viper.ConfigFileNotFoundError{}) {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"error reading .env: %w\", err)\n\t}\n\n\t// Map environment variables to config\n\tenvMappings := map[string]string{\n\t\t\"LLM_PROVIDER\": \"llm_config.provider\",\n\t\t\"LLM_API_KEY\": \"llm_config.api_key\",\n\t\t\"TWITTER_BEARER_TOKEN\": \"social.twitter.bearer_token\",\n\t\t\"TWITTER_API_KEY\": \"social.twitter.api_key\",\n\t\t\"TWITTER_API_KEY_SECRET\": \"social.twitter.api_key_secret\",\n\t\t\"TWITTER_ACCESS_TOKEN\": \"social.twitter.access_token\",\n\t\t\"TWITTER_TOKEN_SECRET\": \"social.twitter.token_secret\",\n\t\t\"TWITTER_MONITOR_WINDOW\": \"social.twitter.monitor_window\",\n\t\t\"DISCORD_API_TOKEN\": \"social.discord.api_token\",\n\t\t\"TELEGRAM_BOT_TOKEN\": \"social.telegram.bot_token\",\n\t\t\"CARV_DATA_BASE_URL\": \"data.carv.base_url\",\n\t\t\"CARV_DATA_API_KEY\": \"data.carv.api_key\",\n\t\t\"WALLET_PRIVATE_KEY\": \"wallet.private_key\",\n\t}\n\n\t// override config values with environment variables\n\tfor env, conf := range envMappings {\n\t\tviper.Set(conf, viper.Get(env))\n\t}\n\n\treturn nil\n}\n\nfunc setDefaultConfig() {\n\tviper.SetDefault(\"database.type\", \"sqlite\")\n\tviper.SetDefault(\"database.path\", \"./data/data.db\")\n\tviper.SetDefault(\"llm_config.provider\", \"openai\")\n\tviper.SetDefault(\"llm_config.base_url\", \"https://api.openai.com/v1\")\n\tviper.SetDefault(\"llm_config.model\", \"gpt-4o\") // Default model for OpenAI\n\tviper.SetDefault(\"shutdown_timeout\", 30) // shutdown timeout in seconds\n\tviper.SetDefault(\"plugin.plugins\", map[string]PluginConfig{}) // Default empty plugins map\n}\n\nfunc fillDefaultOptions() {\n\tswitch viper.GetString(\"llm_config.provider\") {\n\tcase \"deepseek\":\n\t\tif !viper.IsSet(\"llm_config.base_url\") {\n\t\t\tviper.Set(\"llm_config.base_url\", \"https://api.deepseek.com\")\n\t\t}\n\t\tif !viper.IsSet(\"llm_config.model\") {\n\t\t\tviper.Set(\"llm_config.model\", \"deepseek-chat\")\n\t\t}\n\tcase \"openai\":\n\t\tif !viper.IsSet(\"llm_config.base_url\") {\n\t\t\tviper.Set(\"llm_config.base_url\", \"https://api.openai.com/v1\")\n\t\t}\n\t\tif !viper.IsSet(\"llm_config.model\") {\n\t\t\tviper.Set(\"llm_config.model\", \"gpt-3.5-turbo\")\n\t\t}\n\t}\n\n\t// Special handling for Telegram channel ID\n\tif channelID := viper.GetString(\"TELEGRAM_CHANNEL_ID\"); channelID != \"\" {\n\t\tviper.Set(\"social.telegram.channel_id\", strings.Trim(channelID, \"${}\"))\n\t}\n}\n\n// loadDefaultTemplates loads templates from default_templates.yaml\nfunc loadDefaultTemplates(configPath string) (*PromptTemplates, error) {\n\tdefaultViper := viper.New()\n\tdefaultViper.SetConfigName(\"default_templates\")\n\tdefaultViper.SetConfigType(\"yaml\")\n\tdefaultViper.AddConfigPath(configPath)\n\n\tif err := defaultViper.ReadInConfig(); err != nil {\n\t\treturn nil, fmt.Errorf(\"error reading default templates: %w\", err)\n\t}\n\n\tvar defaultTemplates PromptTemplates\n\tif err := defaultViper.UnmarshalKey(\"default_templates\", &defaultTemplates); err != nil {\n\t\treturn nil, fmt.Errorf(\"error unmarshaling default templates: %w\", err)\n\t}\n\n\treturn &defaultTemplates, nil\n}\n\nfunc validateConfig(conf *Config, confPath string) error {\n\t// Check if user templates are defined, if not load default templates\n\tif conf.UserTemplates == nil {\n\t\tlogger.GetLogger().Infoln(\"User templates not defined, loading default templates\")\n\t\tdefaultTemplates, err := loadDefaultTemplates(confPath)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to load default templates: %w\", err)\n\t\t}\n\t\tconf.DefaultTemplates = defaultTemplates\n\t\tconf.UserTemplates = conf.DefaultTemplates\n\t} else {\n\t\tlogger.GetLogger().Infoln(\"Using user-defined templates\")\n\t}\n\n\tif conf.LLMConfig.APIKey == \"\" {\n\t\treturn fmt.Errorf(\"%w: missing API key\", ErrInvalidLLMConfig)\n\t}\n\tif conf.LLMConfig.Provider == \"\" {\n\t\treturn fmt.Errorf(\"%w: missing provider\", ErrInvalidLLMConfig)\n\t}\n\tif conf.LLMConfig.Model == \"\" {\n\t\treturn fmt.Errorf(\"%w: missing model\", ErrInvalidLLMConfig)\n\t}\n\tif conf.Database.Path == \"\" {\n\t\treturn ErrInvalidDBConfig\n\t}\n\tif conf.DefaultTemplates == nil && conf.UserTemplates == nil {\n\t\treturn fmt.Errorf(\"missing prompt templates\")\n\t}\n\n\treturn nil\n}\n"}, "88e591a799604688cf968d7152b20a5a8ec183d3": {"t": 1785759818.9490783, "n": 9311, "h": "522c3a1bc62b309f", "c": "package conf\n\nimport (\n\t\"fmt\"\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/viper\"\n\t\"log\"\n\t\"strings\"\n)\n\nconst (\n\tTwitterModeAPI TwitterMode = \"api\"\n\tTwitterModeScraper TwitterMode = \"scraper\"\n\n\tThoughtStepTypeTask ThoughtStepType = \"task\"\n\tThoughtStepTypeAction ThoughtStepType = \"action\"\n)\n\nvar (\n\tErrInvalidLLMConfig = errors.New(\"invalid LLM configuration\")\n\tErrInvalidDBConfig = errors.New(\"invalid database configuration\")\n)\n\ntype (\n\tTwitterMode string\n\tThoughtStepType string\n)\n\ntype LLMConfig struct {\n\tProvider string `mapstructure:\"provider\"`\n\tAPIKey string `mapstructure:\"api_key\"`\n\tBaseURL string `mapstructure:\"base_url\"`\n\tModel string `mapstructure:\"model\"`\n}\n\ntype CarvConfig struct {\n\tAPIKey string `mapstructure:\"api_key\"`\n\tBaseURL string `mapstructure:\"base_url\"`\n}\n\ntype TwitterConfig struct {\n\tMode TwitterMode `mapstructure:\"mode\"` // Mode of operation: \"api\" or \"scraper\"\n\tUsername string `mapstructure:\"username\"` // Twitter username\n\tPassword string `mapstructure:\"password\"` // Twitter password\n\tAPIKey string `mapstructure:\"api_key\"`\n\tAPIKeySecret string `mapstructure:\"api_key_secret\"`\n\tAccessToken string `mapstructure:\"access_token\"`\n\tTokenSecret string `mapstructure:\"token_secret\"`\n\tMonitorWindow int `mapstructure:\"monitor_window\"` // Duration in minutes, e.g. 20\n}\n\ntype DiscordConfig struct {\n\tAPIToken string `mapstructure:\"api_token\"`\n}\n\ntype TelegramConfig struct {\n\tToken string `mapstructure:\"bot_token\"` // Bot token from BotFather\n\tChannelID int64 `mapstructure:\"channel_id\"` // Default channel ID for broadcasts\n\tDebug bool `mapstructure:\"debug\"` // Enable debug mode\n}\n\ntype PromptTemplates struct {\n\tSystem struct {\n\t\tBaseTemplate string `mapstructure:\"base_template\"`\n\t\tInfoFormat map[string]string `mapstructure:\"info_format\"`\n\t} `mapstructure:\"system\"`\n\n\tMessage struct {\n\t\tAnalysis string `mapstructure:\"analysis\"`\n\t\tAction string `mapstructure:\"action\"`\n\t} `mapstructure:\"message\"`\n\n\tThoughtSteps map[ThoughtStepType]struct {\n\t\tInitial string `mapstructure:\"initial\"`\n\t\tExploration string `mapstructure:\"exploration\"`\n\t\tAnalysis string `mapstructure:\"analysis\"`\n\t\tReconsider string `mapstructure:\"reconsider\"`\n\t\tRefinement string `mapstructure:\"refinement\"`\n\t\tConcrete string `mapstructure:\"concrete\"`\n\t} `mapstructure:\"thought_steps\"`\n}\n\ntype PluginConfig struct {\n\tName string `mapstructure:\"name\"`\n\tEnabled bool `mapstructure:\"enabled\"`\n\tVersion string `mapstructure:\"version\"`\n\tAuthor string `mapstructure:\"author\"`\n\tDescription string `mapstructure:\"description\"`\n\tDependencies []string `mapstructure:\"dependencies\"`\n\tOptions map[string]interface{} `mapstructure:\"options\"`\n}\n\ntype Config struct {\n\tSettings struct {\n\t\tShutdownTimeout int `mapstructure:\"shutdown_timeout\"`\n\t} `mapstructure:\"settings\"`\n\n\tCharacter struct {\n\t\tPath string `mapstructure:\"path\"`\n\t} `mapstructure:\"character\"`\n\n\tDatabase struct {\n\t\tType string `mapstructure:\"type\"`\n\t\tPath string `mapstructure:\"path\"`\n\t} `mapstructure:\"database\"`\n\n\tLLMConfig `mapstructure:\"llm_config\"`\n\n\tData struct {\n\t\tCarvConfig `mapstructure:\"carv\"`\n\t} `mapstructure:\"data\"`\n\n\tSocial struct {\n\t\tTwitterConfig `mapstructure:\"twitter\"`\n\t\tDiscordConfig `mapstructure:\"discord\"`\n\t\tTelegramConfig `mapstructure:\"telegram\"`\n\t} `mapstructure:\"social\"`\n\n\tToken struct {\n\t\tNetwork string `mapstructure:\"network\"`\n\t\tTicker string `mapstructure:\"ticker\"`\n\t\tContractAddr string `mapstructure:\"contract_addr\"`\n\t} `mapstructure:\"token\"`\n\n\tWeb struct {\n\t\tPort int `mapstructure:\"port\"`\n\t} `mapstructure:\"web\"`\n\n\tUserTemplates *PromptTemplates `mapstructure:\"user_templates\"`\n\tDefaultTemplates *PromptTemplates `mapstructure:\"default_templates\"`\n\n\tPlugins map[string]PluginConfig `mapstructure:\"plugins\"`\n}\n\n// LoadConfig loads and validates the application configuration\nfunc LoadConfig(confPath string) (*Config, error) {\n\tsetDefaultConfig()\n\n\tif err := loadYamlConfig(confPath); err != nil {\n\t\treturn nil, fmt.Errorf(\"error load yaml config: %w\", err)\n\t}\n\n\tif err := loadEnvConfig(confPath); err != nil {\n\t\treturn nil, fmt.Errorf(\"error load env config: %w\", err)\n\t}\n\n\tfillDefaultOptions()\n\n\tvar conf Config\n\tif err := viper.Unmarshal(&conf); err != nil {\n\t\treturn nil, fmt.Errorf(\"error unmarshaling config: %w\", err)\n\t}\n\n\t// Validate config\n\tif err := validateConfig(&conf, confPath); err != nil {\n\t\treturn nil, fmt.Errorf(\"config validation failed: %w\", err)\n\t}\n\n\treturn &conf, nil\n}\n\nfunc loadYamlConfig(confPath string) error {\n\tviper.SetConfigName(\"config\")\n\tviper.SetConfigType(\"yaml\")\n\tviper.AddConfigPath(confPath)\n\n\t// Load main config\n\tif err := viper.ReadInConfig(); err != nil {\n\t\tif !errors.As(err, &viper.ConfigFileNotFoundError{}) {\n\t\t\treturn fmt.Errorf(\"error reading config file: %w\", err)\n\t\t}\n\t\tlog.Printf(\"No config file found, using defaults\")\n\t} else {\n\t\tlog.Printf(\"Loaded config from file: %s\", viper.ConfigFileUsed())\n\t}\n\n\treturn nil\n}\n\nfunc loadEnvConfig(confPath string) error {\n\tviper.SetConfigName(\".env\")\n\tviper.SetConfigType(\"env\")\n\tviper.AddConfigPath(confPath)\n\n\tif err := viper.MergeInConfig(); err != nil {\n\t\tif errors.As(err, &viper.ConfigFileNotFoundError{}) {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"error reading .env: %w\", err)\n\t}\n\n\t// Map environment variables to config\n\tenvMappings := map[string]string{\n\t\t\"LLM_PROVIDER\": \"llm_config.provider\",\n\t\t\"LLM_API_KEY\": \"llm_config.api_key\",\n\t\t\"TWITTER_BEARER_TOKEN\": \"social.twitter.bearer_token\",\n\t\t\"TWITTER_API_KEY\": \"social.twitter.api_key\",\n\t\t\"TWITTER_API_KEY_SECRET\": \"social.twitter.api_key_secret\",\n\t\t\"TWITTER_ACCESS_TOKEN\": \"social.twitter.access_token\",\n\t\t\"TWITTER_TOKEN_SECRET\": \"social.twitter.token_secret\",\n\t\t\"TWITTER_MONITOR_WINDOW\": \"social.twitter.monitor_window\",\n\t\t\"DISCORD_API_TOKEN\": \"social.discord.api_token\",\n\t\t\"TELEGRAM_BOT_TOKEN\": \"social.telegram.bot_token\",\n\t\t\"CARV_DATA_BASE_URL\": \"data.carv.base_url\",\n\t\t\"CARV_DATA_API_KEY\": \"data.carv.api_key\",\n\t\t\"WALLET_PRIVATE_KEY\": \"wallet.private_key\",\n\t}\n\n\t// override config values with environment variables\n\tfor env, conf := range envMappings {\n\t\tviper.Set(conf, viper.Get(env))\n\t}\n\n\treturn nil\n}\n\nfunc setDefaultConfig() {\n\tviper.SetDefault(\"database.type\", \"sqlite\")\n\tviper.SetDefault(\"database.path\", \"./data/data.db\")\n\tviper.SetDefault(\"llm_config.provider\", \"openai\")\n\tviper.SetDefault(\"llm_config.base_url\", \"https://api.openai.com/v1\")\n\tviper.SetDefault(\"llm_config.model\", \"gpt-4o\") // Default model for OpenAI\n\tviper.SetDefault(\"shutdown_timeout\", 30) // shutdown timeout in seconds\n\tviper.SetDefault(\"plugin.plugins\", map[string]PluginConfig{}) // Default empty plugins map\n}\n\nfunc fillDefaultOptions() {\n\tswitch viper.GetString(\"llm_config.provider\") {\n\tcase \"deepseek\":\n\t\tif !viper.IsSet(\"llm_config.base_url\") {\n\t\t\tviper.Set(\"llm_config.base_url\", \"https://api.deepseek.com\")\n\t\t}\n\t\tif !viper.IsSet(\"llm_config.model\") {\n\t\t\tviper.Set(\"llm_config.model\", \"deepseek-chat\")\n\t\t}\n\tcase \"openai\":\n\t\tif !viper.IsSet(\"llm_config.base_url\") {\n\t\t\tviper.Set(\"llm_config.base_url\", \"https://api.openai.com/v1\")\n\t\t}\n\t\tif !viper.IsSet(\"llm_config.model\") {\n\t\t\tviper.Set(\"llm_config.model\", \"gpt-3.5-turbo\")\n\t\t}\n\t}\n\n\t// Special handling for Telegram channel ID\n\tif channelID := viper.GetString(\"TELEGRAM_CHANNEL_ID\"); channelID != \"\" {\n\t\tviper.Set(\"social.telegram.channel_id\", strings.Trim(channelID, \"${}\"))\n\t}\n}\n\n// loadDefaultTemplates loads templates from default_templates.yaml\nfunc loadDefaultTemplates(configPath string) (*PromptTemplates, error) {\n\tdefaultViper := viper.New()\n\tdefaultViper.SetConfigName(\"default_templates\")\n\tdefaultViper.SetConfigType(\"yaml\")\n\tdefaultViper.AddConfigPath(configPath)\n\n\tif err := defaultViper.ReadInConfig(); err != nil {\n\t\treturn nil, fmt.Errorf(\"error reading default templates: %w\", err)\n\t}\n\n\tvar defaultTemplates PromptTemplates\n\tif err := defaultViper.UnmarshalKey(\"default_templates\", &defaultTemplates); err != nil {\n\t\treturn nil, fmt.Errorf(\"error unmarshaling default templates: %w\", err)\n\t}\n\n\treturn &defaultTemplates, nil\n}\n\nfunc validateConfig(conf *Config, confPath string) error {\n\t// Check if user templates are defined, if not load default templates\n\tif conf.UserTemplates == nil {\n\t\tlog.Printf(\"User templates not defined, loading default templates\")\n\t\tdefaultTemplates, err := loadDefaultTemplates(confPath)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to load default templates: %w\", err)\n\t\t}\n\t\tconf.DefaultTemplates = defaultTemplates\n\t\tconf.UserTemplates = conf.DefaultTemplates\n\t} else {\n\t\tlog.Printf(\"Using user-defined templates\")\n\t}\n\n\tif conf.LLMConfig.APIKey == \"\" {\n\t\treturn fmt.Errorf(\"%w: missing API key\", ErrInvalidLLMConfig)\n\t}\n\tif conf.LLMConfig.Provider == \"\" {\n\t\treturn fmt.Errorf(\"%w: missing provider\", ErrInvalidLLMConfig)\n\t}\n\tif conf.LLMConfig.Model == \"\" {\n\t\treturn fmt.Errorf(\"%w: missing model\", ErrInvalidLLMConfig)\n\t}\n\tif conf.Database.Path == \"\" {\n\t\treturn ErrInvalidDBConfig\n\t}\n\tif conf.DefaultTemplates == nil && conf.UserTemplates == nil {\n\t\treturn fmt.Errorf(\"missing prompt templates\")\n\t}\n\n\treturn nil\n}\n"}}, "src/config/config.yaml": {"e41b2a98b5f5d6d5ba56ef7e19d9cad33ac2932a": {"t": 1785746304.477995, "n": 1904, "h": "f994ef3695755fe0", "c": "character:\n # Path to character configuration file\n path: \"./src/config/character_data_agent.json\"\n name: \"Love Oracle\"\n\ndatabase:\n # Database type: \"sqlite\" or \"postgres\"\n type: \"sqlite\"\n # Database path (for SQLite) or connection string (for Postgres)\n path: \"./data/agent.db\"\n\nllm_config:\n # LLM provider: \"openai\", \"deepseek\", etc.\n provider: \"openai\"\n # API key for the LLM provider\n api_key: \"\"\n # Base URL for API calls\n base_url: \"https://api.deepseek.com\"\n # Model name\n model: \"deepseek-chat\"\n\ndata:\n carvid:\n # CarvID API endpoint\n url: \"https://api.carv.io/v1\"\n # API key for CarvID\n api_key: \"your-carvid-api-key-here\"\n\n\ntoken:\n network: \"base\"\n ticker: \"carv\"\n contract_addr: \"0xc08cd26474722ce93f4d0c34d16201461c10aa8c\"\n\nsocial:\n twitter:\n mode: \"\"\n username: \"\"\n password: \"\"\n api_key: \"\"\n api_key_secret: \"\"\n access_token: \"\"\n token_secret: \"\"\n monitor_window: 0\n discord:\n api_token: \"\"\n telegram:\n bot_token: \"\"\n channel_id: 0\n debug: false\n\nweb:\n port: 8000\n\nplugins:\n d.a.t.a:\n name: \"d.a.t.a\"\n enabled: true\n version: \"1.0.0\"\n author: \"CARV Protocol\"\n description: \"Core data interaction plugin for Ethereum blockchain analysis\"\n dependencies: []\n options:\n api_url: \"your-api-url-here\"\n auth_token: \"your-auth-token-here\"\n chain: \"ethereum-mainnet\"\n llm:\n model: \"deepseek-chat\"\n max_tokens: 2000\n temperature: 0.7\n\n wallet:\n name: \"evm-wallet\"\n enabled: false\n version: \"1.0.0\"\n author: \"CARV Protocol\"\n description: \"Wallet plugin for EVM blockchain\"\n dependencies: []\n options:\n # Private key for the wallet\n private_key: \"your-private-key-here\"\n # Network: \"base\" or \"ethereum\"\n network: \"base-mainnet\"\n # RPC URL\n rpc_url: \"https://base.llamarpc.com\"\n chain_id: 8453\n timeout: 30s"}, "8ffb414026429b02fa15ea498a25cbdcb7fcfa5c": {"t": 1785759813.5851722, "n": 1904, "h": "f994ef3695755fe0", "c": "character:\n # Path to character configuration file\n path: \"./src/config/character_data_agent.json\"\n name: \"Love Oracle\"\n\ndatabase:\n # Database type: \"sqlite\" or \"postgres\"\n type: \"sqlite\"\n # Database path (for SQLite) or connection string (for Postgres)\n path: \"./data/agent.db\"\n\nllm_config:\n # LLM provider: \"openai\", \"deepseek\", etc.\n provider: \"openai\"\n # API key for the LLM provider\n api_key: \"\"\n # Base URL for API calls\n base_url: \"https://api.deepseek.com\"\n # Model name\n model: \"deepseek-chat\"\n\ndata:\n carvid:\n # CarvID API endpoint\n url: \"https://api.carv.io/v1\"\n # API key for CarvID\n api_key: \"your-carvid-api-key-here\"\n\n\ntoken:\n network: \"base\"\n ticker: \"carv\"\n contract_addr: \"0xc08cd26474722ce93f4d0c34d16201461c10aa8c\"\n\nsocial:\n twitter:\n mode: \"\"\n username: \"\"\n password: \"\"\n api_key: \"\"\n api_key_secret: \"\"\n access_token: \"\"\n token_secret: \"\"\n monitor_window: 0\n discord:\n api_token: \"\"\n telegram:\n bot_token: \"\"\n channel_id: 0\n debug: false\n\nweb:\n port: 8000\n\nplugins:\n d.a.t.a:\n name: \"d.a.t.a\"\n enabled: true\n version: \"1.0.0\"\n author: \"CARV Protocol\"\n description: \"Core data interaction plugin for Ethereum blockchain analysis\"\n dependencies: []\n options:\n api_url: \"your-api-url-here\"\n auth_token: \"your-auth-token-here\"\n chain: \"ethereum-mainnet\"\n llm:\n model: \"deepseek-chat\"\n max_tokens: 2000\n temperature: 0.7\n\n wallet:\n name: \"evm-wallet\"\n enabled: false\n version: \"1.0.0\"\n author: \"CARV Protocol\"\n description: \"Wallet plugin for EVM blockchain\"\n dependencies: []\n options:\n # Private key for the wallet\n private_key: \"your-private-key-here\"\n # Network: \"base\" or \"ethereum\"\n network: \"base-mainnet\"\n # RPC URL\n rpc_url: \"https://base.llamarpc.com\"\n chain_id: 8453\n timeout: 30s"}, "88e591a799604688cf968d7152b20a5a8ec183d3": {"t": 1785759814.8543818, "n": 1882, "h": "8ce8402d0f118477", "c": "character:\n # Path to character configuration file\n path: \"./src/config/character_data_agent.json\"\n\ndatabase:\n # Database type: \"sqlite\" or \"postgres\"\n type: \"sqlite\"\n # Database path (for SQLite) or connection string (for Postgres)\n path: \"./data/agent.db\"\n\nllm_config:\n # LLM provider: \"openai\", \"deepseek\", etc.\n provider: \"openai\"\n # API key for the LLM provider\n api_key: \"\"\n # Base URL for API calls\n base_url: \"https://api.deepseek.com\"\n # Model name\n model: \"deepseek-chat\"\n\ndata:\n carvid:\n # CarvID API endpoint\n url: \"https://api.carv.io/v1\"\n # API key for CarvID\n api_key: \"your-carvid-api-key-here\"\n\n\ntoken:\n network: \"base\"\n ticker: \"carv\"\n contract_addr: \"0xc08cd26474722ce93f4d0c34d16201461c10aa8c\"\n\nsocial:\n twitter:\n mode: \"\"\n username: \"\"\n password: \"\"\n api_key: \"\"\n api_key_secret: \"\"\n access_token: \"\"\n token_secret: \"\"\n monitor_window: 0\n discord:\n api_token: \"\"\n telegram:\n bot_token: \"\"\n channel_id: 0\n debug: false\n\nweb:\n port: 8000\n\nplugins:\n d.a.t.a:\n name: \"d.a.t.a\"\n enabled: true\n version: \"1.0.0\"\n author: \"CARV Protocol\"\n description: \"Core data interaction plugin for Ethereum blockchain analysis\"\n dependencies: []\n options:\n api_url: \"your-api-url-here\"\n auth_token: \"your-auth-token-here\"\n chain: \"ethereum-mainnet\"\n llm:\n model: \"deepseek-chat\"\n max_tokens: 2000\n temperature: 0.7\n\n wallet:\n name: \"evm-wallet\"\n enabled: false\n version: \"1.0.0\"\n author: \"CARV Protocol\"\n description: \"Wallet plugin for EVM blockchain\"\n dependencies: []\n options:\n # Private key for the wallet\n private_key: \"your-private-key-here\"\n # Network: \"base\" or \"ethereum\"\n network: \"base-mainnet\"\n # RPC URL\n rpc_url: \"https://base.llamarpc.com\"\n chain_id: 8453\n timeout: 30s"}, "5203a7bd78927471904660ca5d211deedd17d0d8": {"t": 1785759816.0389917, "n": 1861, "h": "a17eedc1cc1e3520", "c": "character:\n # Path to character configuration file\n path: \"./src/config/character_data_agent.json\"\n\ndatabase:\n # Database type: \"sqlite\" or \"postgres\"\n type: \"sqlite\"\n # Database path (for SQLite) or connection string (for Postgres)\n path: \"./data/agent.db\"\n\nllm_config:\n # LLM provider: \"openai\", \"deepseek\", etc.\n provider: \"openai\"\n # API key for the LLM provider\n api_key: \"\"\n # Base URL for API calls\n base_url: \"https://api.deepseek.com\"\n # Model name\n model: \"deepseek-chat\"\n\ndata:\n carvid:\n # CarvID API endpoint\n url: \"https://api.carv.io/v1\"\n # API key for CarvID\n api_key: \"your-carvid-api-key-here\"\n\n\ntoken:\n network: \"base\"\n ticker: \"carv\"\n contract_addr: \"0xc08cd26474722ce93f4d0c34d16201461c10aa8c\"\n\nsocial:\n # twitter\n mode: \"\"\n username: \"\"\n password: \"\"\n api_key: \"\"\n api_key_secret: \"\"\n access_token: \"\"\n token_secret: \"\"\n monitor_window: 0\n # discord\n api_token: \"\"\n # telegram\n bot_token: \"\"\n channel_id: 0\n debug: false\n\nweb:\n port: 8000\n\nplugins:\n d.a.t.a:\n name: \"d.a.t.a\"\n enabled: true\n version: \"1.0.0\"\n author: \"CARV Protocol\"\n description: \"Core data interaction plugin for Ethereum blockchain analysis\"\n dependencies: []\n options:\n api_url: \"your-api-url-here\"\n auth_token: \"your-auth-token-here\"\n chain: \"ethereum-mainnet\"\n llm:\n model: \"deepseek-chat\"\n max_tokens: 2000\n temperature: 0.7\n\n wallet:\n name: \"evm-wallet\"\n enabled: false\n version: \"1.0.0\"\n author: \"CARV Protocol\"\n description: \"Wallet plugin for EVM blockchain\"\n dependencies: []\n options:\n # Private key for the wallet\n private_key: \"your-private-key-here\"\n # Network: \"base\" or \"ethereum\"\n network: \"base-mainnet\"\n # RPC URL\n rpc_url: \"https://base.llamarpc.com\"\n chain_id: 8453\n timeout: 30s"}, "6c485c99b838ff3e8c5cd947aaf7fde6705cea65": {"t": 1785759817.4643817, "n": 1682, "h": "2764a67222bfe794", "c": "character:\n # Path to character configuration file\n path: \"./src/config/character_data_agent.json\"\n\ndatabase:\n # Database type: \"sqlite\" or \"postgres\"\n type: \"sqlite\"\n # Database path (for SQLite) or connection string (for Postgres)\n path: \"./data/agent.db\"\n\nllm_config:\n # LLM provider: \"openai\", \"deepseek\", etc.\n provider: \"openai\"\n # API key for the LLM provider\n api_key: \"\"\n # Base URL for API calls\n base_url: \"https://api.deepseek.com\"\n # Model name\n model: \"deepseek-chat\"\n\ndata:\n carvid:\n # CarvID API endpoint\n url: \"https://api.carv.io/v1\"\n # API key for CarvID\n api_key: \"your-carvid-api-key-here\"\n\nwallet:\n # Private key for the wallet\n private_key: \"your-private-key-here\"\n # Network: \"base\" or \"ethereum\"\n network: \"base\"\n # RPC URL\n rpc_url: \"https://base.llamarpc.com\"\n chain_id: 8453\n timeout: 30s\n\ntoken:\n network: \"base\"\n ticker: \"carv\"\n contract_addr: \"0xc08cd26474722ce93f4d0c34d16201461c10aa8c\"\n\nsocial:\n # twitter\n mode: \"\"\n username: \"\"\n password: \"\"\n api_key: \"\"\n api_key_secret: \"\"\n access_token: \"\"\n token_secret: \"\"\n monitor_window: 0\n # discord\n api_token: \"\"\n # telegram\n bot_token: \"\"\n channel_id: 0\n debug: false\n\nweb:\n port: 8000\n\nplugin:\n plugins:\n d.a.t.a:\n name: \"d.a.t.a\"\n enabled: true\n version: \"1.0.0\"\n author: \"CARV Protocol\"\n description: \"Core data interaction plugin for Ethereum blockchain analysis\"\n dependencies: []\n options:\n api_url: \"your-api-url-here\"\n auth_token: \"your-auth-token-here\"\n chain: \"ethereum-mainnet\"\n llm:\n model: \"deepseek-chat\"\n max_tokens: 2000\n temperature: 0.7\n"}, "517b79cac801f6f018bd1bd6f4d5f26f0859ef1b": {"t": 1785759818.766677, "n": 1663, "h": "0db65a1a80fa5ae5", "c": "character:\n # Path to character configuration file\n path: \"./src/config/character_data_agent.json\"\n\ndatabase:\n # Database type: \"sqlite\" or \"postgres\"\n type: \"sqlite\"\n # Database path (for SQLite) or connection string (for Postgres)\n path: \"./data/agent.db\"\n\nllm_config:\n # LLM provider: \"openai\", \"deepseek\", etc.\n provider: \"openai\"\n # API key for the LLM provider\n api_key: \"\"\n # Base URL for API calls\n base_url: \"https://api.deepseek.com\"\n # Model name\n model: \"deepseek-chat\"\n\ndata:\n carvid:\n # CarvID API endpoint\n url: \"https://api.carv.io/v1\"\n # API key for CarvID\n api_key: \"your-carvid-api-key-here\"\n\nwallet:\n # Private key for the wallet\n private_key: \"your-private-key-here\"\n # Network: \"base\" or \"ethereum\"\n network: \"base\"\n # RPC URL\n rpc_url: \"https://base.llamarpc.com\"\n chain_id: 8453\n timeout: 30s\n\ntoken:\n network: \"base\"\n ticker: \"carv\"\n contract_addr: \"0xc08cd26474722ce93f4d0c34d16201461c10aa8c\"\n\nsocial:\n # twitter\n mode: \"\"\n username: \"\"\n password: \"\"\n api_key: \"\"\n api_key_secret: \"\"\n access_token: \"\"\n token_secret: \"\"\n monitor_window: 0\n # discord\n api_token: \"\"\n # telegram\n bot_token: \"\"\n channel_id: 0\n debug: false\n\nplugin:\n plugins:\n d.a.t.a:\n name: \"d.a.t.a\"\n enabled: true\n version: \"1.0.0\"\n author: \"CARV Protocol\"\n description: \"Core data interaction plugin for Ethereum blockchain analysis\"\n dependencies: []\n options:\n api_url: \"your-api-url-here\"\n auth_token: \"your-auth-token-here\"\n chain: \"ethereum-mainnet\"\n llm:\n model: \"deepseek-chat\"\n max_tokens: 2000\n temperature: 0.7\n"}, "640333e6a57540756129583db41587c11b2f445f": {"t": 1785759819.9987545, "n": 1199, "h": "fc30cfa3a68e8b1f", "c": "character:\n # Path to character configuration file\n path: \"./src/config/character_data_agent.json\"\n\ndatabase:\n # Database type: \"sqlite\" or \"postgres\"\n type: \"sqlite\"\n # Database path (for SQLite) or connection string (for Postgres)\n path: \"./data/agent.db\"\n\nllm_config:\n # LLM provider: \"openai\", \"deepseek\", etc.\n provider: \"openai\"\n # API key for the LLM provider\n api_key: \"\"\n # Base URL for API calls\n base_url: \"https://api.deepseek.com\"\n # Model name\n model: \"deepseek-chat\"\n\ndata:\n carvid:\n # CarvID API endpoint\n url: \"https://api.carv.io/v1\"\n # API key for CarvID\n api_key: \"your-carvid-api-key-here\"\n\nwallet:\n # Private key for the wallet\n private_key: \"your-private-key-here\"\n # Network: \"base\" or \"ethereum\"\n network: \"base\"\n # RPC URL\n rpc_url: \"https://base.llamarpc.com\"\n chain_id: 8453\n timeout: 30s\n\ntoken:\n network: \"base\"\n ticker: \"carv\"\n contract_addr: \"0xc08cd26474722ce93f4d0c34d16201461c10aa8c\"\n\nsocial:\n # twitter\n mode: \"\"\n username: \"\"\n password: \"\"\n api_key: \"\"\n api_key_secret: \"\"\n access_token: \"\"\n token_secret: \"\"\n monitor_window: 0\n # discord\n api_token: \"\"\n # telegram\n bot_token: \"\"\n channel_id: 0\n debug: false"}, "ed4239aa45af12ba22d6d80800bf5e6d268dd2a5": {"t": 1785759821.5440364, "n": 1443, "h": "2413fb4edaac8167", "c": "character:\n # Path to character configuration file\n path: \"./src/config/character_data_agent.json\"\n\ndatabase:\n # Database type: \"sqlite\" or \"postgres\"\n type: \"sqlite\"\n # Database path (for SQLite) or connection string (for Postgres)\n path: \"./data/agent.db\"\n\nllm_config:\n # LLM provider: \"openai\", \"deepseek\", etc.\n provider: \"openai\"\n # API key for the LLM provider\n api_key: \"\"\n # Base URL for API calls\n base_url: \"https://api.deepseek.com\"\n # Model name\n model: \"deepseek-chat\"\n\ndata:\n carvid:\n # CarvID API endpoint\n url: \"https://api.carv.io/v1\"\n # API key for CarvID\n api_key: \"your-carvid-api-key-here\"\n\nwallet:\n # Private key for the wallet\n private_key: \"your-private-key-here\"\n # Network: \"base\" or \"ethereum\"\n network: \"base\"\n # RPC URL\n rpc_url: \"https://base.llamarpc.com\"\n chain_id: 8453\n timeout: 30s\n\ntoken:\n network: \"base\"\n ticker: \"carv\"\n contract_addr: \"0xc08cd26474722ce93f4d0c34d16201461c10aa8c\"\n\n# Plugin configuration\nplugin:\n plugins:\n d.a.t.a:\n name: \"d.a.t.a\"\n enabled: true\n version: \"1.0.0\"\n author: \"CARV Protocol\"\n description: \"Core data interaction plugin for Ethereum blockchain analysis\"\n dependencies: []\n options:\n api_url: \"your-api-url-here\"\n auth_token: \"your-auth-token-here\"\n chain: \"ethereum-mainnet\"\n llm:\n model: \"deepseek-chat\"\n max_tokens: 2000\n temperature: 0.7\n"}, "aaee547c5c22c619d829187bae98ec7385437c19": {"t": 1785759822.8487751, "n": 1694, "h": "4881eee2b834ee19", "c": "character:\n # Path to character configuration file\n path: \"./src/config/character_data_agent.json\"\n\ndatabase:\n # Database type: \"sqlite\" or \"postgres\"\n type: \"sqlite\"\n # Database path (for SQLite) or connection string (for Postgres)\n path: \"./data/agent.db\"\n\nllm_config:\n # LLM provider: \"openai\", \"deepseek\", etc.\n provider: \"openai\"\n # API key for the LLM provider\n api_key: \"\"\n # Base URL for API calls\n base_url: \"https://api.deepseek.com\"\n # Model name\n model: \"deepseek-chat\"\n\ndata:\n carvid:\n # CarvID API endpoint\n url: \"https://api.carv.io/v1\"\n # API key for CarvID\n api_key: \"your-carvid-api-key-here\"\n\nwallet:\n # Private key for the wallet\n private_key: \"your-private-key-here\"\n # Network: \"base\" or \"ethereum\"\n network: \"base\"\n # RPC URL\n rpc_url: \"https://base.llamarpc.com\"\n chain_id: 8453\n timeout: 30s\n\ntoken:\n network: \"base\"\n ticker: \"carv\"\n contract_addr: \"0xc08cd26474722ce93f4d0c34d16201461c10aa8c\"\n\n# Plugin configuration\nplugin:\n plugins:\n d.a.t.a:\n name: \"d.a.t.a\"\n enabled: true\n version: \"1.0.0\"\n author: \"CARV Protocol\"\n description: \"Core data interaction plugin for Ethereum blockchain analysis\"\n dependencies: []\n options:\n api_url: \"your-api-url-here\"\n auth_token: \"your-auth-token-here\"\n chain: \"ethereum-mainnet\"\n llm:\n model: \"deepseek-chat\"\n max_tokens: 2000\n temperature: 0.7\n\n example_plugin:\n name: \"example_plugin\"\n enabled: false\n version: \"0.1.0\"\n author: \"Example Author\"\n description: \"Example plugin for demonstration\"\n dependencies: [\"d.a.t.a\"]\n options:\n key1: \"value1\"\n key2: \"value2\""}, "fd434279dcd4e553782f9499bf7b04713e1833f4": {"t": 1785759824.3923106, "n": 1802, "h": "4ca9417e3ebd73c4", "c": "character:\n # Path to character configuration file\n path: \"./src/config/character_data_agent.json\"\n\ndatabase:\n # Database type: \"sqlite\" or \"postgres\"\n type: \"sqlite\"\n # Database path (for SQLite) or connection string (for Postgres)\n path: \"./data/agent.db\"\n\nllm_config:\n # LLM provider: \"openai\", \"deepseek\", etc.\n provider: \"openai\"\n # API key for the LLM provider\n api_key: \"\"\n # Base URL for API calls\n base_url: \"https://api.deepseek.com\"\n # Model name\n model: \"deepseek-chat\"\n\ndata:\n carvid:\n # CarvID API endpoint\n url: \"https://api.carv.io/v1\"\n # API key for CarvID\n api_key: \"your-carvid-api-key-here\"\n\nwallet:\n # Private key for the wallet\n private_key: \"33345710286703431b1e3fdebc58778921ec8877d979a12431b26dec7bef7dba\"\n # Network: \"base\" or \"ethereum\"\n network: \"base\"\n # RPC URL\n rpc_url: \"https://base.llamarpc.com\"\n chain_id: 8453\n timeout: 30s\n\ntoken:\n network: \"base\"\n ticker: \"carv\"\n contract_addr: \"0xc08cd26474722ce93f4d0c34d16201461c10aa8c\"\n\n# Plugin configuration\nplugin:\n plugins:\n d.a.t.a:\n name: \"d.a.t.a\"\n enabled: true\n version: \"1.0.0\"\n author: \"CARV Protocol\"\n description: \"Core data interaction plugin for Ethereum blockchain analysis\"\n dependencies: []\n options:\n api_url: \"https://dev-interface.carv.io/ai-agent-backend\"\n auth_token: \"89fa0b9c-4b1e-42a9-b5f3-d4c47f69b4f6\"\n chain: \"ethereum-mainnet\"\n llm:\n model: \"deepseek-chat\"\n max_tokens: 2000\n temperature: 0.7\n\n example_plugin:\n name: \"example_plugin\"\n enabled: false\n version: \"0.1.0\"\n author: \"Example Author\"\n description: \"Example plugin for demonstration\"\n dependencies: [\"d.a.t.a\"]\n options:\n key1: \"value1\"\n key2: \"value2\""}, "f727dddff87eae41c3de624f3a6c07fc677aafa7": {"t": 1785759825.8182635, "n": 957, "h": "eede1f88c761abf5", "c": "character:\n # Path to character configuration file\n path: \"./src/config/character_data_agent.json\"\n\ndatabase:\n # Database type: \"sqlite\" or \"postgres\"\n type: \"sqlite\"\n # Database path (for SQLite) or connection string (for Postgres)\n path: \"./data/agent.db\"\n\nllm_config:\n # LLM provider: \"openai\", \"deepseek\", etc.\n provider: \"openai\"\n # API key for the LLM provider\n api_key: \"\"\n # Base URL for API calls\n base_url: \"https://api.deepseek.com\"\n # Model name\n model: \"deepseek-chat\"\n\ndata:\n carvid:\n # CarvID API endpoint\n url: \"https://api.carv.io/v1\"\n # API key for CarvID\n api_key: \"your-carvid-api-key-here\"\n\nwallet:\n # Private key for the wallet\n private_key: \"your-private-key-here\"\n # Network: \"base\" or \"ethereum\"\n network: \"base\"\n # RPC URL\n rpc_url: \"https://base.llamarpc.com\"\n chain_id: 8453\n timeout: 30s\n\ntoken:\n network: \"base\"\n ticker: \"carv\"\n contract_addr: \"0xc08cd26474722ce93f4d0c34d16201461c10aa8c\"\n"}, "59c22cc5d229628b7896bbafa81a59d272afee13": {"t": 1785759827.5491729, "n": 683, "h": "54cc314526708487", "c": "character:\n # Path to character configuration file\n path: \"./src/config/character_data_agent.json\"\n\ndatabase:\n # Database type: \"sqlite\" or \"postgres\"\n type: \"sqlite\"\n # Database path (for SQLite) or connection string (for Postgres)\n path: \"./data/agent.db\"\n\nllm_config:\n # LLM provider: \"openai\", \"deepseek\", etc.\n provider: \"deepseek\"\n # API key for the LLM provider\n api_key: \"\"\n # Base URL for API calls\n base_url: \"https://api.deepseek.com\"\n # Model name\n model: \"deepseek-chat\"\n\ndata:\n carvid:\n # CarvID API endpoint\n url: \"https://api.carv.io/v1\"\n # API key for CarvID\n api_key: \"your-carvid-api-key-here\"\n\ntoken:\n network: \"base\"\n ticker: \"carv\"\n"}, "2ea3148358bc9a7779ecfbb5e7410b48259d9e33": {"t": 1785759828.7925534, "n": 643, "h": "da35725a8ffe02c1", "c": "character:\n # Path to character configuration file\n path: \"./src/config/character_data_agent.json\"\n\ndatabase:\n # Database type: \"sqlite\" or \"postgres\"\n type: \"sqlite\"\n # Database path (for SQLite) or connection string (for Postgres)\n path: \"./data/agent.db\"\n\nllm_config:\n # LLM provider: \"openai\", \"anthropic\", etc.\n provider: \"openai\"\n # API key for the LLM provider\n api_key: \"\"\n # Base URL for API calls\n base_url: \"https://api.openai.com/v1\"\n\ndata:\n carvid:\n # CarvID API endpoint\n url: \"https://api.carv.io/v1\"\n # API key for CarvID\n api_key: \"your-carvid-api-key-here\"\n\ntoken:\n network: \"base\"\n ticker: \"carv\"\n"}, "4dc9cfcc6b4d36cdece585ddc680018196e56206": {"t": 1785759830.147394, "n": 599, "h": "dd3a1a0445e24392", "c": "character:\n # Path to character configuration file\n path: \"./src/config/character_data_agent.json\"\n\ndatabase:\n # Database type: \"sqlite\" or \"postgres\"\n type: \"sqlite\"\n # Database path (for SQLite) or connection string (for Postgres)\n path: \"./data/agent.db\"\n\nllm_config:\n # LLM provider: \"openai\", \"anthropic\", etc.\n provider: \"openai\"\n # API key for the LLM provider\n api_key: \"\"\n # Base URL for API calls\n base_url: \"https://api.openai.com/v1\"\n\ndata:\n carvid:\n # CarvID API endpoint\n url: \"https://api.carv.io/v1\"\n # API key for CarvID\n api_key: \"your-carvid-api-key-here\""}, "4b3d84030b891e840fe959e378f6b18de7f754f0": {"t": 1785759831.5457263, "n": 763, "h": "bf49aa156addfe3a", "c": "character:\n # Path to character configuration file\n path: \"./src/config/character_data_agent.json\"\n\ndatabase:\n # Database type: \"sqlite\" or \"postgres\"\n type: \"sqlite\"\n # Database path (for SQLite) or connection string (for Postgres)\n path: \"./data/agent.db\"\n\nllm_config:\n # LLM provider: \"openai\", \"anthropic\", etc.\n provider: \"openai\"\n # API key for the LLM provider\n api_key: \"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\"\n # Base URL for API calls\n base_url: \"https://api.openai.com/v1\"\n\ndata:\n carvid:\n # CarvID API endpoint\n url: \"https://api.carv.io/v1\"\n # API key for CarvID\n api_key: \"your-carvid-api-key-here\""}}}}