Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
iuiaoin committed Jul 19, 2023
1 parent 199ec81 commit b95fa32
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions bot/azure_chatgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,6 @@ def __init__(self):
self.args["deployment_id"] = conf().get("azure_deployment_id")

def reply_img(self, query):
create_image_size = conf().get("create_image_size", "256x256")
try:
response = openai.Image.create(prompt=query, n=1, size=create_image_size)
image_url = response["data"][0]["url"]
logger.info(f"[ChatGPT] Image={image_url}")
return Reply(ReplyType.IMAGE, image_url)
except Exception as e:
logger.error(f"[ChatGPT] Create image failed: {e}")
return Reply(ReplyType.TEXT, "Image created failed")

def create_img(self, query):
url = f"{openai.api_base}dalle/text-to-image?api-version=2022-08-03-preview"
headers = {"api-key": openai.api_key, "Content-Type": "application/json"}
create_image_size = conf().get("create_image_size", "256x256")
Expand Down

0 comments on commit b95fa32

Please sign in to comment.