1.1,整理目录,小修改

This commit is contained in:
高子兴 2024-10-25 23:00:33 +08:00
parent a434ef998c
commit 29fd98e233
4 changed files with 5 additions and 19 deletions

3
requirements.txt Normal file
View File

@ -0,0 +1,3 @@
websockets~=13.1
openai~=1.52.2
fastapi~=0.115.3

View File

@ -1,6 +0,0 @@
# -*- coding: utf-8 -*-
# @Time : 2024/10/25 下午5:18
# @Author : 河瞬
# @FileName: __init__.py.py
# @Software: PyCharm
# @Github :

View File

@ -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/"

View File

@ -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
###