diff --git a/.cruft.json b/.cruft.json index b534285..72e9d9e 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/OVINC-CN/DevTemplateDjango.git", - "commit": "12315cb10b8b85663cba8a7ba806c6a5f1421416", + "commit": "5281a1802f609dde876e1b80816a82c86a202767", "checkout": "main", "context": { "cookiecutter": { diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 1507174..b2ffeab 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10"] + python-version: ["3.12"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2e47960..1e4a935 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: rev: 22.8.0 hooks: - id: black - language_version: python3.10 + language_version: python3.12 args: - "--line-length=120" - repo: https://github.com/pycqa/isort diff --git a/Dockerfile b/Dockerfile index 48c7054..4fc0a27 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10.15-slim +FROM python:3.12.7-slim WORKDIR /usr/src/app COPY requirements.txt /usr/src/app/ @@ -13,5 +13,3 @@ RUN cp env.example .env \ && rm -rf .env RUN mkdir -p /usr/src/app/logs /usr/src/app/tmp /usr/share/fonts/zh_cn - -RUN bin/proxy_gemini.sh diff --git a/bin/proxy_gemini.sh b/bin/proxy_gemini.sh deleted file mode 100755 index 12e4526..0000000 --- a/bin/proxy_gemini.sh +++ /dev/null @@ -1,13 +0,0 @@ -SITE_PACKAGES=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") - -sed -i'.bak' '161a\ - from django.conf import settings' "$SITE_PACKAGES/google/ai/generativelanguage_v1beta/services/generative_service/transports/grpc.py" - -sed -i'.bak2' '175a\ - ("grpc.http_proxy", settings.OPENAI_HTTP_PROXY_URL),' "$SITE_PACKAGES/google/ai/generativelanguage_v1beta/services/generative_service/transports/grpc.py" - -sed -i'.bak' '206a\ - from django.conf import settings' "$SITE_PACKAGES/google/ai/generativelanguage_v1beta/services/generative_service/transports/grpc_asyncio.py" - -sed -i'.bak2' '220a\ - ("grpc.http_proxy", settings.OPENAI_HTTP_PROXY_URL),' "$SITE_PACKAGES/google/ai/generativelanguage_v1beta/services/generative_service/transports/grpc_asyncio.py" diff --git a/bin/proxy_gemini_macos.sh b/bin/proxy_gemini_macos.sh deleted file mode 100755 index 3fe4c4b..0000000 --- a/bin/proxy_gemini_macos.sh +++ /dev/null @@ -1,17 +0,0 @@ -SITE_PACKAGES=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") - -sed -i'.bak' '161a\ - from django.conf import settings\ -' "$SITE_PACKAGES/google/ai/generativelanguage_v1beta/services/generative_service/transports/grpc.py" - -sed -i'.bak2' '175a\ - ("grpc.http_proxy", settings.OPENAI_HTTP_PROXY_URL),\ -' "$SITE_PACKAGES/google/ai/generativelanguage_v1beta/services/generative_service/transports/grpc.py" - -sed -i'.bak' '206a\ - from django.conf import settings\ -' "$SITE_PACKAGES/google/ai/generativelanguage_v1beta/services/generative_service/transports/grpc_asyncio.py" - -sed -i'.bak2' '220a\ - ("grpc.http_proxy", settings.OPENAI_HTTP_PROXY_URL),\ -' "$SITE_PACKAGES/google/ai/generativelanguage_v1beta/services/generative_service/transports/grpc_asyncio.py" diff --git a/locale/zh_Hans/LC_MESSAGES/django.po b/locale/zh_Hans/LC_MESSAGES/django.po index f19e813..8fdce8a 100644 --- a/locale/zh_Hans/LC_MESSAGES/django.po +++ b/locale/zh_Hans/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-12 10:47+0800\n" +"POT-Creation-Date: 2024-12-16 14:04+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -63,6 +63,9 @@ msgstr "Midjourney" msgid "Moonshot" msgstr "Moonshot" +msgid "Claude" +msgstr "Claude" + msgid "1024x1024" msgstr "1024x1024" @@ -129,6 +132,30 @@ msgstr "文本" msgid "Image URL" msgstr "图片链接" +msgid "Image" +msgstr "图片" + +msgid "Message Start" +msgstr "消息开始" + +msgid "Message Delta" +msgstr "消息块" + +msgid "Content Block Delta" +msgstr "内容块" + +msgid "API" +msgstr "API" + +msgid "Chunk" +msgstr "块" + +msgid "Fetch" +msgstr "拉取" + +msgid "Chat" +msgstr "对话" + msgid "Unauthorized Model" msgstr "未授权的模型" @@ -249,9 +276,6 @@ msgstr "温度" msgid "Top Probability" msgstr "优选值" -msgid "Messages too long, please clear all input" -msgstr "消息过长,请清空重试" - msgid "COS" msgstr "对象存储" diff --git a/requirements.txt b/requirements.txt index f13d8b4..9817856 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,46 +1,40 @@ # ovinc -ovinc-client==0.3.13 +ovinc-client==0.3.14 # Celery celery==5.4.0 - # Async asgiref==3.8.1 -channels[daphne]==4.1.0 -channels_redis==4.2.0 +channels[daphne]==4.2.0 +channels_redis==4.2.1 # Server -gunicorn==22.0.0 +gunicorn==23.0.0 uvicorn-worker==0.2.0 -uvicorn==0.30.1 -websockets==12.0 +uvicorn==0.34.0 # Datetime -arrow==1.2.3 +arrow==1.3.0 # RSA -pycryptodome==3.20.0 - -# OpenAI -openai==1.56.1 -tiktoken==0.8.0 -pillow==10.3.0 +pycryptodome==3.21.0 -# Gemini -google-generativeai==0.3.2 -google_api_core==2.15.0 -google-ai-generativelanguage==0.4.0 +# tcloud +tencentcloud-sdk-python==3.0.1282 -# Hunyuan -tencentcloud-sdk-python==3.0.1279 +# OpenAI +openai==1.57.4 # COS cos-python-sdk-v5==1.9.29 -qcloud-python-sts==3.1.5 +qcloud-python-sts==3.1.6 # qrcode -qrcode==7.4.2 +qrcode==8.0.0 # claude anthropic==0.40.0 + +# websocket +websockets==14.1