Comments (7)
針對圖一,因為 /callback 沒有 GET 的 Method,所以直接打會錯誤唷!
針對圖二,截圖的下半部還有更多的錯誤訊息嗎?
from chatgpt-line-bot.
from chatgpt-line-bot.
172.31.128.1 - - [06/Mar/2023 15:39:51] "POST /callback HTTP/1.1" 200 -
[2023-03-06 15:39:51,911] ERROR in app: Exception on /callback [POST]
Traceback (most recent call last):
File "/home/runner/ChatGPT-Line-Bot/venv/lib/python3.10/site-packages/flask/app.py", line 2528, in wsgi_app
response = self.full_dispatch_request()
File "/home/runner/ChatGPT-Line-Bot/venv/lib/python3.10/site-packages/flask/app.py", line 1825, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/runner/ChatGPT-Line-Bot/venv/lib/python3.10/site-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/home/runner/ChatGPT-Line-Bot/venv/lib/python3.10/site-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "main.py", line 38, in callback
handler.handle(body, signature)
File "/home/runner/ChatGPT-Line-Bot/venv/lib/python3.10/site-packages/linebot/webhook.py", line 259, in handle
self.__invoke_func(func, event, payload)
File "/home/runner/ChatGPT-Line-Bot/venv/lib/python3.10/site-packages/linebot/webhook.py", line 271, in __invoke_func
func(event)
File "main.py", line 60, in handle_text_message
line_bot_api.reply_message(
File "/home/runner/ChatGPT-Line-Bot/venv/lib/python3.10/site-packages/linebot/api.py", line 113, in reply_message
self._post(
File "/home/runner/ChatGPT-Line-Bot/venv/lib/python3.10/site-packages/linebot/api.py", line 1860, in _post
self.__check_error(response)
File "/home/runner/ChatGPT-Line-Bot/venv/lib/python3.10/site-packages/linebot/api.py", line 1896, in __check_error
raise LineBotApiError(
linebot.exceptions.LineBotApiError: LineBotApiError: status_code=400, request_id=3d6769f8-8427-494c-a636-d35d03a81765, error_response={"details": [], "message": "Invalid reply token"}, headers={'Content-Type': 'application/json', 'Server': 'envoy', 'x-content-type-options': 'nosniff', 'x-frame-options': 'DENY', 'x-line-request-id': '3d6769f8-8427-494c-a636-d35d03a81765', 'x-xss-protection': '1; mode=block', 'Content-Length': '33', 'Expires': 'Mon, 06 Mar 2023 15:39:51 GMT', 'Cache-Control': 'max-age=0, no-cache, no-store', 'Pragma': 'no-cache', 'Date': 'Mon, 06 Mar 2023 15:39:51 GMT', 'Connection': 'close'}
from chatgpt-line-bot.
圖一的部分,我在line develop有加上callback,但有時會出現這樣的訊息耶...
另外附圖
from chatgpt-line-bot.
172.31.128.1 - - [06/Mar/2023 15:39:51] "POST /callback HTTP/1.1" 200 - [2023-03-06 15:39:51,911] ERROR in app: Exception on /callback [POST] Traceback (most recent call last): File "/home/runner/ChatGPT-Line-Bot/venv/lib/python3.10/site-packages/flask/app.py", line 2528, in wsgi_app response = self.full_dispatch_request() File "/home/runner/ChatGPT-Line-Bot/venv/lib/python3.10/site-packages/flask/app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/runner/ChatGPT-Line-Bot/venv/lib/python3.10/site-packages/flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "/home/runner/ChatGPT-Line-Bot/venv/lib/python3.10/site-packages/flask/app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "main.py", line 38, in callback handler.handle(body, signature) File "/home/runner/ChatGPT-Line-Bot/venv/lib/python3.10/site-packages/linebot/webhook.py", line 259, in handle self.__invoke_func(func, event, payload) File "/home/runner/ChatGPT-Line-Bot/venv/lib/python3.10/site-packages/linebot/webhook.py", line 271, in __invoke_func func(event) File "main.py", line 60, in handle_text_message line_bot_api.reply_message( File "/home/runner/ChatGPT-Line-Bot/venv/lib/python3.10/site-packages/linebot/api.py", line 113, in reply_message self._post( File "/home/runner/ChatGPT-Line-Bot/venv/lib/python3.10/site-packages/linebot/api.py", line 1860, in _post self.__check_error(response) File "/home/runner/ChatGPT-Line-Bot/venv/lib/python3.10/site-packages/linebot/api.py", line 1896, in __check_error raise LineBotApiError( linebot.exceptions.LineBotApiError: LineBotApiError: status_code=400, request_id=3d6769f8-8427-494c-a636-d35d03a81765, error_response={"details": [], "message": "Invalid reply token"}, headers={'Content-Type': 'application/json', 'Server': 'envoy', 'x-content-type-options': 'nosniff', 'x-frame-options': 'DENY', 'x-line-request-id': '3d6769f8-8427-494c-a636-d35d03a81765', 'x-xss-protection': '1; mode=block', 'Content-Length': '33', 'Expires': 'Mon, 06 Mar 2023 15:39:51 GMT', 'Cache-Control': 'max-age=0, no-cache, no-store', 'Pragma': 'no-cache', 'Date': 'Mon, 06 Mar 2023 15:39:51 GMT', 'Connection': 'close'}
可以嘗試看看這個人的解法
line/line-bot-sdk-python#37
from chatgpt-line-bot.
針對這個問題,可以試著更新 openai 的版本
pip install --upgrade openai
from chatgpt-line-bot.
針對這個問題,可以試著更新 openai 的版本
pip install --upgrade openai
還是一樣會跳錯誤
2023-03-08 11:29:31 INFO chatgpt_logger -> U93df74dfee2e3e161b88159cf6813: 哈哈
U93df74dfee2e3e161b88159cf6813
[2023-03-08 11:29:32,262] ERROR in app: Exception on /callback [POST]
Traceback (most recent call last):
File "/home/runner/ChatGPT-Line-Bot-1/venv/lib/python3.10/site-packages/flask/app.py", line 2528, in wsgi_app
response = self.full_dispatch_request()
File "/home/runner/ChatGPT-Line-Bot-1/venv/lib/python3.10/site-packages/flask/app.py", line 1825, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/runner/ChatGPT-Line-Bot-1/venv/lib/python3.10/site-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/home/runner/ChatGPT-Line-Bot-1/venv/lib/python3.10/site-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "main.py", line 38, in callback
handler.handle(body, signature)
File "/home/runner/ChatGPT-Line-Bot-1/venv/lib/python3.10/site-packages/linebot/webhook.py", line 259, in handle
self.__invoke_func(func, event, payload)
File "/home/runner/ChatGPT-Line-Bot-1/venv/lib/python3.10/site-packages/linebot/webhook.py", line 271, in __invoke_func
func(event)
File "main.py", line 57, in handle_text_message
response = chatgpt.get_response(user_id, text)
File "/home/runner/ChatGPT-Line-Bot-1/src/chatgpt.py", line 12, in get_response
response = self.model.chat_completion(self.memory.get(user_id))
File "/home/runner/ChatGPT-Line-Bot-1/src/models.py", line 20, in chat_completion
response = openai.ChatCompletion.create(
File "/home/runner/ChatGPT-Line-Bot-1/venv/lib/python3.10/site-packages/openai/api_resources/chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
File "/home/runner/ChatGPT-Line-Bot-1/venv/lib/python3.10/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "/home/runner/ChatGPT-Line-Bot-1/venv/lib/python3.10/site-packages/openai/api_requestor.py", line 226, in request
resp, got_stream = self._interpret_response(result, stream)
File "/home/runner/ChatGPT-Line-Bot-1/venv/lib/python3.10/site-packages/openai/api_requestor.py", line 619, in _interpret_response
self._interpret_response_line(
File "/home/runner/ChatGPT-Line-Bot-1/venv/lib/python3.10/site-packages/openai/api_requestor.py", line 679, in _interpret_response_line
raise self.handle_error_response(
openai.error.InvalidRequestError: Invalid URL (POST /v1/chat/completions)
172.31.128.1 - - [08/Mar/2023 11:29:32] "POST /callback HTTP/1.1" 500 -
pip install --upgrade openai
172.31.128.1 - - [08/Mar/2023 11:30:11] "GET / HTTP/1.1" 200 -
172.31.128.1 - - [08/Mar/2023 11:30:22] "POST /callback HTTP/1.1" 200 -
from chatgpt-line-bot.
Related Issues (20)
- 串接過程中遇到問題 HOT 2
- 讀取TVBS Youtube等其餘網站連結的問題
- 請移除db.json的設計,openai key會有外洩可能
- help, how i fix this ?
- 網址問題
- 無法順利獲得網址
- /imagine 這指令是不是不能用了 HOT 1
- CronJob 定時發送請求,無法執行
- 更換模型失敗
- You exceeded your current quota, please check your plan and billing details. HOT 2
- 跑完程式碼,出現hello world後,都沒有出現網址 HOT 4
- 請先註冊 Token,格式為 /註冊 sk-xxxxx HOT 1
- 專案執行問題 HOT 2
- 幾個問題請教
- 跑完程式碼,出現Configure me!! HOT 1
- 請問要如何讓Replit的服務不斷線
- 步驟都做完了,但是沒有看到linebot HOT 1
- 求救:按下RUN之後沒有出現Hello World HOT 6
- 他沒有回覆訊息
- 無法執行
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatgpt-line-bot.