Skip to content

Commit db96501

Browse files
committed
streaming support for openai/gemini/claude/deepseek/opena-compatible ai platforms
1 parent 04dee5a commit db96501

16 files changed

+2600
-649
lines changed

README.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
[![Platform](https://img.shields.io/badge/Platform-ESP32-blue.svg)](https://www.espressif.com/en/products/socs/esp32)
55
[![Language](https://img.shields.io/badge/Language-Arduino-teal.svg)](https://www.arduino.cc/)
66
[![AvantMaker](https://img.shields.io/badge/By-AvantMaker-red.svg)](https://www.avantmaker.com)
7+
---
8+
> README Version 0.0.5 • Revised: May 26, 2025 • Author: AvantMaker • [https://www.AvantMaker.com](https://www.AvantMaker.com)
79
810
This project is proudly brought to you by the team at **AvantMaker.com**.
911

@@ -27,6 +29,7 @@ ESP32_AI_Connect is an Arduino library that enables ESP32 microcontrollers to in
2729

2830
- **Multi-platform support**: Single interface for different AI providers
2931
- **Tool calls support**: Enables tool call capabilities with AI models
32+
- **Streaming support**: Supports streaming communication with AI model, featuring thread safety, user interruption, etc.
3033
- **Expandable framework**: Built to easily accommodate additional model support
3134
- **Configurable features**: Enable/disable tool calls feature to optimize microcontroller resources
3235
- **OpenAI-compatible support**: Use alternative platforms by supplying custom endpoints and model names
@@ -44,20 +47,20 @@ ESP32_AI_Connect is an Arduino library that enables ESP32 microcontrollers to in
4447

4548
| Platform | Identifier | Example Models | Tool Calls Support | Streaming Support |
4649
|-------------------|----------------------|---------------------------------|-------------------|-------------------|
47-
| OpenAI | `"openai"` | gpt-3.5, gpt-4, etc. | Yes | Under Development |
48-
| Google Gemini | `"gemini"` | gemini-2.0-flash, gemini-2.5, etc. | Yes | Under Development |
49-
| DeepSeek | `"deepseek"` | deepseek-chat, etc. | Yes | Under Development |
50-
| Anthropic Claude | `"claude"`| claude-3.7-sonnet, claude-3.5-haiku, etc. | Yes | Under Development |
51-
| OpenAI Compatible | `"openai-compatible"`| HuggingFace, OpenRouter, etc. | See Note 1 below | Under Development |
50+
| OpenAI | `"openai"` | gpt-3.5, gpt-4, etc. | Yes | Yes |
51+
| Google Gemini | `"gemini"` | gemini-2.0-flash, gemini-2.5, etc. | Yes | Yes |
52+
| DeepSeek | `"deepseek"` | deepseek-chat, etc. | Yes | Yes |
53+
| Anthropic Claude | `"claude"`| claude-3.7-sonnet, claude-3.5-haiku, etc. | Yes | Yes |
54+
| OpenAI Compatible | `"openai-compatible"`| HuggingFace, OpenRouter, etc. | See Note 1 below | See Note 1 below |
5255

53-
**Note 1:** Tool call support differs by platform and model, so the availability of the `tool_calls` feature on the OpenAI Compatible platform depends on your chosen platform and model.
56+
**Note 1:** Tool calls and Streaming support differ by AI platform and LLM model, so the availability of the `tool_calls` and `streaming` feature on the OpenAI Compatible platform depends on your chosen platform and model.
5457

5558
**Note 2:** We are actively working to add Grok and Ollama to the list of supported platforms.
5659

5760

5861
## Dependency
5962

60-
The **ESP32_AI_connect** library depends on the **ArduinoJson** library (version 7.0.0 or higher) to function properly. For more details about the ArduinoJson library, please visit its official website: [https://arduinojson.org/](https://arduinojson.org/)
63+
The **ESP32_AI_Connect** library depends on the **ArduinoJson** library (version 7.0.0 or higher) to function properly. For more details about the ArduinoJson library, please visit its official website: [https://arduinojson.org/](https://arduinojson.org/)
6164

6265
## Installation
6366

@@ -157,6 +160,18 @@ Tool calls (a.k.a. tool calling or tool use) enable the AI model to request spec
157160
- Context preservation : Maintain conversation context throughout tool interactions
158161
This capability is ideal for creating more sophisticated applications where the AI needs to access sensor data, control hardware, or perform calculations using your ESP32.
159162
163+
## Streaming Chat Support
164+
Streaming chat enables real-time interaction with AI models by delivering responses as they are generated, creating a more natural and engaging user experience. This feature allows:
165+
166+
- **Real-time Response**: See AI responses as they are generated, word by word
167+
- **Interactive Experience**: More natural, conversation-like interaction
168+
- **Immediate Feedback**: Get instant responses without waiting for complete generation
169+
- **User Control**: Interrupt or stop responses at any time
170+
- **Performance Metrics**: Monitor streaming performance with detailed statistics
171+
- **Multi-platform Support**: Works with OpenAI, Claude, Gemini, DeepSeek, and Open-Compatible platforms
172+
- **Thread-safe Design**: Built on FreeRTOS primitives for reliable operation
173+
- **Memory Efficient**: Optimized for ESP32's limited resources
174+
160175
## User Guide
161176
162177
For detailed instructions on how to use this library, please refer to the comprehensive User Guide documents in the `doc/User Guide` folder. The User Guide includes:
@@ -177,10 +192,12 @@ Edit ESP32_AI_Connect_config.h to customize the library to your specific needs:
177192
#define USE_AI_API_OPENAI
178193
#define USE_AI_API_GEMINI
179194
#define USE_AI_API_DEEPSEEK
195+
#define USE_AI_API_CLAUDE
180196
181197
// Feature toggles - disable to save resources
182198
#define ENABLE_TOOL_CALLS // Enable/disable tool calls support
183199
#define ENABLE_DEBUG_OUTPUT // Enable/disable debug messages
200+
#define ENABLE_STREAM_CHAT // // Enable/disable streaming support
184201
185202
// Memory allocation
186203
#define AI_API_REQ_JSON_DOC_SIZE 1024
@@ -202,4 +219,4 @@ MIT License - See [LICENSE](LICENSE) for details.
202219

203220
---
204221

205-
💡 **Check out our other ESP32 libraries at [AvantMaker GitHub](https://github.com/avantmaker)!**
222+
💡 **Check out our other ESP32 libraries at [AvantMaker GitHub](https://github.com/avantmaker)!**

0 commit comments

Comments
 (0)