Purebasic and chat gpt (version 3.5)
Re: Purebasic and chat gpt (version 3.5)
Thank,
I tested, i have error message :
{"max_tokens": 3500, "model": "gpt-3.5-turbo", "temperature": 1, "n": 1, "messages": [{"role": "user", "content": "please write an article about purebasic"}]}
StatusCode: 401
Response: {
"error": {
"message": "Incorrect API key provided: [API KEY]. You can find your API key at https://platform.openai.com/account/api-keys.",
"type": "invalid_request_error",
"param": null,
"code": "invalid_api_key"
}
}
I tested, i have error message :
{"max_tokens": 3500, "model": "gpt-3.5-turbo", "temperature": 1, "n": 1, "messages": [{"role": "user", "content": "please write an article about purebasic"}]}
StatusCode: 401
Response: {
"error": {
"message": "Incorrect API key provided: [API KEY]. You can find your API key at https://platform.openai.com/account/api-keys.",
"type": "invalid_request_error",
"param": null,
"code": "invalid_api_key"
}
}
Re: Purebasic and chat gpt (version 3.5)
It's x64 only sorry. I've reuploaded it and tested it, think it's got all the dependenciesKurzer wrote: Sun Aug 27, 2023 2:23 pm okay, then the provided 'libllmodel.dll.a' file is the problem.
the dll does not support all needed symbols.
then we have to wait until idle has slept off.![]()
https://dnscope.io/idlefiles/gpt4all_pb.zip
it won't be compatible with all the models like bert based ones as need to rebuild the libs
but it should work with llma and ggml models
download the snoozy model from "Model Explorer" half way down page
https://gpt4all.io/index.html
ouput in console
llama.cpp: loading model from C:\Users\idle\gpt4all\gpt4all-backend\build\bin\GPT4All-13B-snoozy.ggmlv3.q4_0.bin
llama_model_load_internal: format = ggjt v3 (latest)
llama_model_load_internal: n_vocab = 32000
llama_model_load_internal: n_ctx = 2048
llama_model_load_internal: n_embd = 5120
llama_model_load_internal: n_mult = 256
llama_model_load_internal: n_head = 40
llama_model_load_internal: n_layer = 40
llama_model_load_internal: n_rot = 128
llama_model_load_internal: ftype = 2 (mostly Q4_0)
llama_model_load_internal: n_ff = 13824
llama_model_load_internal: n_parts = 1
llama_model_load_internal: model size = 13B
llama_model_load_internal: ggml ctx size = 0.09 MB
llama_model_load_internal: mem required = 2223.89 MB (+ 1608.00 MB per state)
.
llama_init_from_file: kv self size = 1600.00 MB
input
Hello can you please tell me how to solve the surface area of a sphere
end input
output
Sure, I'd be happy to help! To find the surface area of a sphere, we need to use the formula: S = 4πr^2. Where r is the radius of the sphere and pi (π) represents approximately 3.14. Let's say our sphere has a radius of 5 units. Then, plugging in these values into the formula gives us: S = 4(3.14)(5)^2 = 78.5 square units.
output
Re: Purebasic and chat gpt (version 3.5)
Thank you but I give up, I don't understand anything at all, it's too complicated for me. Also, I don't speak English.
I didn't think you had to do all this just to issue a request to ChatGPT and save the response to a text file.
Thanks again for taking your time.
I didn't think you had to do all this just to issue a request to ChatGPT and save the response to a text file.
Thanks again for taking your time.
Re: Purebasic and chat gpt (version 3.5)
If you can find a free online service it should be easy to do http requests but if you want your own personal model it's unfortunately complicated.jak64 wrote: Sun Aug 27, 2023 11:03 pm Thank you but I give up, I don't understand anything at all, it's too complicated for me. Also, I don't speak English.
I didn't think you had to do all this just to issue a request to ChatGPT and save the response to a text file.
Thanks again for taking your time.
Re: Purebasic and chat gpt (version 3.5)
Hello idle,
I tried the updated code today on my computer with the x64 version of PB.
The linker error message does not appear anymore, but instead there is the following error when loading the model (see screenshot).
What could be the reason for this? Do not all models that are downloadable from the Open AI website work? Or are there files missing in the ChatGPT4All archive?

I tried the updated code today on my computer with the x64 version of PB.
The linker error message does not appear anymore, but instead there is the following error when loading the model (see screenshot).
What could be the reason for this? Do not all models that are downloadable from the Open AI website work? Or are there files missing in the ChatGPT4All archive?

PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2024: 56y
"Happiness is a pet." | "Never run a changing system!"
"Happiness is a pet." | "Never run a changing system!"
Re: Purebasic and chat gpt (version 3.5)
Hi Kurzer, I need to recompile the libs. Might take me a day or two.
Re: Purebasic and chat gpt (version 3.5)
Hello everyone,
I just wrote this little code which saves the result of ChatGPT 3.5
This is just a small example for testing.
I used the code posted by "Fig" on the French forum to simulate pressing a key.
Question :
Can't we make this code "transparent" so that the web page doesn't display since I only need to have the result saved?
I just wrote this little code which saves the result of ChatGPT 3.5
This is just a small example for testing.
I used the code posted by "Fig" on the French forum to simulate pressing a key.
Question :
Can't we make this code "transparent" so that the web page doesn't display since I only need to have the result saved?
Code: Select all
;----- Déclarer les procedures
Declare SimulerAppuiSurUneTouche(Touche.i)
Declare SimulerClicGaucheSouris(X.i,Y.i)
;----- Déclaration des variables
Global url.s
; Procédure simulant l'appui sur une touche. La touche est passée en paramètres
Procedure SimulerAppuiSurUneTouche(ToucheAppuyee.i)
; Simulation de l'appui sur la touche
keybd_event_(ToucheAppuyee,0,0,0)
; imulation du relâchement de la touche
keybd_event_(ToucheAppuyee,0,#KEYEVENTF_KEYUP,0)
EndProcedure
; Procedure simulant un clic gauche de la souris
Procedure SimulerClicGaucheSouris(X.i,Y.i)
; Simulation du clic gauche de la souris et positionnement de la souris
mouse_event_(#MOUSEEVENTF_RIGHTDOWN,X,Y, 500, 300)
Delay(150)
; Simulation du relâchement du clic gauche
mouse_event_(#MOUSEEVENTF_RIGHTUP, X,Y, 500, 300)
Delay(150)
EndProcedure
;----- Programme principal
; Lancer ChatGPT
url="https://chat.openai.com/"
RunProgram(url,"","",0)
; Simuler l'appui sur les touches correspondant à la requête que l'on veut envoyer
; Bien sûr, on peut gérer cela dans une boucle... Ceci est juste un test...
Delay(1000)
; Dans cet exemple, on simule la suite de caractères : "51 x 19"
SimulerAppuiSurUneTouche(#VK_NUMPAD5)
SimulerAppuiSurUneTouche(#VK_NUMPAD1)
SimulerAppuiSurUneTouche(#VK_SPACE)
SimulerAppuiSurUneTouche(#VK_X)
SimulerAppuiSurUneTouche(#VK_SPACE)
SimulerAppuiSurUneTouche(#VK_NUMPAD1)
SimulerAppuiSurUneTouche(#VK_NUMPAD9)
Delay(1000)
; Envoyer la requête à ChatGPT
SimulerAppuiSurUneTouche(#VK_RETURN)
Delay(2000)
;Positionner le curseur au centre de l'écran
SetCursorPos_(600,500)
; Simuler un clic droit de la souris au centre de l'écran
SimulerClicGaucheSouris(500,300)
Delay (1000)
; Enregistrer la page
SimulerAppuiSurUneTouche(#VK_S)
Delay (1000)
; Simuler la touche Entrée
SimulerAppuiSurUneTouche(#VK_RETURN)
Re: Purebasic and chat gpt (version 3.5)
what if you try
Code: Select all
RunProgram(url,"","",#PB_Program_Hide)
Spec: Linux Mint 20.3 Cinnamon, i7-3770K, 16GB RAM, RTX 2070 Super
Re: Purebasic and chat gpt (version 3.5)
Hello Janny,
Thank you for your answer but it doesn't work, the ChatGPT web page is displayed or I would like it not to be displayed but the code still executes because this code will be part of a program and I I would like the request to ChatGPT not to appear on the screen.
Thank you for your answer but it doesn't work, the ChatGPT web page is displayed or I would like it not to be displayed but the code still executes because this code will be part of a program and I I would like the request to ChatGPT not to appear on the screen.
Re: Purebasic and chat gpt (version 3.5)
I've rebuilt the libs, x64 windows only hope I haven't missed out any dependencies, should work with the current modelsKurzer wrote: Mon Aug 28, 2023 2:54 pm Hello idle,
I tried the updated code today on my computer with the x64 version of PB.
The linker error message does not appear anymore, but instead there is the following error when loading the model (see screenshot).
What could be the reason for this? Do not all models that are downloadable from the Open AI website work? Or are there files missing in the ChatGPT4All archive?
![]()
https://dnscope.io/idlefiles/gpt4all_pb.zip
Re: Purebasic and chat gpt (version 3.5)
Hello everyone,
I saw that Bing offered "Conversation" where it is possible to ask questions, a bit like with ChatGPT.
Question :
Can't we, in this case, write a program in Purebasic which would automatically launch the questions and be able to save the answers in a file?
Is this the same problem as with ChatGPT where you have to have a (paid) key?
I saw that Bing offered "Conversation" where it is possible to ask questions, a bit like with ChatGPT.
Question :
Can't we, in this case, write a program in Purebasic which would automatically launch the questions and be able to save the answers in a file?
Is this the same problem as with ChatGPT where you have to have a (paid) key?
Re: Purebasic and chat gpt (version 3.5)
I spent a couple of hours recompiled the libraries and testing it on x64 windows so you can just use it locallyjak64 wrote: Wed Aug 30, 2023 12:00 pm Hello everyone,
I saw that Bing offered "Conversation" where it is possible to ask questions, a bit like with ChatGPT.
Question :
Can't we, in this case, write a program in Purebasic which would automatically launch the questions and be able to save the answers in a file?
Is this the same problem as with ChatGPT where you have to have a (paid) key?
viewtopic.php?p=606483#p606483
look at the functions
CBNetResponse(token_id.l,*response); it appends the response
Proceess(client) where you will see
Code: Select all
prompt.s = "### Human " + input + " ### Assistant" + #CRLF$
llmodel_prompt(gmodel,prompt,@CBPrompt(),@CBNetResponse(),@CBRecalc(),@gctx);
falcon_model_load: loading model from 'E:\gpt4all\gpt4all-backend\build\bin\ggml-model-gpt4all-falcon-q4_0.bin' - please wait ...
falcon_model_load: n_vocab = 65024
falcon_model_load: n_embd = 4544
falcon_model_load: n_head = 71
falcon_model_load: n_head_kv = 1
falcon_model_load: n_layer = 32
falcon_model_load: ftype = 2
falcon_model_load: qntvr = 0
falcon_model_load: ggml ctx size = 3872.64 MB
falcon_model_load: memory_size = 32.00 MB, n_mem = 65536
falcon_model_load: ........................ done
falcon_model_load: model size = 3872.59 MB / num tensors = 196
what is the square root or -1
The square root of negative one is not a valid mathematical expression. It is not possible to find the square root of negative one using any known methods.
why does the sky appear blue
The sky appears blue due to the way light interacts with the Earth's atmosphere. The Earth's atmosphere contains molecules of different colors, and when sunlight passes through these molecules, it scatters into all directions, including towards our eyes. Blue light has shorter wavelengths than other colors, so it is scattered more easily by the Earth's atmosphere. This scattering causes the blue light to be absorbed less, resulting in the blue color we see in the sky.
how do I say good evening in French and German
In French, you can say "bonsoir" which means "good evening". In German, you can say "guten Abend", which also means "good evening".
Re: Purebasic and chat gpt (version 3.5)
Hello idle,
Thank you for your answer but I'm not an expert, I don't know what to do:
1) Should we download the 3 files indicated when we click on the link "viewtopic.php?p=606483#p606483"?
2) If yes, what to do next?
3) Do I need an API key to use it?
Thank you for your help.
Thank you for your answer but I'm not an expert, I don't know what to do:
1) Should we download the 3 files indicated when we click on the link "viewtopic.php?p=606483#p606483"?
2) If yes, what to do next?
3) Do I need an API key to use it?
Thank you for your help.
Re: Purebasic and chat gpt (version 3.5)
1.- Yes.
2.- UnCompress the zip to a directory and put all the files inside.
3.- No, It runs on your own computer.
Anyway, I think IDLE forgot a file, maybe we must wait for it
P.D: Don't expect the same accuracy or speed like ChatGPT.
2.- UnCompress the zip to a directory and put all the files inside.
3.- No, It runs on your own computer.
Anyway, I think IDLE forgot a file, maybe we must wait for it

P.D: Don't expect the same accuracy or speed like ChatGPT.
Re: Purebasic and chat gpt (version 3.5)
Hello Caronte3D,
I'm going to test this and if it works, it's GREAT, GREAT, GREAT!!!
I'm going to test this and if it works, it's GREAT, GREAT, GREAT!!!