rename:配置更名。
This commit is contained in:
parent
a983149abc
commit
40ca781af3
12
handle.cxx
12
handle.cxx
@ -14,37 +14,37 @@ bool CConfig::parse_config(ConfigInfo& config, const std::string& config_path)
|
||||
return false;
|
||||
}
|
||||
if (!ini_handle.KeyExists("Config", "BaseURL")) {
|
||||
std::cerr << "Not Key Found Config/BaseURL in deepseek.ini" << std::endl;
|
||||
std::cerr << "Not Key Found Config/BaseURL in openai.ini" << std::endl;
|
||||
return false;
|
||||
}
|
||||
config.base_url = ini_handle.GetValue("Config", "BaseURL");
|
||||
|
||||
if (!ini_handle.KeyExists("Config", "ApiEnvKey")) {
|
||||
std::cerr << "Not Key Found Config/ApiEnvKey in deepseek.ini" << std::endl;
|
||||
std::cerr << "Not Key Found Config/ApiEnvKey in openai.ini" << std::endl;
|
||||
return false;
|
||||
}
|
||||
config.api_env_key = ini_handle.GetValue("Config", "ApiEnvKey");
|
||||
|
||||
if (!ini_handle.KeyExists("Config", "UserName")) {
|
||||
std::cerr << "Not Key Found Config/UserName in deepseek.ini" << std::endl;
|
||||
std::cerr << "Not Key Found Config/UserName in openai.ini" << std::endl;
|
||||
return false;
|
||||
}
|
||||
config.user_name = ini_handle.GetValue("Config", "UserName");
|
||||
|
||||
if (!ini_handle.KeyExists("Config", "ModelName")) {
|
||||
std::cerr << "Not Key Found Config/ModelName in deepseek.ini" << std::endl;
|
||||
std::cerr << "Not Key Found Config/ModelName in openai.ini" << std::endl;
|
||||
return false;
|
||||
}
|
||||
config.model_name = ini_handle.GetValue("Config", "ModelName");
|
||||
|
||||
if (!ini_handle.KeyExists("Config", "AssistantName")) {
|
||||
std::cerr << "Not Key Found Config/AssistantName in deepseek.ini" << std::endl;
|
||||
std::cerr << "Not Key Found Config/AssistantName in openai.ini" << std::endl;
|
||||
return false;
|
||||
}
|
||||
config.assistant_name = ini_handle.GetValue("Config", "AssistantName");
|
||||
|
||||
if (!ini_handle.KeyExists("Config", "MaxTokens")) {
|
||||
std::cerr << "Not Key Found Config/MaxTokens in deepseek.ini" << std::endl;
|
||||
std::cerr << "Not Key Found Config/MaxTokens in openai.ini" << std::endl;
|
||||
return false;
|
||||
}
|
||||
config.max_tokens = ini_handle.GetLongValue("Config", "MaxTokens");
|
||||
|
4
main.cxx
4
main.cxx
@ -30,7 +30,7 @@ std::string show_api(const std::string& api)
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
std::cout << "Version: 0.9.0" << std::endl;
|
||||
std::cout << "Version: 0.9.0, config name: openai.ini" << std::endl;
|
||||
if (argc < 2) {
|
||||
std::cout << "note: you can give port to start." << std::endl;
|
||||
return 0;
|
||||
@ -43,7 +43,7 @@ int main(int argc, char* argv[])
|
||||
int port = std::stoi(argv[1]);
|
||||
|
||||
ConfigInfo config;
|
||||
if (!CConfig::parse_config(config, "deepseek.ini")) {
|
||||
if (!CConfig::parse_config(config, "openai.ini")) {
|
||||
std::cerr << "parse config failed." << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user