TheExplainthis / ChatGPT-Line-Bot

This is a repository that allows you to integrate ChatGPT into Line.
MIT License
1.55k stars 1.88k forks source link

並未顯示HELLO WORLD,而是找不到網頁 #2

Closed cosmatter closed 1 year ago

cosmatter commented 1 year ago

你好~我嘗試使用了貴公司的chat gpt 的line API串接,在replit 平台下按RUN完,並未顯示HELLO WORLD,而是找不到網頁,判斷可能是貴公司關閉了伺服器或者github的code需要再修改,忽略這個問題,繼續下一步,至cronjob設定完按create後,下一步呢?我要怎麼在手機的line上找到串接好的chat gpt使用? 感謝分享如此受用的知識,以上問題如有空再麻煩協助我解決一下,感謝囉

TheExplainthis commented 1 year ago

剛剛有推了一個新版,可以在 main 中加入

@app.route("/", methods=['GET'])
def home():
    return 'Hello World'

即可

cosmatter commented 1 year ago

成功了,可能編寫有問題,機器人只有已讀,無法回應

TheExplainthis commented 1 year ago

是否有任何錯誤訊息呢?

cosmatter commented 1 year ago

沒有! 只是已讀沒回,我另外測試其他人的教學,使用VERCEL平台,機器人回覆 08:54 Chat GPT Request failed with status code 429 08:54 Chat GPT POST https://api.openai.com/v1/completions 08:54 Chat GPT You exceeded your current quota, please check your plan and billing details. 懷疑免費額度沒了,改創新帳號使用新的API KEY後,一樣出現上面的錯誤訊息

TheExplainthis commented 1 year ago

可以先辨識是 Line 的問題 還是 ChatGPT 的問題 下面這一行程式碼

response = chatgpt.get_response(user_id, text)
msg = TextSendMessage(text=response)

改成

# response = chatgpt.get_response(user_id, text)  註解掉
msg = TextSendMessage(text="Hello World")

看看是否 Line 會回傳 Hello World,會的話代表 Line 端沒問題

如果是 OpenAI 他說的額度用完,建議可以去 openai 的開發者後台,看看他使用量如何!