Advantages:
- access to the internet
- access to github
- ability to review pdfs, csvs, etc when hosted online for summary, and questions
For an explainer, Use the simple example, Youll need the full release here: https://github.com/samfisherirl/EdgeGPT_forAHK
I have two example on the github, one is 10 lines and just asks via ahk and responds with a msgbox, the latter provides a GUI.
AHK writes the request to text => python bot (adopted from this gentlemans creation https://github.com/acheong08/EdgeGPT) processes the request, handles cookies, streams response to ahk.
My other projects
https://github.com/samfisherirl/Google-Bard-for-AHK-v2
https://github.com/samfisherirl/AutoHot-GPT
Ahk scripts - these were thrown together quickly, and will get worked on. They are by far not the best of their kind, most time was spent on the pyside. Now that that's finished I'll clean these up. I will likely switch to a socket.
Simple_Example.ahk
Code: Select all
botpath := A_ScriptDir "\bot\EdgeGPT_forAHK.exe"
E := EdgeGPT(botpath)
answer := E.Ask("whats the weather in fiji?")
MsgBox(answer)
E.asyncAsk("How can I travel there?")
loop {
ans := E.answer ; streams to string the answer in pieces
if E.finished {
MsgBox(ans)
}
}
Code: Select all
#Include %A_ScriptDir%\lib\EdgeGPT.ahk
botpath := A_ScriptDir "\bot\EdgeGPT_forAHK.exe"
g := Gui()
g.OnEvent("close", gui_close)
g.OnEvent("escape", gui_close)
display := g.Add("Edit", "w500 h500 ReadOnly", "")
question_field := g.Add("Edit", "w500 h100", "Enter your question")
button := g.Add("Button", "Default", "Submit Question")
button.OnEvent("Click", Asker)
question_field.Focus()
g.Title := "BingGPT"
g.Show()
Asker(*)
{
global display, question_field
E := EdgeGPT(botpath)
E.asyncAsk(question_field.Value)
Loop
{
if E.answer != "" {
display.Value := E.answer
Sleep(100)
if (E.finished)
{
break
}
}
}
}
gui_close(*)
{
ExitApp
}
Update 10/2/23: this required I rewrite and compile the python. I have not done it in the same method as before as I don't have time. It will not stream responses.
Simply write one question to "ask.txt" in the same dir as the exe file posted in the github release here. https://github.com/samfisherirl/EdgeGPT_forAHK/releases/tag/v1.1
Upon close, the app will write the response in "answer.txt".
To track the response from ahk, just track the processexist PID.
This update was done for one person. If this has any additional users, Ill recompile with the original ahk gui methods.