chatgpt-stream  by NiuXiangQian

Java Spring Boot integration for OpenAI models

created 2 years ago
273 stars

Top 95.3% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a minimalist Java implementation for integrating with OpenAI's streaming API, targeting developers building business systems with Spring Boot. It enables features like chat memory and image generation with support for markdown and code block highlighting, simplifying the creation of conversational AI applications.

How It Works

The core of the project leverages Spring Boot and Server-Sent Events (SSE) for efficient, real-time streaming of responses from OpenAI models like GPT-3.5-turbo and GPT-4. It includes built-in chat memory management and an interface for image generation, aiming for a dependency-free, easy-to-integrate solution.

Quick Start & Requirements

  • Install/Run: Start a Spring Boot application.
  • Prerequisites: Java, Spring Boot, OpenAI API Key. VPN required for mainland China access.
  • Configuration: Set OpenAI API keys in application.yaml. Proxy configuration is available in OpenAiWebClient.java.
  • Docs: GitHub Repository

Highlighted Details

  • No third-party dependencies beyond Spring Boot.
  • Supports streaming responses via SSE.
  • Implements chat memory and image generation capabilities.
  • Handles markdown syntax and code block highlighting.

Maintenance & Community

The project was last updated in June 2023 with robustness optimizations and SSE exception handling. Community interaction is encouraged via GitHub Issues and Pull Requests.

Licensing & Compatibility

The repository does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

The UI is noted as basic and not professionally designed. Future features like image generation are marked as planned but not yet implemented.

Health Check
Last commit

2 weeks ago

Responsiveness

1 day

Pull Requests (30d)
1
Issues (30d)
1
Star History
2 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.