randydev commited on
Commit
6f1ecca
·
1 Parent(s): 974774f

Upload 2 files

Browse files
Files changed (2) hide show
  1. main.py +2 -2
  2. models.py +0 -2
main.py CHANGED
@@ -628,7 +628,7 @@ def chatgpt_model(item: ChatgptModel):
628
  @app.post("/ryuzaki/chatgpt3-turbo", response_model=SuccessResponse, responses={422: {"model": ErrorStatus}})
629
  def chatgpt3_turbo(item: Chatgpt3Texts):
630
  if item.is_openai_original:
631
- openai.api_key = item.api_key
632
  openai.api_base = SOURCE_OPENAI_ACCESS_URL
633
  chat_completion = openai.ChatCompletion.create(
634
  model="gpt-3.5-turbo",
@@ -663,7 +663,7 @@ def chatgpt4_turbo(
663
  item: OpenaiTexts,
664
  api_key: None = Depends(validate_api_key)
665
  ):
666
- openai.api_key = item.api_key
667
  openai.api_base = SOURCE_OPENAI_ACCESS_URL
668
  chat_completion = openai.ChatCompletion.create(
669
  model="gpt-4-turbo",
 
628
  @app.post("/ryuzaki/chatgpt3-turbo", response_model=SuccessResponse, responses={422: {"model": ErrorStatus}})
629
  def chatgpt3_turbo(item: Chatgpt3Texts):
630
  if item.is_openai_original:
631
+ openai.api_key = ""
632
  openai.api_base = SOURCE_OPENAI_ACCESS_URL
633
  chat_completion = openai.ChatCompletion.create(
634
  model="gpt-3.5-turbo",
 
663
  item: OpenaiTexts,
664
  api_key: None = Depends(validate_api_key)
665
  ):
666
+ openai.api_key = ""
667
  openai.api_base = SOURCE_OPENAI_ACCESS_URL
668
  chat_completion = openai.ChatCompletion.create(
669
  model="gpt-4-turbo",
models.py CHANGED
@@ -134,11 +134,9 @@ class AnimeStyled(BaseModel):
134
 
135
  class OpenaiTexts(BaseModel):
136
  query: str
137
- api_key: str
138
 
139
  class Chatgpt3Texts(BaseModel):
140
  query: str
141
- api_key: Optional[str] = None
142
  is_openai_original: Optional[bool] = False
143
 
144
  class TextCustom(BaseModel):
 
134
 
135
  class OpenaiTexts(BaseModel):
136
  query: str
 
137
 
138
  class Chatgpt3Texts(BaseModel):
139
  query: str
 
140
  is_openai_original: Optional[bool] = False
141
 
142
  class TextCustom(BaseModel):