mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-05-20 11:42:10 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3001ba9266 | |||
| b0a401a1ed | |||
| 6b4dc37428 |
@@ -158,9 +158,8 @@ class AzureChatGPTBot(ChatGPTBot):
|
||||
self.args["deployment_id"] = conf().get("azure_deployment_id")
|
||||
|
||||
def create_img(self, query, retry_count=0, api_key=None):
|
||||
api_base = "https://a-wxf.openai.azure.com/"
|
||||
api_version = "2022-08-03-preview"
|
||||
url = "{}dalle/text-to-image?api-version={}".format(api_base, api_version)
|
||||
url = "{}dalle/text-to-image?api-version={}".format(openai.api_base, api_version)
|
||||
api_key = api_key or openai.api_key
|
||||
headers = {"api-key": api_key, "Content-Type": "application/json"}
|
||||
try:
|
||||
@@ -175,7 +174,7 @@ class AzureChatGPTBot(ChatGPTBot):
|
||||
time.sleep(int(retry_after))
|
||||
response = requests.get(operation_location, headers=headers)
|
||||
status = response.json()["status"]
|
||||
image_url = response.json()["result"]["contentUrl"]
|
||||
image_url = response.json()["result"]["contentUrl"]
|
||||
return True, image_url
|
||||
except Exception as e:
|
||||
logger.error("create image error: {}".format(e))
|
||||
|
||||
@@ -74,7 +74,7 @@ Error code: 60020, message: "not allow to access from your ip, ...from ip: xx.xx
|
||||
|
||||
### Railway部署方式
|
||||
|
||||
公众号不能在`Railway`上部署,但企业微信应用可以!
|
||||
公众号不能在`Railway`上部署,但企业微信应用[可以](https://railway.app/template/-FHS--?referralCode=RC3znh)!
|
||||
|
||||
[](https://railway.app/template/-FHS--?referralCode=RC3znh)
|
||||
|
||||
@@ -84,4 +84,4 @@ Error code: 60020, message: "not allow to access from your ip, ...from ip: xx.xx
|
||||
|
||||
AIGC开放社区中已经部署了多个可免费使用的Bot,扫描下方的二维码会自动邀请你来体验。
|
||||
|
||||
<img width="200" src="../../docs/images/aigcopen.png">
|
||||
<img width="200" src="../../docs/images/aigcopen.png">
|
||||
|
||||
Reference in New Issue
Block a user