From 29fd98e23373562bfe445aba864249693a79c575 Mon Sep 17 00:00:00 2001 From: heshunme Date: Fri, 25 Oct 2024 23:00:33 +0800 Subject: [PATCH] =?UTF-8?q?1.1=EF=BC=8C=E6=95=B4=E7=90=86=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=EF=BC=8C=E5=B0=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 3 +++ test/__init__.py | 6 ------ test.py => test/test3.py | 4 ++-- test_main.http | 11 ----------- 4 files changed, 5 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..0e42804 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +websockets~=13.1 +openai~=1.52.2 +fastapi~=0.115.3 \ 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 - -###