Merge branch 'master' into master

This commit is contained in:
hanfangyuan4396
2023-11-29 10:16:50 +08:00
committed by GitHub
16 changed files with 522 additions and 30 deletions

View File

@@ -18,3 +18,6 @@ TTS_1 = "tts-1"
TTS_1_HD = "tts-1-hd"
MODEL_LIST = ["gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-4", "wenxin", "wenxin-4", "xunfei", "claude", "gpt-4-turbo", GPT4_TURBO_PREVIEW, "tongyi"]
# channel
FEISHU = "feishu"

3
common/memory.py Normal file
View File

@@ -0,0 +1,3 @@
from common.expired_dict import ExpiredDict
USER_IMAGE_CACHE = ExpiredDict(60 * 3)

View File

@@ -1,6 +1,6 @@
import io
import os
from urllib.parse import urlparse
from PIL import Image
@@ -49,3 +49,8 @@ def split_string_by_utf8_length(string, max_length, max_split=0):
result.append(encoded[start:end].decode("utf-8"))
start = end
return result
def get_path_suffix(path):
path = urlparse(path).path
return os.path.splitext(path)[-1].lstrip('.')