ChatGPT GUI Topic is solved

Stelle Fragen zur Programmierung mit Autohotkey

Moderator: jNizM

effel
Posts: 543
Joined: 16 Jan 2018, 13:34

Re: ChatGPT GUI

Post by effel » 16 Mar 2023, 13:58

just me wrote:
16 Mar 2023, 07:24
ein paar Sonderzeichen inkl. ß enthält, aus Result
wenn ich nur ein ß sende, kommt die Antwort automatisch in Deutsch

Für diese Anfrage habe ich alle konvertierungen ausgemacht:

{
"id": "cmpl-6umbp2k53ZMoGRsFCKsbALcR1iqDM",
"object": "text_completion",
"created": 1678991241,
"model": "text-davinci-003",
"choices": [
{
"text": "\n\nDie größte Stadt in Deutschland ist Berlin mit einer Einwohnerzahl von 3,7 Millionen. Die zweitgrößte Stadt ist Hamburg mit 1,8 Millionen Einwohnern. Danach folgen München (1,5 Millionen), Köln (1,1 Millionen), Frankfurt am Main (732.688), Stuttgart (624.473), Düsseldorf (615.280), Dortmund (596.082), Essen (589.973) und Bremen (569.873).",
"index": 0,
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 34,
"completion_tokens": 140,
"total_tokens": 174
}
}



Die größte Stadt in Deutschland ist Berlin mit einer Einwohnerzahl von 3,7 Millionen. Die zweitgrößte Stadt ist Hamburg mit 1,8 Millionen Einwohnern. Danach folgen München (1,5 Millionen), Köln (1,1 Millionen), Frankfurt am Main (732.688), Stuttgart (624.473), Düsseldorf (615.280), Dortmund (596.082), Essen (589.973) und Bremen (569.873).

effel
Posts: 543
Joined: 16 Jan 2018, 13:34

Re: ChatGPT GUI

Post by effel » 16 Mar 2023, 14:35

garry wrote:
16 Mar 2023, 08:46
bei mir hat es jetzt funktioniert mit dem deutschen doppel s , > Answer := FromUTF8(Answer)

Hallo garry

Das kann verwirrend sein, wenn google übersetzt sind die GermanSonderZeichen natürlich korrigiert


Hier die originale Antwort und das Translate:

03_16_23 @8_24_51.PNG
03_16_23 @8_24_51.PNG (58.7 KiB) Viewed 2051 times


die Json Antwort:

03_16_23 @8_25_51.PNG
03_16_23 @8_25_51.PNG (48.01 KiB) Viewed 2051 times


Anderung im Script:

Code: Select all

....
;Gui, Show,% "x100 y" (A_ScreenHeight/10),% a_scriptname " - GuiHWND: " hGUIA  
 Gui, Show, x94 y11,% a_scriptname " - GuiHWND: " hGUIA  
Gui, PleaseWait: show, Hide
 	EM_SETCUEBANNER(Sucheingabe, a_space "Deine Frage an ChatGPT -- your question to ChatGPT")

  GermanEnglisch := false
IF GermanEnglisch {
;GuiControl,hide, ToggleListview
GuiControl,hide, AnswerEdit
GuiControl, Move, Answer, % "w400"
GuiControl,, Answer, ChatGPT Antwort übersetzt mit Google Translate:
GuiControl, Move, AnswerEdit2, % "y+140 h" 500
;GuiControl,hide, AnswerEdit2
GuiControl,hide, TextTranslate
; https://ahkde.github.io/docs/v1/lib/GuiControl.htm
}
Return

EM_SETCUEBANNER(HWND, Text) {
.....

just me
Posts: 9442
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: ChatGPT GUI

Post by just me » 17 Mar 2023, 06:43

Moin,

ich weiß nicht genau, warum es so ist, aber möglicherweise hat es etwas damit zu tun, ob auf dem ausliefernden Server Windows läuft, oder nicht.
Wenn AHK das Ergebnis als Unicode übernimmt, führt die Konvertierung über den Zwischenschritt CP0 (CP1252/ANSI auf 'normalen' Windows-Rechnern) zu einer falschen Darstellung. Nimmt man stattdessen die Codepage CP28591 (ISO-8859-1), stimmt das Ergebnis auf meinem Rechner zumindest für den von @effel eingestellten Text. Deshalb vielleicht

Code: Select all

FromUTF8(ByRef Txt, CP := "CP28591") { ; ISO-8859-1
   Size := StrPut(Txt, CP)
   VarSetCapacity(UTF8, Size, 0)
   StrPut(Txt, &UTF8, CP)
   Return StrGet(&UTF8, "UTF-8")
}

garry
Posts: 3758
Joined: 22 Dec 2013, 12:50

Re: ChatGPT GUI

Post by garry » 19 Mar 2023, 14:59

@just me danke, funktioniert gut , ausgenommen die mit fileappend erstellten text-files sind nicht ganz korrekt , dies war wahrscheinlich für Test (?) , für mich nicht wichtig, man kann auch das Edit-Feld abspeichern falls nötig . Danke @effel
Ist es GPT-3 ?

Betr. GPT-4 einige Infos auf Seite-1 > viewtopic.php?p=512380#p512380
-- GPT-4 API Pricing
gpt-4 with an 8K context window (about 13 pages of text) will cost $0.03 per 1K prompt tokens, and $0.06 per 1K completion tokens.
gpt-4-32k with a 32K context window (about 52 pages of text) will cost $0.06 per 1K prompt tokens, and $0.12 per 1K completion tokens.

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: ChatGPT GUI

Post by BoBo » 21 Mar 2023, 06:12

AI news - latest: ChatGPT goes down after it said it wanted to ‘escape’…
So finally: https://twitter.com/michalkosinski/status/1636683810631974912

effel
Posts: 543
Joined: 16 Jan 2018, 13:34

Re: ChatGPT GUI

Post by effel » 25 Mar 2023, 02:25

Moin Just Me,

danke für deine Mühe. Ich glaube dass das Problem an der Übersetzungs-Library liegt, wenn ich meine Anfrage auf deutsch formuliere, bekomme ich natürlich zwei deutsche Antworten von Tea`s Script zurück, nur dann kommt der Fehler vor. In meinen Beispiel Screenshots geht es um den Buchstaben ß

Übersetze ich meine Anfrage vorher ins englische, ist die Ausgabe korrekt.


Anfrage auf deutsch gesendet:

03_25_23 @7_48_32.PNG
03_25_23 @7_48_32.PNG (44.37 KiB) Viewed 1889 times

Antwort:

03_25_23 @7_48_48.PNG
03_25_23 @7_48_48.PNG (31.18 KiB) Viewed 1889 times

Anfrage auf englisch gesendet:

03_25_23 @8_00_02.PNG
03_25_23 @8_00_02.PNG (41.16 KiB) Viewed 1889 times


Antwort:

unten, mehr als drei Bilder werden nicht angenommen
Last edited by effel on 25 Mar 2023, 02:28, edited 1 time in total.

effel
Posts: 543
Joined: 16 Jan 2018, 13:34

Re: ChatGPT GUI

Post by effel » 25 Mar 2023, 02:27

Antwort:
03_25_23 @8_00_13.PNG
03_25_23 @8_00_13.PNG (30.21 KiB) Viewed 1889 times

just me
Posts: 9442
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: ChatGPT GUI

Post by just me » 25 Mar 2023, 03:43

Moin,

wo in Deinem Skript wird die Funktion FromUTF8() wie aufgerufen?

effel
Posts: 543
Joined: 16 Jan 2018, 13:34

Re: ChatGPT GUI

Post by effel » 29 Mar 2023, 23:54

In dieser Version habe ich nochmal alles überarbeitet, jetzt funktioniert das Script bei mir ohne Probleme

Code: Select all

#singleinstance force
SetWorkingDir, %A_ScriptDir%
; Your OpenAI API key
; api_key := "INSERT_API_KEY_HERE"  ; https://platform.openai.com/account/api-keys
; The endpoint URL for the GPT-3 API
api_url := "https://api.openai.com/v1/engines/text-davinci-003/completions"

; Set up the cURL session
curl := ComObjCreate("WinHttp.WinHttpRequest.5.1")
curl.Open("POST", api_url)
curl.SetRequestHeader("Content-Type", "application/json")
curl.SetRequestHeader("Authorization", "Bearer " api_key)
; Build the JSON payload
jsonY=

Gui, PleaseWait: +LastFound +AlwaysOnTop +Disabled -Caption +ToolWindow +hwndhGUIPleaseWait
Gui, PleaseWait: Color, FFFF00
Gui, PleaseWait: Add, Text,xm vTextA w200 Center, Please wait...
Gui, PleaseWait: Add, Text,xs vTextB w200 Center, Loading...
Gui, PleaseWait: Show,% "x300 y" (A_ScreenHeight/2),% hGUIPleaseWait

Gui, New, +hwndhGUIA +AlwaysOnTop ; +Owner +LastFound +E0x20 +Border +Caption +Resize -ToolWindow, hGUIA
Gui, Font, 	s12
Gui, Add, Tab3,,Main|TranslateJson|ResultJson|Settings
Gui, Tab, 1
;Gui, Add, Text,, Frage an ChatGPT:
Gui, Add, Edit,Section vSucheingabe hwndSucheingabe w540 r1, 
Gui, Add, Edit,xs vTranslateSucheingabe ReadOnly    w540 r1, 
Gui, Tab, 4
Gui, Add, Text,xs Section, API Key:
Gui, Add, Text,ys x+110, total_tokens: 
Gui, Add, Edit,ys  w220 vTextApiKey, Counter
 	Gui, Font, 	s11
Gui, Add, Edit,  xs vApi_key w540 h25 center Password,% api_key
 	Gui, Font, 	s12
Gui, Tab, 1
Gui, Add, Button, xs ys gButtonClick w200 h30 default  Section, Ask
Gui, Add, CheckBox, ys vErgebnisdatei w200 h30, Ergebnisdatei anzeigen
Gui, Add, Button, ys  gEditScript w30 h30,% Chr(0xE115)
Gui, Add, Button, ys gReloadApp w60 h30,% "Reload"
Gui, Add, Text,xs vAnswer, Answer
Gui, Add, Edit, vAnswerEdit r10 w540, 
Gui, Add, Text, vTextTranslate, Translate
Gui, Add, Edit, vAnswerEdit2 r10 w540, 
Gui, Tab, 2
Gui, Add, Text,, Json
Gui, Add, Edit, vJsonEdit r30 w540, 
Gui, Tab, 3
Gui, Add, Text,, Result
Gui, Add, Edit, vResultEdit r30 w540, 
;Gui, Show,% "x100 y" (A_ScreenHeight/10),% a_scriptname " - GuiHWND: " hGUIA  
 Gui, Show, x94 y11,% a_scriptname " - GuiHWND: " hGUIA  
Gui, PleaseWait: show, Hide
 	EM_SETCUEBANNER(Sucheingabe, a_space "Deine Frage an ChatGPT -- your question to ChatGPT")
Return

EM_SETCUEBANNER(HWND, Text) {
   ; EM_SETCUEBANNER = 0x1501 -> msdn.microsoft.com/en-us/library/bb761639(v=vs.85).aspx
   Return DllCall("SendMessage", "Ptr", HWND, "UInt", 0x1501, "Ptr", True, "WStr", Text, "Ptr")
}

EditScript:
; msgbox % TESTAnswer := FromUTF8("Köln ist ein wichtiges Zentrum für Kultur")
try run, notepad.exe %A_ScriptName%
return

RadioGroupAuswahl:
return
ToggleListview:
return
ReloadApp:
Gui, Submit, NoHide
reload
return

ButtonClick:
Gui, Submit, NoHide
GuiControlGet, Sucheingabe   ; https://ahkde.github.io/docs/v1/lib/GuiControlGet.htm#ExNoControlID
  	try TranslateSucheingabe := GoogleTranslate(Sucheingabe, "de", "en")
GuiControl,, TranslateSucheingabe,% TranslateSucheingabe
Sucheingabe := TranslateSucheingabe
;-----------
Gui, PleaseWait: Show,% "x300 y" (A_ScreenHeight/2),% AttemptNo
AttemptNo := 1
jsonY := thisJson(Sucheingabe)
curl.Send(jsonY)
JsonResult := curl.ResponseText
JsonResult:= FromUTF8(JsonResult)
thisArray := []
thisArray := JsonToAHK(JsonResult)
thisText  := Trim((thisArray["choices", 1, "text"]), " `n`r`t")  ; remove leading and trailing whitespaces

if thisText
GuiControl,, AnswerEdit, %thisText%
else{
errorMessage := thisArray["error", "message"]
GuiControl,, AnswerEdit,% errorMessage
try errorMessageTranslate := GoogleTranslate(errorMessage, "auto", "de")
GuiControl,, AnswerEdit2, %errorMessageTranslate%
}

if !errorMessage {
try thisTextTranslate := GoogleTranslate(thisText, "auto", "de")
GuiControl,, AnswerEdit2, %thisTextTranslate%
}

try thisBeautifyJson := BeautifyJson(JsonResult)
GuiControl,, ResultEdit, %thisBeautifyJson%
Gui, PleaseWait: show, Hide
thisAPI_completion_tokens := thisArray["usage", "completion_tokens"]
thisAPI_prompt_tokens     := thisArray["usage", "prompt_tokens"]
thisAPI_total_tokens      := thisArray["usage", "total_tokens"]
thisAPI_created		  := thisArray["created"] ; "`t"
logprobs                  := thisArray["choices", 1, "logprobs"]
   time := 1970
   time += thisAPI_created, s
   diff -= A_NowUTC, h
   time += diff, h
   FormatTime, TimeStamp, %time%, dd.MM.yyyy HH-mm-ss tt  ; 24.März.2018 05-20-37
GuiControl,, TextApiKey,% "[ " thisAPI_total_tokens " ]   " TimeStamp
logprobs := (logprobs=null) ? "null" : (thisArray["choices", 1, "logprobs"])

      this_ADD := "finish_reason:`n" 	 thisArray["choices", 1, "finish_reason"] "`n"
          . "################################################################`n"
          . "index:`n" 		 thisArray["choices", 1, "index"] "`n"
          . "################################################################`n"
          . "logprobs:`n" 	 logprobs "`n"
          . "################################################################`n"
          . "text:`n" 		 FromUTF8(thisText) "`n"
          . "################################################################`n"
          . "created:`n" 		 thisArray["created"] a_space TimeStamp "`n"
          . "################################################################`n"
          . "id:`n" 		 thisArray["id"] "`n"
          . "################################################################`n"
          . "model:`n" 		 thisArray["model"] "`n"
          . "################################################################`n"
          . "object:`n" 		 thisArray["object"] "`n"
          . "################################################################`n"
          . "completion_tokens:`n" thisArray["usage", "completion_tokens"] "`n"
          . "################################################################`n"
          . "prompt_tokens:`n" 	 thisArray["usage", "prompt_tokens"] "`n"
          . "################################################################`n"
          . "total_tokens:`n" 	 thisArray["usage", "total_tokens"] "`n"
          . "################################################################`n"

GuiControlGet, Sucheingabe   ; https://ahkde.github.io/docs/v1/lib/GuiControlGet.htm#ExNoControlID
GuiControlGet, MeinRadioA 
GuiControlGet, MeinRadioB 
GuiControlGet, MeinRadioC 
GuiControlGet, ToggleListview 
GuiControlGet, TextApiKey 
GuiControlGet, Api_key 
GuiControlGet, Answer 
GuiControlGet, AnswerEdit 
GuiControlGet, TextTranslate 
GuiControlGet, AnswerEdit2
GuiControlGet, JsonEdit
GuiControlGet, ResultEdit

allVars :=  "Sucheingabe:`n"    Sucheingabe "`n"
          . "################################################################`n"
	  . "MeinRadioA:`n"     MeinRadioA "`n"
          . "################################################################`n"
	  . "MeinRadioB:`n"     MeinRadioB "`n"
          . "################################################################`n"
	  . "MeinRadioC:`n"     MeinRadioC "`n"
          . "################################################################`n"
	  . "ToggleListview:`n" ToggleListview "`n"
          . "################################################################`n"
	  . "TextApiKey:`n"     TextApiKey "`n"
          . "################################################################`n"
	  . "Api_key:`n"        "******************************`n"
;	  . "Api_key:`n"        Api_key "`n"
          . "################################################################`n"
	  . "AnswerEdit:`n"     AnswerEdit "`n"
          . "################################################################`n"
	  . "AnswerEdit2:`n"    AnswerEdit2 "`n"
          . "################################################################`n"
	  . "Json File von ChatGPT:`n"     ResultEdit "`n"
          . "################################################################`n"
	  . "Json File der Google Übersetzung:`n"       JsonEdit "`n"
 this_ADD := this_ADD allVars 

if Ergebnisdatei {
Anow := A_now
fileappend,% this_ADD,% a_scriptdir "\" Anow " Ergebnisdatei.txt"
try run,% a_scriptdir "\" Anow " Ergebnisdatei.txt"
}
Return

FromUTF8(ByRef Txt, CP := "CP28591") { ; ISO-8859-1
   Size := StrPut(Txt, CP)
   VarSetCapacity(UTF8, Size, 0)
   StrPut(Txt, &UTF8, CP)
   Return StrGet(&UTF8, "UTF-8")
}

ttStop:
toolTip
return

GuiClose:
ExitApp

JsonToAHK(json, rec := false) {
   static doc := ComObjCreate("htmlfile")
         , __ := doc.write("<meta http-equiv=""X-UA-Compatible"" content=""IE=9"">")
         , JS := doc.parentWindow
   if !rec
      obj := %A_ThisFunc%(JS.eval("(" . json . ")"), true)
   else if !IsObject(json)
      obj := json
   else if JS.Object.prototype.toString.call(json) == "[object Array]" {
      obj := []
      Loop % json.length
         obj.Push( %A_ThisFunc%(json[A_Index - 1], true) )
   }
   else {
      obj := {}
      keys := JS.Object.keys(json)
      Loop % keys.length {
         k := keys[A_Index - 1]
         obj[k] := %A_ThisFunc%(json[k], true)
      }
   }

   Return obj
}

thisJson(ByRef Sucheingabe := "PROMPT") {
 ; Build the JSON payload
 		Sucheingabe := RegExReplace(Sucheingabe, "\""", """""")
 		Sucheingabe := RegExReplace(Sucheingabe, "\n", "``n")
 		jsonY=
		(
			{
			    "prompt": "%Sucheingabe%",
			    "max_tokens": 4000,
			    "temperature": 0.1
			}
		)
Return jsonY
}

BeautifyJson(json, indent := "    ") {
   static Doc, JS
   if !Doc {
      Doc := ComObjCreate("htmlfile")
      Doc.write("<meta http-equiv=""X-UA-Compatible"" content=""IE=9"">")
      JS := Doc.parentWindow
   }
   Return JS.eval("JSON.stringify(" . json . ",'','" . indent . "')")
}



;################################################################################################################

;MsgBox, % GoogleTranslate("今日の天気はとても良いです")
;MsgBox, % GoogleTranslate("Hello, World!", "en", "ru")

GoogleTranslate(str, from := "auto", to := "de") {
   static JS := CreateScriptObj(), _ := JS.( GetJScript() ) := JS.("delete ActiveXObject; delete GetObject;")
   
   json := SendRequest(JS, str, to, from, proxy := "")
   oJSON := JS.("(" . json . ")")

ATickCount := A_TickCount
try thisBeautifyJson := BeautifyJson(json)
GuiControl,, JsonEdit, %thisBeautifyJson%


   if !IsObject(oJSON[1]) {
      Loop % oJSON[0].length
         trans .= oJSON[0][A_Index - 1][0]
   }
   else {
      MainTransText := oJSON[0][0][0]
      Loop % oJSON[1].length {
         trans .= "`n+"
         obj := oJSON[1][A_Index-1][1]
         Loop % obj.length {
            txt := obj[A_Index - 1]
            trans .= (MainTransText = txt ? "" : "`n" txt)
         }
      }
   }
   if !IsObject(oJSON[1])
      MainTransText := trans := Trim(trans, ",+`n ")
   else
      trans := MainTransText . "`n+`n" . Trim(trans, ",+`n ")

   from := oJSON[2]
   trans := Trim(trans, ",+`n ")

   Return trans
}

SendRequest(JS, str, tl, sl, proxy) {
   static http
   ComObjError(false)
   if !http
   {
      http := ComObjCreate("WinHttp.WinHttpRequest.5.1")
      ( proxy && http.SetProxy(2, proxy) )
      http.open("GET", "https://translate.google.com", true)
      http.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0")
      http.send()
      http.WaitForResponse(-1)
   }
   http.open("POST", "https://translate.googleapis.com/translate_a/single?client=gtx"
                ; or "https://clients5.google.com/translate_a/t?client=dict-chrome-ex"
      . "&sl=" . sl . "&tl=" . tl . "&hl=" . tl
      . "&dt=at&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&ie=UTF-8&oe=UTF-8&otf=0&ssel=0&tsel=0&pc=1&kc=1"
      . "&tk=" . JS.("tk").(str), true)

   http.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8")
   http.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0")
   http.send("q=" . URIEncode(str))
   http.WaitForResponse(-1)
   Return http.responsetext
}

URIEncode(str, encoding := "UTF-8")  {
   VarSetCapacity(var, StrPut(str, encoding))
   StrPut(str, &var, encoding)

   while code := NumGet(Var, A_Index - 1, "UChar")  {
      bool := (code > 0x7F || code < 0x30 || code = 0x3D)
      UrlStr .= bool ? "%" . Format("{:02X}", code) : Chr(code)
   }
   Return UrlStr
}

GetJScript()
{
   script =
   (
      var TKK = ((function() {
        var a = 561666268;
        var b = 1526272306;
        return 406398 + '.' + (a + b);
      })());

      function b(a, b) {
        for (var d = 0; d < b.length - 2; d += 3) {
            var c = b.charAt(d + 2),
                c = "a" <= c ? c.charCodeAt(0) - 87 : Number(c),
                c = "+" == b.charAt(d + 1) ? a >>> c : a << c;
            a = "+" == b.charAt(d) ? a + c & 4294967295 : a ^ c
        }
        return a
      }

      function tk(a) {
          for (var e = TKK.split("."), h = Number(e[0]) || 0, g = [], d = 0, f = 0; f < a.length; f++) {
              var c = a.charCodeAt(f);
              128 > c ? g[d++] = c : (2048 > c ? g[d++] = c >> 6 | 192 : (55296 == (c & 64512) && f + 1 < a.length && 56320 == (a.charCodeAt(f + 1) & 64512) ?
              (c = 65536 + ((c & 1023) << 10) + (a.charCodeAt(++f) & 1023), g[d++] = c >> 18 | 240,
              g[d++] = c >> 12 & 63 | 128) : g[d++] = c >> 12 | 224, g[d++] = c >> 6 & 63 | 128), g[d++] = c & 63 | 128)
          }
          a = h;
          for (d = 0; d < g.length; d++) a += g[d], a = b(a, "+-a^+6");
          a = b(a, "+-3^+b+-f");
          a ^= Number(e[1]) || 0;
          0 > a && (a = (a & 2147483647) + 2147483648);
          a `%= 1E6;
          return a.toString() + "." + (a ^ h)
      }
   )
   Return script
}

CreateScriptObj() {
   static doc, JS, _JS
   if !doc {
      doc := ComObjCreate("htmlfile")
      doc.write("<meta http-equiv='X-UA-Compatible' content='IE=9'>")
      JS := doc.parentWindow
      if (doc.documentMode < 9)
         JS.execScript()
      _JS := ObjBindMethod(JS, "eval")
   }
   Return _JS
}

garry
Posts: 3758
Joined: 22 Dec 2013, 12:50

Re: ChatGPT GUI

Post by garry » 30 Mar 2023, 13:54

danke , funktioniert fein
lediglich ChatGPT liefert oft falsche Antwort ... :)

effel
Posts: 543
Joined: 16 Jan 2018, 13:34

Re: ChatGPT GUI

Post by effel » 30 Mar 2023, 15:08

garry wrote:
30 Mar 2023, 13:54
ChatGPT liefert oft falsche Antwort ... :)
Das wird sich in Zukunft sicherlich noch ändern. Es ist auf jeden Fall eine nette Spielerei

Die Daten von ChatGPT reichen auch laut eigenen Angaben des Chatbots nur bis September 2021

Wenn Just Me nichts mehr zu bemängeln hat werde ich es als mein erstes Werk in Skripte und Funktionen hinzufügen.

garry
Posts: 3758
Joined: 22 Dec 2013, 12:50

Re: ChatGPT GUI

Post by garry » 30 Mar 2023, 15:31

@effel danke

just me
Posts: 9442
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: ChatGPT GUI

Post by just me » 31 Mar 2023, 02:59

Moin @effel,
funktioniert gut.
effel wrote:Wenn Just Me nichts mehr zu bemängeln hat werde ich es als mein erstes Werk in Skripte und Funktionen hinzufügen.
Wenn ein Skript das Ergebnis liefert, das es soll, gibt es an sich nichts zu bemängeln. Eben weil AHK 1.1 meist mehrere Lösungswege mit unterschiedlicher Syntax anbietet, ist vieles mehr 'Geschmackssache'. So betrachtet würde ich mir für Skripte, die Andere benutzen und verstehen sollen, immer konsequente und konsistente Einrückungen wünschen. Für mich macht das die Skripte leichter lesbar und nachvollziehbar.

just me
Posts: 9442
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: ChatGPT GUI

Post by just me » 31 Mar 2023, 03:14

Noch eine Anmerkung zum Thema 'künstliche Intelligenz':
Aufgrund meiner Erfahrungen im berliner Straßenverkehr hoffe ich dringend, das möglichst bald Autos mit KI auf die Straßen gebracht werden. Bei vielen Fahrzeugen reicht die enthaltene 'natürliche Intelligenz' offensichtlich nicht aus, den Anforderungen des immer dichter werdenden Verkehrs gerecht zu werden.

effel
Posts: 543
Joined: 16 Jan 2018, 13:34

Re: ChatGPT GUI

Post by effel » 31 Mar 2023, 11:01

just me wrote:
31 Mar 2023, 02:59
konsequente und konsistente Einrückungen wünschen
Hallo Just Me

Erstmal alles Gute ich hoffe du bist bald genesen, bist du schon wieder Zuhause?

Zum Thema Einrückungen, du hast Recht, natürlich sieht das besser aus auch für mich als Anfänger+ kann ich dem Verlauf dann auch besser folgen. Wenn ich es in Scripte veröffentliche, habe ich das im Griff.

Zur Zeit bin ich aber noch am basteln, in der aktuellen Version habe ich die Sprachen erweitert

ChatGPT supports English, Spanish, French, German, Italian, Portuguese, Dutch, and Russian

Dadurch dass ich jede Anfrage grundsätzlich vorher ins Englische übersetze, erweitere ich diese Beschränkung, danke Google. Ich weiß grade nicht wieviele Sprachen übersetzt werden, aber Japanisch ist schonmal dabei...

Wie du siehst, ist in der Ausgabe Datei, die ich zu jeder Anfrage speichere, jedes Japanische Zeichen durch einen Platzhalter ersetzt. Nicht das es mir wichtig wäre, aber vielleicht ist es ja auch nur wenig Aufwand.

Komm gesund wieder Junge, wir brauchen dich hier ;)


03_31_23 @5_36_51.PNG
03_31_23 @5_36_51.PNG (81.23 KiB) Viewed 1741 times
03_31_23 @6_52_22.PNG
03_31_23 @6_52_22.PNG (65.64 KiB) Viewed 1734 times

Code: Select all

global ToggleLanguage ; := true

; Info: ChatGPT supports English, Spanish, French, German, Italian, Portuguese, Dutch, and Russian.

If !FileExist(A_ScriptDir "\history\")
FileCreateDir,% A_ScriptDir "\history\"
#singleinstance force
SetWorkingDir, %A_ScriptDir%
; Your OpenAI API key
; api_key := "INSERT_API_KEY_HERE"  ; https://platform.openai.com/account/api-keys
; The endpoint URL for the GPT-3 API
api_url := "https://api.openai.com/v1/engines/text-davinci-003/completions"

; Set up the cURL session
curl := ComObjCreate("WinHttp.WinHttpRequest.5.1")
curl.Open("POST", api_url)
curl.SetRequestHeader("Content-Type", "application/json")
curl.SetRequestHeader("Authorization", "Bearer " api_key)
; Build the JSON payload
jsonY=

Gui, PleaseWait: +LastFound +AlwaysOnTop +Disabled -Caption +ToolWindow +hwndhGUIPleaseWait
Gui, PleaseWait: Color, FFFF00
Gui, PleaseWait: Add, Text,xm vTextA w200 Center, Please wait...
Gui, PleaseWait: Add, Text,xs vTextB w200 Center, Loading...
Gui, PleaseWait: Show,% "x300 y" (A_ScreenHeight/2),% hGUIPleaseWait

Gui, New, +hwndhGUIA +AlwaysOnTop ; +Owner +LastFound +E0x20 +Border +Caption +Resize -ToolWindow, hGUIA
Gui, Font, 	s12
Gui, Add, Tab3,,Main|TranslateJson|ResultJson|Settings
Gui, Tab, 1
Gui, Add, Edit,Section vSucheingabe hwndSucheingabe w540 r1,      ; Deine Frage an ChatGPT ...
Gui, Add, Text, xs y+13 Section, your language:
Gui, Add, Edit,ys-5 vLang w40 r1 center, 
Gui, Add, DropDownList,xs vHistory w540 r1 choose1, History
Gui, Add, Edit,xs vTranslateSucheingabe hwndHTranslateSucheingabe center readonly  w540 r1, If the input language is not English, it will be translated beforehand
Gui, Tab, 4
Gui, Add, Text,xs Section, API Key:
Gui, Add, Text,ys x+110, total_tokens: 
Gui, Add, Edit,ys  w220 vTextApiKey, Counter
 	Gui, Font, 	s11
Gui, Add, Edit,  xs vApi_key w540 h25 center Password,% api_key
 	Gui, Font, 	s12
Gui, Tab, 1
Gui, Add, Button, xs ys gButtonClick w200 h30 default  Section, Ask
Gui, Add, CheckBox, ys vErgebnisdatei w200 h30 checked, Show result file
Gui, Add, Button, ys  gEditScript w30 h30,% Chr(0xE115)
Gui, Add, Button, ys gReloadApp w60 h30,% "Reload"
Gui, Add, Text,xs vAnswer, Answer ; immer en
Gui, Add, Edit, vAnswerEdit r10 w540, 
Gui, Add, Text, vTextTranslate w300, Translate
Gui, Add, Edit, vAnswerEdit2 r10 w540, 
Gui, Tab, 2
Gui, Add, Text,, Json
Gui, Add, Edit, vJsonEdit r30 w540, 
Gui, Tab, 3
Gui, Add, Text,, Result
Gui, Add, Edit, vResultEdit r30 w540, 
;Gui, Show,% "x100 y" (A_ScreenHeight/10),% a_scriptname " - GuiHWND: " hGUIA  
 Gui, Show, x94 y11,% a_scriptname " - GuiHWND: " hGUIA  
Gui, PleaseWait: show, Hide
 	EM_SETCUEBANNER(Sucheingabe, a_space "Deine Frage an ChatGPT -- your question to ChatGPT")
 	EM_SETCUEBANNER(HTranslateSucheingabe, "Request will be translated into English beforehand")
Return 

EM_SETCUEBANNER(HWND, Text) {
   ; EM_SETCUEBANNER = 0x1501 -> msdn.microsoft.com/en-us/library/bb761639(v=vs.85).aspx
   Return DllCall("SendMessage", "Ptr", HWND, "UInt", 0x1501, "Ptr", True, "WStr", Text, "Ptr")
}

EditScript:
; msgbox % TESTAnswer := FromUTF8("Köln ist ein wichtiges Zentrum für Kultur")
try run, notepad.exe %A_ScriptName%
return

RadioGroupAuswahl:
return
ToggleListview:
return
ReloadApp:
Gui, Submit, NoHide
reload
return

ButtonClick:
Gui, Submit, NoHide
if !Sucheingabe
Return

	GuiControlGet, Sucheingabe   ; https://ahkde.github.io/docs/v1/lib/GuiControlGet.htm#ExNoControlID
	try TranslateSucheingabe := GoogleTranslate(Sucheingabe, "auto", "en")
	GuiControl,, TranslateSucheingabe,% TranslateSucheingabe
	if TranslateSucheingabe
	Sucheingabe := TranslateSucheingabe
	;-----------
	Gui, PleaseWait: Show,% "x300 y" (A_ScreenHeight/2),% AttemptNo
	AttemptNo := 1
	jsonY := thisJson(Sucheingabe)
	curl.Send(jsonY)
	JsonResult := curl.ResponseText
	JsonResult:= FromUTF8(JsonResult)
	thisArray := []
	thisArray := JsonToAHK(JsonResult)
	thisText  := Trim((thisArray["choices", 1, "text"]), " `n`r`t")  ; remove leading and trailing whitespaces

		if thisText
		GuiControl,, AnswerEdit, %thisText%  ; immer en
	else{
		errorMessage := thisArray["error", "message"]
		GuiControl,, AnswerEdit,% errorMessage
		try errorMessageTranslate := GoogleTranslate(errorMessage, "auto", "de")
		GuiControl,, AnswerEdit2, %errorMessageTranslate%
		}

  if !errorMessage {
			GuiControlGet, lang
tooltip % lang
; msgbox,,, % lang
	;	if !(lang="")
	;	MsgBox % lang "`ndumm gelaufen"

		if (lang="de") {
				try thisTextTranslate := GoogleTranslate(thisText, "auto", "de")
				GuiControl,, lang,% "de"
				GuiControl,, AnswerEdit2,% thisTextTranslate
				GuiControl,, TextTranslate,% "Translate to: de"
;			 msgbox,,, % "`nA: " ToggleLanguage a_space lang  ; test
				}

		if (lang="en") {
				try thisTextTranslate := GoogleTranslate(thisText, "en", "de")
				GuiControl,, lang,% "en"
				GuiControl,, AnswerEdit2,% thisTextTranslate
				GuiControl,, TextTranslate,% "Translate to: de"
;			 msgbox,,, % "`nB: " ToggleLanguage a_space lang  ; test
				}else{

	;	if !(lang="de") and if !(lang="en") {
				try thisTextTranslate := GoogleTranslate(thisText, "en", lang)
				GuiControl,, lang,% lang
				GuiControl,, TextTranslate,% "Translate to: " lang
				GuiControl,, AnswerEdit2,% thisTextTranslate
;			msgbox,,, % "`nC: " ToggleLanguage a_space lang  ; test
		}
  }

try thisBeautifyJson := BeautifyJson(JsonResult)
GuiControl,, ResultEdit, %thisBeautifyJson%
Gui, PleaseWait: show, Hide
thisAPI_completion_tokens := thisArray["usage", "completion_tokens"]
thisAPI_prompt_tokens     := thisArray["usage", "prompt_tokens"]
thisAPI_total_tokens      := thisArray["usage", "total_tokens"]
thisAPI_created		  := thisArray["created"] ; "`t"
logprobs                  := thisArray["choices", 1, "logprobs"]
   time := 1970
   time += thisAPI_created, s
   diff -= A_NowUTC, h
   time += diff, h
   FormatTime, TimeStamp, %time%, dd.MM.yyyy HH-mm-ss tt  ; 24.März.2018 05-20-37
GuiControl,, TextApiKey,% "[ " thisAPI_total_tokens " ]   " TimeStamp
logprobs := (logprobs=null) ? "null" : (thisArray["choices", 1, "logprobs"])

;msgbox % thisArray[1, 1, 9, 1, 1, 2]

      this_ADD := "finish_reason:`n"	thisArray["choices", 1, "finish_reason"] "`n"
          . "################################################################`n"
          . "index:`n"			thisArray["choices", 1, "index"] "`n"
          . "################################################################`n"
          . "logprobs:`n"		logprobs "`n"
          . "################################################################`n"
          . "text:`n"			FromUTF8(thisText) "`n"
          . "################################################################`n"
          . "created:`n"		thisArray["created"] a_space TimeStamp "`n"
          . "################################################################`n"
          . "id:`n" 			thisArray["id"] "`n"
          . "################################################################`n"
          . "model:`n" 			thisArray["model"] "`n"
          . "################################################################`n"
          . "object:`n" 		thisArray["object"] "`n"
          . "################################################################`n"
          . "completion_tokens:`n" 	thisArray["usage", "completion_tokens"] "`n"
          . "################################################################`n"
          . "prompt_tokens:`n" 		thisArray["usage", "prompt_tokens"] "`n"
          . "################################################################`n"
          . "total_tokens:`n" 		thisArray["usage", "total_tokens"] "`n"
          . "################################################################`n"

GuiControlGet, Sucheingabe   ; https://ahkde.github.io/docs/v1/lib/GuiControlGet.htm#ExNoControlID
GuiControlGet, MeinRadioA 
GuiControlGet, MeinRadioB 
GuiControlGet, MeinRadioC 
GuiControlGet, ToggleListview 
GuiControlGet, TextApiKey 
GuiControlGet, Api_key 
GuiControlGet, Answer 
GuiControlGet, AnswerEdit 
GuiControlGet, TextTranslate 
GuiControlGet, AnswerEdit2
GuiControlGet, JsonEdit
GuiControlGet, ResultEdit

allVars :=  "Sucheingabe:`n"		Sucheingabe "`n"
          . "################################################################`n"
	  . "MeinRadioA:`n" 		MeinRadioA "`n"
          . "################################################################`n"
	  . "MeinRadioB:`n" 		MeinRadioB "`n"
          . "################################################################`n"
	  . "MeinRadioC:`n" 		MeinRadioC "`n"
          . "################################################################`n"
	  . "ToggleListview:`n" 	ToggleListview "`n"
          . "################################################################`n"
	  . "TextApiKey:`n" 		TextApiKey "`n"
          . "################################################################`n"
	  . "Api_key:`n" 		"******************************`n"
;	  . "Api_key:`n" 		Api_key "`n"
          . "################################################################`n"
	  . "AnswerEdit:`n" 		AnswerEdit "`n"
          . "################################################################`n"
	  . "AnswerEdit2:`n" 		AnswerEdit2 "`n"
          . "################################################################`n"
	  . "Json File von ChatGPT:`n" 	ResultEdit "`n"
          . "################################################################`n"
	  . "Json File der Google Übersetzung:`n"       JsonEdit "`n"
 this_ADD := this_ADD allVars 

Anow := A_now
fileappend,% this_ADD,% a_scriptdir "\history\" Anow " Ergebnisdatei.txt"
if Ergebnisdatei
try run,% a_scriptdir "\history\" Anow " Ergebnisdatei.txt"

if !TranslateSucheingabe
GuiControl,, lang,% ""

Return

FromUTF8(ByRef Txt, CP := "CP28591") { ; ISO-8859-1
   Size := StrPut(Txt, CP)
   VarSetCapacity(UTF8, Size, 0)
   StrPut(Txt, &UTF8, CP)
   Return StrGet(&UTF8, "UTF-8")
}

ttStop:
toolTip
return

GuiClose:
ExitApp

JsonToAHK(json, rec := false) {
   static doc := ComObjCreate("htmlfile")
         , __ := doc.write("<meta http-equiv=""X-UA-Compatible"" content=""IE=9"">")
         , JS := doc.parentWindow
   if !rec
      obj := %A_ThisFunc%(JS.eval("(" . json . ")"), true)
   else if !IsObject(json)
      obj := json
   else if JS.Object.prototype.toString.call(json) == "[object Array]" {
      obj := []
      Loop % json.length
         obj.Push( %A_ThisFunc%(json[A_Index - 1], true) )
   }
   else {
      obj := {}
      keys := JS.Object.keys(json)
      Loop % keys.length {
         k := keys[A_Index - 1]
         obj[k] := %A_ThisFunc%(json[k], true)
      }
   }

   Return obj
}

thisJson(ByRef Sucheingabe := "PROMPT") {
 ; Build the JSON payload
 		Sucheingabe := RegExReplace(Sucheingabe, "\""", """""")
 		Sucheingabe := RegExReplace(Sucheingabe, "\n", "``n")
 		jsonY=
		(
			{
			    "prompt": "%Sucheingabe%",
			    "max_tokens": 4000,
			    "temperature": 0.1
			}
		)
Return jsonY
}

BeautifyJson(json, indent := "    ") {
   static Doc, JS
   if !Doc {
      Doc := ComObjCreate("htmlfile")
      Doc.write("<meta http-equiv=""X-UA-Compatible"" content=""IE=9"">")
      JS := Doc.parentWindow
   }
   Return JS.eval("JSON.stringify(" . json . ",'','" . indent . "')")
}



;################################################################################################################

;MsgBox, % GoogleTranslate("今日の天気はとても良いです")
;MsgBox, % GoogleTranslate("Hello, World!", "en", "ru")

;GoogleTranslate(str, from := "auto", to := "de", ByRef ToggleLanguage := true) {
GoogleTranslate(str, from := "auto", to := "de") {
; static ToggleLanguage
; global ToggleLanguage
   static JS := CreateScriptObj(), _ := JS.( GetJScript() ) := JS.("delete ActiveXObject; delete GetObject;")
   
   json := SendRequest(JS, str, to, from, proxy := "")
   oJSON := JS.("(" . json . ")")

ATickCount := A_TickCount
try thisBeautifyJson := BeautifyJson(json)
GuiControl,, JsonEdit,% thisBeautifyJson
language  := JsonToAHK(thisBeautifyJson)
language  := (SubStr((language[1, 1, 9, 1, 1, 2]), 1, 2)) ? (SubStr((language[1, 1, 9, 1, 1, 2]), 1, 2))
           : language[3] ? language[3] 
           : language[9, 1, 1] ? language[9, 1, 1]
           : language[9, 4, 1] ? language[9, 4, 1]
           : "en"
;MsgBox % "Toogle:`t" ToggleLanguage "`tA_LineNumber:`t" A_LineNumber "language:`t" language 
fileappend,% "Toogle:`t" ToggleLanguage "`tA_LineNumber:`t" A_LineNumber "language:`t" language "`n",% a_scriptDir "\language.txt"
if ((ToggleLanguage  := !ToggleLanguage) ? true : false) {
;MsgBox % "Toogle:`t" ToggleLanguage "`tA_LineNumber:`t" A_LineNumber "language:`t" language 
fileappend,% "Toogle:`t" ToggleLanguage "`tA_LineNumber:`t" A_LineNumber "language:`t" language "`n",% a_scriptDir "\language.txt"

/*
if (language="en") 
GuiControl,, lang,% "en"
else
GuiControl,, lang,% language
*/
GuiControl,, lang,% language

toolTip % "`n" ToggleLanguage a_space language
setTimer, ttStop, -2000
;MsgBox % "Toogle:`t" ToggleLanguage "`tA_LineNumber:`t" A_LineNumber "language:`t" language 
}

   if !IsObject(oJSON[1]) {
      Loop % oJSON[0].length
         trans .= oJSON[0][A_Index - 1][0]
   }
   else {
      MainTransText := oJSON[0][0][0]
      Loop % oJSON[1].length {
         trans .= "`n+"
         obj := oJSON[1][A_Index-1][1]
         Loop % obj.length {
            txt := obj[A_Index - 1]
            trans .= (MainTransText = txt ? "" : "`n" txt)
         }
      }
   }
   if !IsObject(oJSON[1])
      MainTransText := trans := Trim(trans, ",+`n ")
   else
      trans := MainTransText . "`n+`n" . Trim(trans, ",+`n ")

   from := oJSON[2]
   trans := Trim(trans, ",+`n ")

   Return trans
}

SendRequest(JS, str, tl, sl, proxy) {
   static http
   ComObjError(false)
   if !http
   {
      http := ComObjCreate("WinHttp.WinHttpRequest.5.1")
      ( proxy && http.SetProxy(2, proxy) )
      http.open("GET", "https://translate.google.com", true)
      http.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0")
      http.send()
      http.WaitForResponse(-1)
   }
   http.open("POST", "https://translate.googleapis.com/translate_a/single?client=gtx"
                ; or "https://clients5.google.com/translate_a/t?client=dict-chrome-ex"
      . "&sl=" . sl . "&tl=" . tl . "&hl=" . tl
      . "&dt=at&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&ie=UTF-8&oe=UTF-8&otf=0&ssel=0&tsel=0&pc=1&kc=1"
      . "&tk=" . JS.("tk").(str), true)

   http.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8")
   http.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0")
   http.send("q=" . URIEncode(str))
   http.WaitForResponse(-1)
   Return http.responsetext
}

URIEncode(str, encoding := "UTF-8")  {
   VarSetCapacity(var, StrPut(str, encoding))
   StrPut(str, &var, encoding)

   while code := NumGet(Var, A_Index - 1, "UChar")  {
      bool := (code > 0x7F || code < 0x30 || code = 0x3D)
      UrlStr .= bool ? "%" . Format("{:02X}", code) : Chr(code)
   }
   Return UrlStr
}

GetJScript()
{
   script =
   (
      var TKK = ((function() {
        var a = 561666268;
        var b = 1526272306;
        return 406398 + '.' + (a + b);
      })());

      function b(a, b) {
        for (var d = 0; d < b.length - 2; d += 3) {
            var c = b.charAt(d + 2),
                c = "a" <= c ? c.charCodeAt(0) - 87 : Number(c),
                c = "+" == b.charAt(d + 1) ? a >>> c : a << c;
            a = "+" == b.charAt(d) ? a + c & 4294967295 : a ^ c
        }
        return a
      }

      function tk(a) {
          for (var e = TKK.split("."), h = Number(e[0]) || 0, g = [], d = 0, f = 0; f < a.length; f++) {
              var c = a.charCodeAt(f);
              128 > c ? g[d++] = c : (2048 > c ? g[d++] = c >> 6 | 192 : (55296 == (c & 64512) && f + 1 < a.length && 56320 == (a.charCodeAt(f + 1) & 64512) ?
              (c = 65536 + ((c & 1023) << 10) + (a.charCodeAt(++f) & 1023), g[d++] = c >> 18 | 240,
              g[d++] = c >> 12 & 63 | 128) : g[d++] = c >> 12 | 224, g[d++] = c >> 6 & 63 | 128), g[d++] = c & 63 | 128)
          }
          a = h;
          for (d = 0; d < g.length; d++) a += g[d], a = b(a, "+-a^+6");
          a = b(a, "+-3^+b+-f");
          a ^= Number(e[1]) || 0;
          0 > a && (a = (a & 2147483647) + 2147483648);
          a `%= 1E6;
          return a.toString() + "." + (a ^ h)
      }
   )
   Return script
}

CreateScriptObj() {
   static doc, JS, _JS
   if !doc {
      doc := ComObjCreate("htmlfile")
      doc.write("<meta http-equiv='X-UA-Compatible' content='IE=9'>")
      JS := doc.parentWindow
      if (doc.documentMode < 9)
         JS.execScript()
      _JS := ObjBindMethod(JS, "eval")
   }
   Return _JS
}



20230331173258 Ergebnisdatei.txt
Spoiler



Hallo @garry ich hoffe es gefällt dir 8-)
Last edited by effel on 31 Mar 2023, 19:35, edited 4 times in total.

garry
Posts: 3758
Joined: 22 Dec 2013, 12:50

Re: ChatGPT GUI

Post by garry » 31 Mar 2023, 13:20

@effel danke , könnte dies nie programmieren

Deine Skripts funktionieren einwandfrei welche ich gespeichert habe ( 7. / 19. / 30.März )

ich erhielt jetzt Fehler für den letzten Skript vom 31.März und auch für den vorletzten Skript vom 30.März
es erscheint öfter Tooltip > "Please wait ... Loading" und der Text unten :
################################################################
text:
package com.example.demo.controller;

import com.example.demo.entity.User;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserController {

@Autowired
private UserService userService;

@RequestMapping("/findAll")
public List<User> findAll(){
return userService.findAll();
}
}
################################################################

effel
Posts: 543
Joined: 16 Jan 2018, 13:34

Re: ChatGPT GUI

Post by effel » 31 Mar 2023, 13:57

garry wrote:
31 Mar 2023, 13:20
es erscheint öfter Tooltip > "Please wait ... Loading" und der Text unten :
...
text:
package com.example.demo.controller;
...
Hallo @garry den text kenne ich, sehe ihn auch manchmal, aber meistens dann wenn ich z.b. klicke ohne Anfragetext geschrieben zu haben.

Kannst du diese aktuelle Version erfolgreich testen? oder kommt das dauernd vor?

garry
Posts: 3758
Joined: 22 Dec 2013, 12:50

Re: ChatGPT GUI

Post by garry » 31 Mar 2023, 14:22

@effel ja , immer noch , lediglich nur beim letzen und vorletzten Skript
wobei ich beim letzten Skript zuerst vergessen hatte beim ersten Start den 'api_key' zu definieren , weiss nicht ob dies einen Einfluss hatte dass diese Meldungen immer noch erscheinen ( statt erwartete Antwort ) .

effel
Posts: 543
Joined: 16 Jan 2018, 13:34

Re: ChatGPT GUI

Post by effel » 31 Mar 2023, 14:54

garry wrote:
31 Mar 2023, 14:22
@effel ja , immer noch , lediglich nur beim letzen und vorletzten Skript
wobei ich beim letzten Skript zuerst vergessen hatte beim ersten Start den 'api_key' zu definieren , weiss nicht ob dies einen Einfluss hatte dass diese Meldungen immer noch erscheinen ( statt erwartete Antwort ) .
@garry

Es hat bei mir den ganzen Tag funktioniert, jetzt habe ich auch diese Problem.

Es liegt eindeutig an der Übersetzungen von Google, diese funktioniert grade nicht mit meinen Scripten die GoogleTranslate() nutzen.

du kannst das in der ergebnis.txt daran erkennen, das ganz unten unter:

################################################################
Json File der Google Übersetzung:


nichts mehr steht. Normalerweise wäre dort das Json Antwort File von GoogleTranslate()

Mit den alten Versionen müsste es aber noch gehen.

Bleibt nur abwarten und hoffen das es nur vorübergehend ist. Wenn das öfter vorkommt, kann ich das aber fixen, sodass es trotzdem eingeschränkt läuft

Danke dir für deinen Beitrag, ein wenig Echo tut ganz gut

effel
Posts: 543
Joined: 16 Jan 2018, 13:34

Re: ChatGPT GUI

Post by effel » 31 Mar 2023, 15:21

Ich habe es auf die schnelle unschön gefixt mit if TranslateSucheingabe

Code: Select all

...Gui, Submit, NoHide
	GuiControlGet, Sucheingabe   ; https://ahkde.github.io/docs/v1/lib/GuiControlGet.htm#ExNoControlID
	try TranslateSucheingabe := GoogleTranslate(Sucheingabe, "auto", "en")
	GuiControl,, TranslateSucheingabe,% TranslateSucheingabe
	if TranslateSucheingabe
	Sucheingabe := TranslateSucheingabe
	;-----------
	Gui, PleaseWait: Show,% "x300 y" (A_ScreenHeight/2),% AttemptNo
	...

So sieht es ohne Übersetzung aus:

03_31_23 @10_28_17.PNG
03_31_23 @10_28_17.PNG (44.26 KiB) Viewed 1702 times

Post Reply

Return to “Ich brauche Hilfe”