From 46623244aaff6f45ae094331913d85b1855c3855 Mon Sep 17 00:00:00 2001 From: heshunme Date: Fri, 25 Oct 2024 23:00:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BC=8F=E4=BA=86=E4=B8=80=E4=B8=AA=E9=83=A8?= =?UTF-8?q?=E7=BD=B2=E7=94=A8=E7=9A=84=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 4 ++++ test/__init__.py | 6 ------ test.py => test/test3.py | 4 ++-- test_main.http | 11 ----------- 4 files changed, 6 insertions(+), 19 deletions(-) create mode 100644 requirements.txt delete mode 100644 test/__init__.py rename test.py => test/test3.py (92%) delete mode 100644 test_main.http diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..ac98c26 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +websockets~=13.1 +openai~=1.52.2 +fastapi~=0.115.3 +uvicorn~=0.20.0 \ No newline at end of file diff --git a/test/__init__.py b/test/__init__.py deleted file mode 100644 index 6d7254f..0000000 --- a/test/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -# @Time : 2024/10/25 下午5:18 -# @Author : 河瞬 -# @FileName: __init__.py.py -# @Software: PyCharm -# @Github : diff --git a/test.py b/test/test3.py similarity index 92% rename from test.py rename to test/test3.py index 218b2e8..bd93e46 100644 --- a/test.py +++ b/test/test3.py @@ -1,10 +1,10 @@ import base64 import openai -with open("test.png", "rb") as f: +with open("../test.png", "rb") as f: image_data = f.read() image_base64 = base64.b64encode(image_data).decode('utf-8') -with open("key", "r") as f: +with open("../key", "r") as f: key = f.read() client = openai.OpenAI(api_key=key, base_url="https://open.bigmodel.cn/api/paas/v4/" diff --git a/test_main.http b/test_main.http deleted file mode 100644 index a2d81a9..0000000 --- a/test_main.http +++ /dev/null @@ -1,11 +0,0 @@ -# Test your FastAPI endpoints - -GET http://127.0.0.1:8000/ -Accept: application/json - -### - -GET http://127.0.0.1:8000/hello/User -Accept: application/json - -###