ESP32-ChatGLM for Custom Conversations - 中文文档
Technological achievements from Tsinghua University ---> "ChatGLM" 🇨🇳 on Espressif's ESP32 platform by Arduino!
Use the official asynchronous calling method to request its API. The API is obtained from the following websites:
API receive : https://open.bigmodel.cn/
Download Arduino IDE and install it. Open the IDE and find the File -> Perference.
Please Use ESP32 Addritional boards manager URLs.
Download the Project and Download libraries. (Build in just use it, otherwise download it) These are libraries for this project:
#include <Arduino.h> //build in
#include <CustomJWT.h> //find from library
#include <ESPAsyncWebServer.h> // Get from https://github.com/me-no-dev/ESPAsyncWebServer
#include <ArduinoJson.h> //find from library
#include <WiFiClientSecure.h> //build in
#include <WiFiUdp.h> //build in
#include <time.h> //build in
#include <HTTPClient.h> //find from library
FInd the library folder and find the CustomJWT Folder. (I also upload CustomJWT.h
file☝️)
Find the CustomJWT.h file in src folder. to add some code in CustomJWT(........) (in brackets)
char *sign_type = "SIGN"
add under char *typ = "JWT"
for each CustomJWT method!
IMPORTANT!
there got a problem for Library JWT library(The Library name called: CustomJWT)
sprintf(headerJSON, "{\"alg\": \"%s\",\"typ\":\"%s\",\"sign_type\":\"%s\"}", alg, typ, sign_type);
Error:
The is a problem between "alg": "%s"which has a space between "alg": and "%s"! Please delete it! if not it will show different Base64 code.
sprintf(headerJSON, "{\"alg\":\"%s\",\"typ\":\"%s\",\"sign_type\":\"%s\"}", alg, typ, sign_type);
Paste the project for ChatGLM.ino
and index.h
into your own project folder and start it to change your personal API and WiFI(You can change your own local the NTP) and even you can design your personal Webpage for index.h
file
Connect the ESP32 Module by Serial Port and PC's USB. Please choose correct ESP32 board to PC, Mine is ESP32-S3
Finally Happy Flashing your ESP32 device! 😄🥇
Last thanks to @JoinChang and other libraries providers 👍