TintinMeimei commited on
Commit
5bedc9d
1 Parent(s): 71aaff4

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -3
main.py CHANGED
@@ -5,8 +5,7 @@ from fastapi.staticfiles import StaticFiles
5
  from fastapi.responses import FileResponse
6
  from pydantic import BaseModel
7
  import openai
8
- openai.api_key = "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"
9
- api_key = os.environ["apikey"]
10
 
11
 
12
  app = FastAPI()
@@ -22,7 +21,7 @@ def chatgpt(input: ChatInput):
22
  output = result.get('choices')[0].get('message').get('content')
23
  except Exception as e:
24
  output = {"output": str(e)}
25
- return {"output": output + str(api_key)}
26
 
27
  app.mount("/", StaticFiles(directory="static", html=True), name="static")
28
 
 
5
  from fastapi.responses import FileResponse
6
  from pydantic import BaseModel
7
  import openai
8
+ openai.api_key = os.environ["apikey"]
 
9
 
10
 
11
  app = FastAPI()
 
21
  output = result.get('choices')[0].get('message').get('content')
22
  except Exception as e:
23
  output = {"output": str(e)}
24
+ return {"output": output}
25
 
26
  app.mount("/", StaticFiles(directory="static", html=True), name="static")
27