unconv / chat-wtf Goto Github PK
View Code? Open in Web Editor NEWA ChatGPT-like chatbot with PHP and Python
A ChatGPT-like chatbot with PHP and Python
Hi,
this is the only response it gives:
"Sorry, but I don't know how to answer that."
Hello, in your YouTube video you adjust the speed of the real-time output, can you please help identify which line of code this is located?
Hi,
Ive tried to use that repo for my fine tuned chatgpt model, Ive set the my api key and fine-tuned model name in settings.php.
The client works well but I need to set parameters like while taking response on python :
response = openai.ChatCompletion.create(
model= " ",
messages= "",
temperature=0.1, # like this
max_tokens=200, # like this
top_p = 0.9 # like this
)
Is there any way to set that kind of parameters on that repo ?
Thanks for all :)
Hello!
Been following your videos for a while now, being a PHP enthusiast for ages. Great job and keep up the good work :)
While thinking about the need (or lack there of) to send the past message history whenever we send a request to the API, I asked chatGPT the following:
if i want the api to remember the conversation, do i always have to send the whole past conversation whenever i send a new message?
and this was the response:
No, you don't have to send the entire past conversation every time you make a request to the OpenAI API if you want the model to remember the conversation context. Instead, you can use a system-level instruction to instruct the model to remember the conversation history. This allows you to send only the new message or messages without repeating the entire conversation.
Here's an example of how you can use a system-level instruction to instruct the model to remember the conversation (...)
"messages": [
{"role": "system", "content": "You are a helpful assistant that remembers the conversation."},
{"role": "user", "content": "What's the weather like today?"}
]
In this example, the system instruction tells the model to remember the conversation. Subsequent requests can then include only the new user or assistant messages,
So, wouldn't this be a way to save A LOT of tokens and api usage? just a thought, not a bug report or anything like that.
Best regards from Portugal ๐
hi, cool script - thank you
Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1 near "LIMIT": syntax error in database.php on line 79
PDOException: SQLSTATE[HY000]: General error: 1 near "LIMIT"
if I remove "LIMIT 1", it will work (several occurrences)
Shifu,
I refer to you this video "PHP ChatGPT Clone: Saving Conversations to a Database | MySQL & SQLite | ChatWTF"
where you already fixed the scroll to bottom issues as the responses generate.
However this only affected scroll within the Chat-Message div area
This okay when the conversation title of the side bar have a few.
Let says you have 30 conversations...and all this 30+ coversation fully fill your entire side bar to overflow bottom.
Now you have dual scroll, one is teh chat div, the other one is outer html scroll.
If you want to view or select conversation no. 30 let says, you have to you the outer scroll bar to scroll that side-bar down.
Is there any way we can control the outer html div scroll instead of the chat div only? So that it can auto scroll down as a whole page instead of div only.
But in chatGpt it has separate scroll for sidebars and chat. BUt the chat side control overall page instead on chat-div only.
Is there anyway we can make wtf scroll to bottom using html scroll, so that scroll will auto scroll to bottom as reponse generate together with sidebar will be scrolled down together as well?
"This model's maximum context length is 4097 tokens. However, you requested 4288 tokens (2288 in the messages, 2000 in the completion). Please reduce the length of the messages or completion. (context_length_exceeded)"
Hi Master Shifu,
Appearantly, I encountered this message couples of times. Eventhough my messages were in short sentences. It's seems to me it combined all my previous prompt and completion as well. In your previous version of chatWTF...it did not combine the prompt, that's mean the tokens refresh to zero after each completions. But I notice this newer version, after a while probably 15 to 20 chat conversation, it return this message.
Occassionally, received this message to in console "Error 414 URI Too Long response " as well.
The latest version of ChatWTF is good and I like it coz it can stored historical chat data in SESSION (subject we did not clear the cache). However, if there anyway we can maintain the latest ChatWTF features but at the sametime include the rollback of where the tokens are refresh for new each prompt like what you did in previous version ChatWTF version?
Thanks in advance Shifu.
Master Shifu - Thanks for the great video!! Appreciate it very much. Anyway I will stick to your earlier version that you thought earlier since it works fine for me.
I have 3 queries though, see if you can help me out.
#1: highlights.js
You have use 'highlights' rel link in your code which is very useful for code markdown. But upon inspect on the console, this warning came out:
highlight.min.js:263 One of your code blocks includes unescaped HTML. This is a potentially serious security risk.
y @ highlight.min.js:263
N @ highlight.min.js:274
add_message @ script.js:65
(anonymous) @ script.js:11
highlight.min.js:264 https://github.com/highlightjs/highlight.js/wiki/security
y @ highlight.min.js:264
N @ highlight.min.js:274
add_message @ script.js:65
(anonymous) @ script.js:11
highlight.min.js:265 The element with unescaped HTML:
y @ highlight.min.js:265
N @ highlight.min.js:274
add_message @ script.js:65
(anonymous) @ script.js:11
highlight.min.js:266
y @ highlight.min.js:266
N @ highlight.min.js:274
add_message @ script.js:65
(anonymous) @ script.js:11
Is this something to be concern about? or should we just ignore it?
To replicate this issues, I just ask it chatwtf to generate simple login php code. After it generate code, i simply reply thank you. After reply, only then the console generate this message.
#2: System_Message =>
I want to use the "system_message" for my chatwtf...the problem with this is that, when you fill text into teh system_message... upon refresh you browser...the system_message will come out at the top as part you chat conversation...if you refresh 5 times, it also will appear 5 times. How can we fill in the input for system_message, but when the user refresh the browser....it will not show the system message as part of the chat conversation.
#3: Generating Table
Is there any way generate table with perfect line like chatGPT? something like you did markdown to the code.
For example when you prompt ChatGPT to "generate table of fruits" it will genereate perfect line of table.
But for ChatWTF, it still generate the table of fruits, just that the line is 'Cut' & 'dotted'.
Thanks in advance Master Shifu, appreciate very much what you have done!
Hi, I have clone the repo and completed the settings. All goes well but the result does not appending like chatGPT. I wait and show the result at one go, not like the typing effect. Is there any settings or additional package/script that need to be added? Thanks.
Just curious is the new Assistants API works with ChatWTF? https://platform.openai.com/docs/api-reference/assistants
If not, would swapping the Conversations API with the Assistants API be a simple drop-in replacement, or would it require a significant architecture update?
Hey,
I was checking this and found out that EventSource doesn't support a post method so to use this with a secure form & post data we will need to use a library like sse.js which supports post method and all other goodies that EventSource supports.
Below is the link to the library I am mentioning:
https://github.com/mpetazzoni/sse.js
I am currently trying to implement a streaming functionality to my existing openAI code and came across this code which is nicely done but needs POST method support.
Cheers!
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.