Skip to content

Commit 06d0890

Browse files
committed
Esp32 & Esp8266 HTML bug fix 🩹
1 parent 8637ff9 commit 06d0890

File tree

12 files changed

+251
-20
lines changed

12 files changed

+251
-20
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <AIChatbot.h>
2+
3+
AIChatbot chatbot;
4+
5+
void setup() {
6+
Serial.begin(115200);
7+
chatbot.setKey("YOUR_CHATGPT_API_KEY", "chatgpt");
8+
chatbot.connectWiFi("YOUR_SSID", "YOUR_PASSWORD");
9+
chatbot.selectAI("chatgpt", "gpt-3.5-turbo");
10+
}
11+
12+
void loop() {
13+
if (Serial.available() > 0) {
14+
String incomingMessage = Serial.readString();
15+
String message = "Translate this text to France: " + incomingMessage;
16+
String response = chatbot.getResponse(message);
17+
Serial.println("Translation: " + response);
18+
}
19+
}

examples/Datatest/ChatGpt.ino

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include <AIChatbot.h>
2+
3+
AIChatbot chatbot;
4+
5+
void setup() {
6+
//changed to ESP32 115200 or ESP8266 9600
7+
Serial.begin(115200);
8+
9+
// Set ChatGPT API key
10+
chatbot.setKey("YOUR_CHATGPT_API_KEY", "chatgpt");
11+
12+
// Begin WiFi connection
13+
chatbot.connectWiFi("YOUR_SSID", "YOUR_PASSWORD");
14+
15+
// Select AI and specify version
16+
chatbot.selectAI("chatgpt", "gpt-3.5-turbo");
17+
}
18+
19+
void loop() {
20+
// Update and handle incoming messages
21+
chatbot.update();
22+
}

examples/Datatest/HuggingFace.ino

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <AIChatbot.h>
2+
3+
AIChatbot chatbot;
4+
5+
void setup() {
6+
//changed to ESP32 115200 or ESP8266 9600
7+
Serial.begin(115200);
8+
9+
// Set API keys
10+
chatbot.setKey("HUGGING FACE API KEY", "huggingface");
11+
12+
//Begin WiFi connection
13+
chatbot.connectWiFi("YOUR_SSID", "YOUR_PASSWORD");
14+
15+
// Select AI and optionally specify version
16+
// Tested and used google/flan-t5-small
17+
chatbot.selectAI("huggingface", "google/flan-t5-small");
18+
}
19+
20+
void loop() {
21+
// Update and handle incoming messages
22+
chatbot.update();
23+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include <AIChatbot.h>
2+
3+
AIChatbot chatbot;
4+
5+
void setup() {
6+
Serial.begin(115200);
7+
chatbot.setKey("YOUR_CHATGPT_API_KEY", "chatgpt");
8+
chatbot.connectWiFi("YOUR_SSID", "YOUR_PASSWORD");
9+
chatbot.selectAI("chatgpt", "gpt-3.5-turbo");
10+
}
11+
12+
void loop() {
13+
if (Serial.available() > 0) {
14+
String incomingMessage = Serial.readString();
15+
String response = chatbot.getResponse(incomingMessage);
16+
Serial.println("Answer: " + response);
17+
}
18+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <AIChatbot.h>
2+
3+
AIChatbot chatbot;
4+
5+
void setup() {
6+
Serial.begin(115200);
7+
chatbot.setKey("YOUR_CHATGPT_API_KEY", "chatgpt");
8+
chatbot.connectWiFi("YOUR_SSID", "YOUR_PASSWORD");
9+
chatbot.selectAI("chatgpt", "gpt-3.5-turbo");
10+
}
11+
12+
void loop() {
13+
if (Serial.available() > 0) {
14+
String incomingMessage = Serial.readString();
15+
String message = "Generate a text about: " + incomingMessage;
16+
String response = chatbot.getResponse(message);
17+
Serial.println("Generated Text: " + response);
18+
}
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <AIChatbot.h>
2+
3+
AIChatbot chatbot;
4+
5+
void setup() {
6+
Serial.begin(115200);
7+
chatbot.setKey("YOUR_CHATGPT_API_KEY", "chatgpt");
8+
chatbot.connectWiFi("YOUR_SSID", "YOUR_PASSWORD");
9+
chatbot.selectAI("chatgpt", "gpt-3.5-turbo");
10+
}
11+
12+
void loop() {
13+
if (Serial.available() > 0) {
14+
String incomingMessage = Serial.readString();
15+
String message = "Summarize the following text: " + incomingMessage;
16+
String response = chatbot.getResponse(message);
17+
Serial.println("Summary: " + response);
18+
}
19+
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=AIChatBot
2-
version=1.1.0
2+
version=1.2.0
33
author=bay_Eggex <https://github.com/bayeggex>
44
maintainer=bay_Eggex
55
sentence=AI Chat Library for Arduino

src/.vscode/c_cpp_properties.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "windows-gcc-x86",
5+
"includePath": [
6+
"${workspaceFolder}/**"
7+
],
8+
"compilerPath": "C:/MinGW/bin/gcc.exe",
9+
"cStandard": "${default}",
10+
"cppStandard": "${default}",
11+
"intelliSenseMode": "windows-gcc-x86",
12+
"compilerArgs": [
13+
""
14+
]
15+
}
16+
],
17+
"version": 4
18+
}

src/.vscode/launch.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "C/C++ Runner: Debug Session",
6+
"type": "cppdbg",
7+
"request": "launch",
8+
"args": [],
9+
"stopAtEntry": false,
10+
"externalConsole": true,
11+
"cwd": "c:/Users/bayeg/OneDrive/Documents/Arduino-AI-Chat-Library/src",
12+
"program": "c:/Users/bayeg/OneDrive/Documents/Arduino-AI-Chat-Library/src/build/Debug/outDebug",
13+
"MIMode": "gdb",
14+
"miDebuggerPath": "gdb",
15+
"setupCommands": [
16+
{
17+
"description": "Enable pretty-printing for gdb",
18+
"text": "-enable-pretty-printing",
19+
"ignoreFailures": true
20+
}
21+
]
22+
}
23+
]
24+
}

