coolai / main.py
TintinMeimei's picture
Update main.py
6b50289
raw
history blame
368 Bytes
from fastapi import FastAPI
import openai
openai.api_key = "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"
app = FastAPI()
@app.get("/")
def read_root():
input = "Translate this sentence to French. Sentence: I can speak Chinese."
output = openai.Completion.create(model="gpt-3.5-turbo", prompt="Translate")
return {"Input": input, "Output": output}