/ESP32-ChatGLM

Using the Chinese version of ChatGPT -- "ChatGLM" on Espressif's ESP32 platform by Arduino!

Primary LanguageC++Apache License 2.0Apache-2.0

ESP32-ChatGLM for Custom Conversations - 中文文档

Technological achievements from Tsinghua University ---> "ChatGLM" 🇨🇳 on Espressif's ESP32 platform by Arduino!

ESP32-ChatGLM Project

Use the official asynchronous calling method to request its API. The API is obtained from the following websites:

API receive : https://open.bigmodel.cn/

1

Please Following Steps below⚠️:

Steps 1

Download Arduino IDE and install it. Open the IDE and find the File -> Perference.

Please Use ESP32 Addritional boards manager URLs.

Step 2

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

Step 3(Hard step) 🤨

FInd the library folder and find the CustomJWT Folder. (I also upload CustomJWT.h file☝️)

(Watch here!)

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!

Image

IMPORTANT! there got a problem for Library JWT library(The Library name called: CustomJWT)

Incorrect Code in CustomJWT.h file

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.

Fix the Code in CustomJWT.h file

sprintf(headerJSON, "{\"alg\":\"%s\",\"typ\":\"%s\",\"sign_type\":\"%s\"}", alg, typ, sign_type);

Step4 📄

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

Step 5 💻

Connect the ESP32 Module by Serial Port and PC's USB. Please choose correct ESP32 board to PC, Mine is ESP32-S3

Image

Finally Happy Flashing your ESP32 device! 😄🥇


Last thanks to @JoinChang and other libraries providers 👍