Compare commits

...

3 Commits

Author SHA1 Message Date
Soulter 0de14c4c8b perf: 配置项默认值 2024-09-23 11:07:52 -04:00
Soulter 51de0159fb chore: update version to 3.3.15 2024-09-23 10:51:02 -04:00
Soulter 37a756aeb3 fix: turn off openai api streaming mode 2024-09-23 10:49:57 -04:00
3 changed files with 21 additions and 1 deletions
+18
View File
@@ -23,6 +23,20 @@ class DashBoardHelper():
return float(value)
elif type_ == "float" and isinstance(value, int):
return float(value)
def get_default_val_by_type(self, type_: str):
if type_ == "int":
return 0
elif type_ == "float":
return 0.0
elif type_ == "bool":
return False
elif type_ == "string":
return ""
elif type_ == "list":
return []
elif type_ == "object":
return {}
def validate_config(self, data):
@@ -32,6 +46,10 @@ class DashBoardHelper():
if key not in data:
continue
value = data[key]
# null 转换
if value is None:
data[key] = self.get_default_val_by_type(meta["type"])
continue
# 递归验证
if meta["type"] == "list" and isinstance(value, list):
for item in value:
+2
View File
@@ -336,12 +336,14 @@ class ProviderOpenAIOfficial(Provider):
if tools:
completion_coro = self.client.chat.completions.create(
messages=contexts,
stream=False,
tools=tools,
**conf
)
else:
completion_coro = self.client.chat.completions.create(
messages=contexts,
stream=False,
**conf
)
try:
+1 -1
View File
@@ -1,4 +1,4 @@
VERSION = '3.3.14'
VERSION = '3.3.15'
DEFAULT_CONFIG = {
"qqbot": {