src/.vscode/settings.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"C_Cpp_Runner.cCompilerPath": "gcc",
3+
"C_Cpp_Runner.cppCompilerPath": "g++",
4+
"C_Cpp_Runner.debuggerPath": "gdb",
5+
"C_Cpp_Runner.cStandard": "",
6+
"C_Cpp_Runner.cppStandard": "",
7+
"C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat",
8+
"C_Cpp_Runner.useMsvc": false,
9+
"C_Cpp_Runner.warnings": [
10+
"-Wall",
11+
"-Wextra",
12+
"-Wpedantic",
13+
"-Wshadow",
14+
"-Wformat=2",
15+
"-Wcast-align",
16+
"-Wconversion",
17+
"-Wsign-conversion",
18+
"-Wnull-dereference"
19+
],
20+
"C_Cpp_Runner.msvcWarnings": [
21+
"/W4",
22+
"/permissive-",
23+
"/w14242",
24+
"/w14287",
25+
"/w14296",
26+
"/w14311",
27+
"/w14826",
28+
"/w44062",
29+
"/w44242",
30+
"/w14905",
31+
"/w14906",
32+
"/w14263",
33+
"/w44265",
34+
"/w14928"
35+
],
36+
"C_Cpp_Runner.enableWarnings": true,
37+
"C_Cpp_Runner.warningsAsError": false,
38+
"C_Cpp_Runner.compilerArgs": [],
39+
"C_Cpp_Runner.linkerArgs": [],
40+
"C_Cpp_Runner.includePaths": [],
41+
"C_Cpp_Runner.includeSearch": [
42+
"*",
43+
"**/*"
44+
],
45+
"C_Cpp_Runner.excludeSearch": [
46+
"**/build",
47+
"**/build/**",
48+
"**/.*",
49+
"**/.*/**",
50+
"**/.vscode",
51+
"**/.vscode/**"
52+
],
53+
"C_Cpp_Runner.useAddressSanitizer": false,
54+
"C_Cpp_Runner.useUndefinedSanitizer": false,
55+
"C_Cpp_Runner.useLeakSanitizer": false,
56+
"C_Cpp_Runner.showCompilationTime": false,
57+
"C_Cpp_Runner.useLinkTimeOptimization": false,
58+
"C_Cpp_Runner.msvcSecureNoWarnings": false
59+
}

0 commit comments

Comments
 (0)