Giter Club home page Giter Club logo

chat-wtf's People

Contributors

debyx91 avatar unconv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chat-wtf's Issues

Issue after deploy

Hi,

this is the only response it gives:

"Sorry, but I don't know how to answer that."

Customized Parameters For fine tuned model

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 :)

Remembering the conversation

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 ๐Ÿ‘‹

LIMIT 1 produces error

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)

Scroll to Bottom

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?

maximum context length is 4097 tokens

"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.

Highlights Js, System Message & Generating Table

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!

Result does not print out in frontend as per chatgpt

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.

message.php error

I get this error when sending a message in PHP version. is there any dependency I should install?
1

Removal of context from PHP code

Hi @unconv I noticed that in the following commit 066c33b you removed the context from the code in favour of using simply $msg as the context.

Was there something wrong with the old way?

How can I best provide context for the PHP app as I want users to be primed with some context.

Replace using EventSource with mpetazzoni/sse.js

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.