theexplainthis / chatgpt-line-bot Goto Github PK
View Code? Open in Web Editor NEWThis is a repository that allows you to integrate ChatGPT into Line.
License: MIT License
This is a repository that allows you to integrate ChatGPT into Line.
License: MIT License
我成功串接了,line上傳訊息,會回傳"請先註冊 Token,格式為 /註冊 sk-xxxxx",目前有再次更換過OPENAI的API值,也在OPENAI儲值USD:5了,懇請釋疑。
沒有辦法使用gpt-4
經過摸索終於成功讓Line加載chatgpt了 玩得很開心XDDDDDD
但Replit的服務大概一小時就會斷線 用了各種監控服務ping他還是一樣
免費額度感覺是固定時間的 請問有沒有什麼方法讓他不會斷線?
有產生網址但沒有https:// 所以linebot不能啟用
在Line輸入文字傳給Chat GPT時,他回傳到Line 'You exceeded your current quota, please check your plan and billing details.'。我的OpenAI API 有重新換過一個了,也有用一個新的帳號辦過了,但還是不行。請問是什麼原因?
Traceback (most recent call last):
File "main.py", line 1, in
from dotenv import load_dotenv
ModuleNotFoundError: No module named 'dotenv'
按下Run後出現以下訊息
Traceback (most recent call last):
File "/home/runner/ChatGPT-Line-Bot/main.py", line 19, in
from src.utils import get_role_and_content
File "/home/runner/ChatGPT-Line-Bot/src/utils.py", line 1, in
import opencc
ModuleNotFoundError: No module named 'opencc'
沒有進行到Hello World那一步
請問哪個地方出錯了 謝謝
INFO chatgpt_logger -> Ua2e9625792a9f7f39d2870c2757a9027: 會哦
Ua2e9625792a9f7f39d2870c2757a9027
[2023-03-13 07:40:19,353] ERROR in app: Exception on /callback [POST]
這是發生什麽事了呢?可以幫我處理嗎?謝謝
今天發現有訊息太長的錯誤訊息會造成系統崩潰
[2023-03-07 06:42:01,003] 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 57, in handle_text_message
response = chatgpt.get_response(user_id, text)
File "/home/runner/ChatGPT-Line-Bot/src/chatgpt.py", line 12, in get_response
response = self.model.chat_completion(self.memory.get(user_id))
File "/home/runner/ChatGPT-Line-Bot/src/models.py", line 20, in chat_completion
response = openai.ChatCompletion.create(
File "/home/runner/ChatGPT-Line-Bot/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/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/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/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/venv/lib/python3.10/site-packages/openai/api_requestor.py", line 679, in _interpret_response_line
raise self.handle_error_response(
openai.error.InvalidRequestError: This model's maximum context length is 4096 tokens. However, your messages resulted in 4117 tokens. Please reduce the length of the messages.
你好~我嘗試使用了貴公司的chat gpt 的line API串接,在replit 平台下按RUN完,並未顯示HELLO WORLD,而是找不到網頁,判斷可能是貴公司關閉了伺服器或者github的code需要再修改,忽略這個問題,繼續下一步,至cronjob設定完按create後,下一步呢?我要怎麼在手機的line上找到串接好的chat gpt使用?
感謝分享如此受用的知識,以上問題如有空再麻煩協助我解決一下,感謝囉
經常要傳好幾次訊息replit那邊才會收到訊息,是甚麼問題嗎?
As the title:
the code can only run when I removed initialize func
def initialize(self, user_id: str):
self.storage[user_id] = [{
'role': 'system', 'content': self.system_message
}]
已經能夠在replit上運行,介面中的webview url 是有https的,但我把網址貼到browser卻顯示"這個網站無法提供安全連線"看起來是ssl有問題,是有什麼東西要另外設定的嗎?
在使用replit.com平台免費版,
他會公開所有的檔案,底下用來記錄API_KEY的檔案"db.json"會被直接公開,會有機會被別人盜用
我隨便在上面搜尋幾個專案很多人都直接洩漏了他的api_key
您好,我想發問另一個問題
請問/imagine這個指令是Dall-E 2的繪圖功能嗎?
這部分有辦法改寫成使用midjourney的模型嗎?
Line回覆速度很慢 有建議的解決方法嗎
我可以正常跟機器人聊天對話,但是/imagine文字生成圖片是不是無法使用了?
cowsay Configure me!
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
只出現以上資訊,截圖在這
https://imgur.com/a/c97djCJ
在某個特定 Line User 發過來的訊息會造成下列錯誤,請問是什麼原因?
2023-03-07 12:27:24 INFO chatgpt_logger -> U94fdb27e34200c86ad9d65fd71280849: 藍牙裝置跟手機連線時,由app偵測所顯示的信號強度可讀出兩裝置間的距離嗎?
U94fdb27e34200c86ad9d65fd71280849
[2023-03-07 12:27:29,795] 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 57, in handle_text_message
response = chatgpt.get_response(user_id, text)
File "/home/runner/ChatGPT-Line-Bot/src/chatgpt.py", line 12, in get_response
response = self.model.chat_completion(self.memory.get(user_id))
File "/home/runner/ChatGPT-Line-Bot/src/models.py", line 20, in chat_completion
response = openai.ChatCompletion.create(
File "/home/runner/ChatGPT-Line-Bot/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/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/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/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/venv/lib/python3.10/site-packages/openai/api_requestor.py", line 679, in _interpret_response_line
raise self.handle_error_response(
openai.error.APIError: Internal server error {
"error": {
"message": "Internal server error",
"type": "auth_subrequest_error",
"param": null,
"code": "internal_error"
}
}
500 {'error': {'message': 'Internal server error', 'type': 'auth_subrequest_error', 'param': None, 'code': 'internal_error'}} {'Date': 'Tue, 07 Mar 2023 12:27:29 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '166', 'Connection': 'keep-alive', 'Vary': 'Origin', 'X-Request-Id': '3fa25b7a78e9cdb221712f37e280c83e', 'Strict-Transport-Security': 'max-age=15724800; includeSubDomains'}
按run之後出現
Traceback (most recent call last):
File "main.py", line 1, in
from dotenv import load_dotenv
ModuleNotFoundError: No module named 'dotenv'
該怎麼解決
最後一步驟時雖然有出現Hello World,但無法順利獲得網址。
「172.31.196.1 - - [30/May/2023 01:18:49] "GET / HTTP/1.1" 200 -」
會出現上面這行紅字~
想請問可能原因是什麼呢?
使用 text to image 功能 chatGPT reply
很抱歉,我現在沒有產生圖像的功能。然而,您可以嘗試搜索一些文字到圖像的轉換工具和網站來完成這個任務。謝謝。
謝謝
我想讓其他的網站在丟入連結時,一樣可以正確讀取到文長的內容,想請教大家在這方面會如何做撰寫!
您好想詢問操作到專案執行->開始執行那邊 點擊上方Run完後不會出現hello world該怎麼解決
只出現這個
cowsay Configure me!
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
想請教現在該怎麼做 感謝
可以使用,但有方法使他反應或回覆速度快一點嗎?是不是需要付錢買什麼?謝謝~
我想要使用MongoDB作為database,請問我應該怎麼做,試了好久都失敗
Perform test run: ChatGPT-Line-Bot
TEST RUN STATUS
405 Method Not Allowed
請問出現405 Method Not Allowed要怎麼處理呢?謝謝
P.s.在LINE develop
Webhook settings
Webhook URL
https://ChatGPT-Line-Bot-1.XXXXX.repl.co/callback
按下 verify之後顯示Success
可以用語音轉文字的方式
但直接輸入文字他就會說「you must provide a model parameter」
用語音問答他跟我說:
很抱歉,這可能是因為我沒有被授權使用該模型。如果您有相關模型的權限,您可以授權給我使用它,或者您可以使用其他相關模型提問。感謝您的理解和配合。
是那部分設定沒有讀取到文字輸入模型的使用權限呢?
按下RUN之後沒有出現Hello World
出現下面這些
Traceback (most recent call last):
File "/home/runner/ChatGPT-Line-Bot/main.py", line 2, in
from flask import Flask, request, abort
File "/home/runner/ChatGPT-Line-Bot/.pythonlibs/lib/python3.10/site-packages/flask/init.py", line 5, in
from .app import Flask as Flask
File "/home/runner/ChatGPT-Line-Bot/.pythonlibs/lib/python3.10/site-packages/flask/app.py", line 30, in
from werkzeug.urls import url_quote
ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/home/runner/ChatGPT-Line-Bot/.pythonlibs/lib/python3.10/site-packages/werkzeug/urls.py)
如果要自行更改 temperature , max_tokens 參數該如何修改,是直接在 replit網站密鑰上加上參數嗎
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.