1.1,整理目录,小修改
This commit is contained in:
parent
a434ef998c
commit
29fd98e233
3
requirements.txt
Normal file
3
requirements.txt
Normal file
@ -0,0 +1,3 @@
|
||||
websockets~=13.1
|
||||
openai~=1.52.2
|
||||
fastapi~=0.115.3
|
||||
@ -1,6 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Time : 2024/10/25 下午5:18
|
||||
# @Author : 河瞬
|
||||
# @FileName: __init__.py.py
|
||||
# @Software: PyCharm
|
||||
# @Github :
|
||||
@ -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/"
|
||||
@ -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
|
||||
|
||||
###
|
||||
Loading…
Reference in New Issue
Block a user