按照要求修改

This commit is contained in:
zhouzinimg 2023-10-16 22:53:28 +08:00
parent e2af76fb08
commit f3c7da32a0
41 changed files with 342 additions and 944 deletions

View file

@ -45,18 +45,8 @@ class Config(metaclass=Singleton):
self.global_proxy = self._get("GLOBAL_PROXY")
self.openai_api_key = self._get("OPENAI_API_KEY")
self.anthropic_api_key = self._get("Anthropic_API_KEY")
#星火大模型相关
self.xinghuo_appid = self._get("xinghuo_appid")
self.xinghuo_api_secret = self._get("xinghuo_api_secret")
self.xinghuo_api_key = self._get("xinghuo_api_key")
self.domain=self._get("domain")
self.Spark_url=self._get("Spark_url")
self.no_api_mode=self._get("no_api_mode")
if (not self.openai_api_key or "YOUR_API_KEY" == self.openai_api_key) and (
not self.anthropic_api_key or "YOUR_API_KEY" == self.anthropic_api_key
)and (
not self.xinghuo_api_key or "APIKey" == self.xinghuo_api_key
):
raise NotConfiguredException("Set OPENAI_API_KEY or Anthropic_API_KEY first")
self.openai_api_base = self._get("OPENAI_API_BASE")
@ -72,6 +62,12 @@ class Config(metaclass=Singleton):
self.deployment_name = self._get("DEPLOYMENT_NAME")
self.deployment_id = self._get("DEPLOYMENT_ID")
self.xinghuo_appid=self._get("XINGHUO_APPID")
self.xinghuo_api_secret = self._get("XINGHUO_API_SECRET")
self.xinghuo_api_key = self._get("XINGHUO_API_KEY")
self.domain = self._get("DOMAIN")
self.spark_url = self._get("SPARK_URL")
self.claude_api_key = self._get("Anthropic_API_KEY")
self.serpapi_api_key = self._get("SERPAPI_API_KEY")
self.serper_api_key = self._get("SERPER_API_KEY")