vanshksingh / M5Cardputer-Chat-with-Gemini-API

M5Cardputer Chat with Gemini API: An application that uses M5Cardputer to interact with the Gemini API for generating responses based on user input. This project includes code for managing Wi-Fi connectivity, user input handling, API requests, and displaying responses on the M5Cardputer's screen.
28 stars 3 forks source link

Misc HTTP Errors after question #2

Closed PatsBotBench closed 5 months ago

PatsBotBench commented 5 months ago

Some questions give a repetitive message of HTTP error: - ## where ## seems to vary. "Describe Relativity" or "Describe Novelty" generate the behavior.

Notes. The Bin is sideloaded by M5Launcher. When the problem occurs, the "Generating Response" stays fixed and the LED's stay blue until the HTTP error in repeats 4 times in red and then the white prompt appears and the LED goes to Sea green. The HTTP error messages remain as does the "Generating Response" until a new question is answered. The formatting and scrolling of the new answer seems off.

Thanks again...This has a lot of potential.

vanshksingh commented 5 months ago

I can't seem to zero down on why those random http error happen , for now I have added an implementation where it prints the full response as to what error happen. Hopefully for more debugging , Code is located in Gemini-Development Folder rn , I will merge it with main on 15th May

PatsBotBench commented 5 months ago

Thank YOU !! Both for code and for working on the issues.!

PatsBotBench commented 5 months ago

Hi, I Downloaded and tried to compile to binary. Unfortunately code seems too big to compile??

"Sketch uses 1490893 bytes (113%) of program storage space. Maximum is 1310720 bytes. Global variables use 65624 bytes (20%) of dynamic memory, leaving 262056 bytes for local variables. Maximum is 327680 bytes. Sketch too big; see https://support.arduino.cc/hc/en-us/articles/360013825179 for tips on reducing it. text section exceeds available space in board

Compilation error: text section exceeds available space in board"

Let me know work around?

Thanks again!

vanshksingh commented 5 months ago

Yes ! that was the biggest issue , and that was stopping me from including images and making the ui better , do this to fix that issue

Screenshot 2024-05-11 at 6 44 20 PM

make Sure to keep the header files in the same file as the .ino sketch

Screenshot 2024-05-11 at 6 47 41 PM

Also Set this to

String userInput = ""
String geminiResponse =""

I added the text to check scrolling

UP = Fn + ";" DOWN = Fn + "."

PatsBotBench commented 5 months ago

HI,

WOW...I didn't expect the new stuff in there as well. Its a big improvement to the UX!! I like the step wise images and using the lower blue area for query entry.

Notes: 1) Define relativity gave a cogent response every time. Define E=MC^2 gave an initial HTTP - 11 with HTTP Response timeout after the Thinking Image. Instead of going 4 times as before, It delayed a bit and then gave a cogent response. 2) Long answers get wrapped at bottom and I had difficulties with the scroll. 3) First time around it had trouble connecting to my wifi...it showed a list of 4 choices and I was unable to scroll to choose. On reboot it connected straight away.

All in all, VERY solid work and steps forward on what I think will become a mainstay in my kit. I've already started training my own model using the Dev API key and I can see the effects in its answers...soon I'll have a personal CPAiBot.

Thanks again for your efforts on this.

vanshksingh commented 5 months ago

Thank you for your kind words ! , it is available on m5 burner now , I fixed text mapping , and in the next revision I'll add a splash screen with controls