Overview
The Moonshot AI Java Client provides a comprehensive Java implementation for the Moonshot AI API. It is based on the Spring AI project’s Moonshot integration and has been extracted to be used as a standalone library. Moonshot AI provides powerful Chinese language models with varying context windows to suit different use cases.Features
Chat Models
Comprehensive implementation supporting moonshot-v1-8k, moonshot-v1-32k, and moonshot-v1-128k
Flexible Configuration
Extensive customization options including temperature, max tokens, and top-p sampling
Streaming Responses
Support for token-by-token streaming for interactive applications
Function Calling
Register custom Java functions that Moonshot models can intelligently invoke
Robust Error Handling
Built-in retry mechanism with configurable exponential backoff
Observability
Integration with Micrometer for metrics collection and performance monitoring
Quick Start
Add Dependency
Basic Usage
Project Structure
This is a multi-module Maven project:moonshot-parent
- Parent POM with dependency managementmoonshot-core
- Core implementation of the Moonshot AI clientdocs
- Documentation module built with Antora
Requirements
- Java 17 or higher
- Maven 3.6.3 or higher
Resources
GitHub Repository
View source code and contribute
Documentation
Full documentation (will be published to GitHub Pages)