merefield / discourse-chatbot Goto Github PK
View Code? Open in Web Editor NEWAn AI bot with RAG capability for Topics and Chat in Discourse, currently powered by OpenAI
License: GNU General Public License v2.0
An AI bot with RAG capability for Topics and Chat in Discourse, currently powered by OpenAI
License: GNU General Public License v2.0
OpenAIBot: There was a problem, but will retry til limit: undefined method `dig' for #<HTTParty::Response:0x6f1a8 parsed_response="{\"id\":\"chatcmpl-79xtZsNQeICPCXq5BaD2VmlvuHMGx\",\"object\":\"chat.completion\",\"created\":1682609545,\"model\":\"gpt-3.5-turbo-0301\",\"usage\":{\"prompt_tokens\":63,\"completion_tokens\":9,\"total_tokens\":72},\"choices\":[{\"message\":{\"role\":\"assistant\",\"content\":\"Hello! How may I assist you today?\"},\"finish_reason\":\"stop\",\"index\":0}]}\n", @response=#<Net::HTTPOK 200 OK readbody=true>, @headers={"date"=>["Thu, 27 Apr 2023 15:32:27 GMT"], "content-type"=>["text/html; charset=utf-8"], "transfer-encoding"=>["chunked"], "connection"=>["close"], "access-control-allow-origin"=>["*"], "cf-cache-status"=>["DYNAMIC"], "report-to"=>["{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=6rhZAcoOI4QqoiFaKt2%2BjbRfq%2FxsZzjotfzRovBbMFkEXkr9J2BDO6A7smBH6qHCuoMAtk5YZrNSXE7alsL%2B%2FflbggfO2dnuH222Eoyzs9Fsi7UtxLzprdG09SJjQMK9CA%3D%3D\"}],\"group\":\"cf-nel\",\"max_age\":604800}"], "nel"=>["{\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}"], "server"=>["cloudflare"], "cf-ray"=>["7be81e361877b45e-HKG"], "alt-svc"=>["h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400"]}>
Job exception: undefined method `dig' for #<HTTParty::Response:0x6f1a8 parsed_response="{\"id\":\"chatcmpl-79xtZsNQeICPCXq5BaD2VmlvuHMGx\",\"object\":\"chat.completion\",\"created\":1682609545,\"model\":\"gpt-3.5-turbo-0301\",\"usage\":{\"prompt_tokens\":63,\"completion_tokens\":9,\"total_tokens\":72},\"choices\":[{\"message\":{\"role\":\"assistant\",\"content\":\"Hello! How may I assist you today?\"},\"finish_reason\":\"stop\",\"index\":0}]}\n", @response=#<Net::HTTPOK 200 OK readbody=true>, @headers={"date"=>["Thu, 27 Apr 2023 15:32:27 GMT"], "content-type"=>["text/html; charset=utf-8"], "transfer-encoding"=>["chunked"], "connection"=>["close"], "access-control-allow-origin"=>["*"], "cf-cache-status"=>["DYNAMIC"], "report-to"=>["{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=6rhZAcoOI4QqoiFaKt2%2BjbRfq%2FxsZzjotfzRovBbMFkEXkr9J2BDO6A7smBH6qHCuoMAtk5YZrNSXE7alsL%2B%2FflbggfO2dnuH222Eoyzs9Fsi7UtxLzprdG09SJjQMK9CA%3D%3D\"}],\"group\":\"cf-nel\",\"max_age\":604800}"], "nel"=>["{\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}"], "server"=>["cloudflare"], "cf-ray"=>["7be81e361877b45e-HKG"], "alt-svc"=>["h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400"]}>
Great repo!! Really interesting!
But there is a new issue that surfaced recently.
We didn't post many threads, only 5 threads.
The first one succeeded in getting correct reply.
But the rest 4 all failed.
The AIBot only replied: "Sorry, I’m not well right now. Lets talk some other time. Meanwhile, please ask the admin to check the logs, thank you!"
Logs:
OpenAIBot: There was a problem: You exceeded your current quota, please check your plan and billing details.
Our API key didn't expire. We only posted 5 threads. Why did we exceed your current quota?
So, how can we proceed?
I often encounter an issue while using the discourse-chatbot plugin, where the bot responds with the message Sorry, I'm not well right now. Let's talk some other time. Meanwhile, please ask the admin to check the logs, thank you!
Upon checking the logs, I found several ReadTimeout
errors, which may be due to network issues. Additionally, I noticed that the bot's response time varies; sometimes, it responds within seconds, while at other times, it takes several minutes, even though I've been using a ChatGPT premium account API key. Perhaps this issue is also related to the network.
Therefore, can we consider adding a proxy option to the plugin, similar to how we use export http_proxy=http://server.com
in the terminal? I have already attempted to configure it in the env
section of the discourse's app.yml
file, but it appears that the plugin is not utilizing these environment variables. (I did not observe any records of the proxy client accessing the OpenAI Service in the logs).
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.