From 979efd7ee173deeef3ec113e79254eb686270e33 Mon Sep 17 00:00:00 2001 From: Austin Strange Date: Tue, 20 Jun 2023 20:03:02 +0300 Subject: [PATCH 1/2] fix missing query --- lib/google_bard.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/google_bard.rb b/lib/google_bard.rb index 83bb61c..59b2a97 100644 --- a/lib/google_bard.rb +++ b/lib/google_bard.rb @@ -46,7 +46,7 @@ def completion(text_input) # Send the request with the payload in the body response = HTTParty.post( 'https://bard.google.com/_/BardChatUi/data/assistant.lamda.BardFrontendService/StreamGenerate', - query:, + query: query, body: payload(text_input), headers: HEADERS, cookies: { '__Secure-1PSID' => @token }, @@ -100,4 +100,4 @@ def handle_response(response) ) end end -end \ No newline at end of file +end From 18125cd4946c7344bc0b7d9ddf995759e268503b Mon Sep 17 00:00:00 2001 From: Austin Strange Date: Tue, 20 Jun 2023 20:21:50 +0300 Subject: [PATCH 2/2] add some logs of response to see error --- lib/google_bard.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/google_bard.rb b/lib/google_bard.rb index 59b2a97..c6eac23 100644 --- a/lib/google_bard.rb +++ b/lib/google_bard.rb @@ -52,7 +52,10 @@ def completion(text_input) cookies: { '__Secure-1PSID' => @token }, timeout: @timeout ) - + puts "*********************" + puts "Google Answer:" + puts response + puts "*********************" handle_response(response) end