File size: 328 Bytes
01f2316
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from fastapi import FastAPI

app = FastAPI()

@app.get("/example")
def example():
    new_final_ai_response = "这是 AIResponse 的内容"
    return {"AIResponse": new_final_ai_response}

response = app.test_client().get("/example")
response_data = response.json()
ai_response = response_data["AIResponse"]
print(ai_response)