if someone has time to check this and make a very small b4x project it should be great for all, it's Xmas...This github describe the use of there http api
I guess you can mimic those calls in b4a using okhttprevChatGPT/revChatGPT.py at main · ChatGPT-Hackers/revChatGPT
Lightweight package for interacting with ChatGPT's API by OpenAI. Uses reverse engineered official API. - revChatGPT/revChatGPT.py at main · ChatGPT-Hackers/revChatGPTgithub.com
When I tap this it gives me a 404 error.This github describe the use of there http api
I guess you can mimic those calls in b4a using okhttprevChatGPT/revChatGPT.py at main · ChatGPT-Hackers/revChatGPT
Lightweight package for interacting with ChatGPT's API by OpenAI. Uses reverse engineered official API. - revChatGPT/revChatGPT.py at main · ChatGPT-Hackers/revChatGPTgithub.com
Dim j As HttpJob
j.Initialize("",Me)
Dim body As String = $"{\"model\":\"text-davinci-003\",\"prompt\":\"What is the capital of France?\",\"temperature\":0.0,\"max_tokens\":150}""$
Dim url As String = "https://api.openai.com/v1/completions"
j.PostString(url,body)
j.GetRequest.SetContentType("application/json")
j.GetRequest.SetHeader("authorization","Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
j.GetRequest.InitializePost2(url, body.GetBytes("UTF8"))
wait for (j) done (j As HttpJob)
If j.Success Then
Dim responseString As String = j.Response.GetString
Log(responseString)
End If
I have created a class that works on B4A/i/J based on the above, see:Maybe it's something like this, but I'm getting a 401 error. So something's not right. I'm new to using this library.
EDIT: I just found this: https://www.b4x.com/android/forum/threads/gpt-3.145654/
Yes I actually saw your post earlier, I've been playing around with different things, and made my own class. Pretty cool stuff.I have created a class that works on B4A/i/J based on the above, see:
https://www.b4x.com/android/forum/threads/gpt-3.145654/#post-923913
Brian,Hi @JackKirk. I have just copied your/Abdull's class - thanks for the clear and comprehensive instructions. But my first two questions got pretty disappointing results - "What is today's date?" and "How old is the king of england?". Just wondered if you were getting usable results.
EDIT : After a few more questions it seems that chatGPT-3 is good on history but pretty ignorant of current affairs.
Note that GPT-3 with "model": "text-davinci-003" is not exactly ChatGPT, see:
https://dev.to/ben/the-difference-between-chatgpt-and-gpt-3-19dh
According to:My hope is that I can work out how to train ChatGPT (or even text-davinci-003) on live question/answer stuff relative to my major customer facing apps and use it to assist in answering customer queries.
See my raw ChatGPT class at:I'm going to wait until the ChatGPT API surfaces to see what that looks like.