Welcome to the ChatMotor API Java Samples repository! This project contains a collection of ready-to-use Java samples demonstrating how to integrate and utilize the powerful features of the ChatMotor API in your Java applications.
ChatMotor is a versatile API designed to seamlessly integrate ChatGPT capabilities into Java applications. With a focus on simplifying complex tasks, ChatMotor offers a rich set of features, including:
- Large File Handling: Efficiently manage large files with automatic chunking and processing.
- Advanced Transcription: Transcribe audio files of any size without the 25MB OpenAI Whisper limitation.
- Text-to-Speech: Convert text to speech with no input size limitations.
- Comprehensive Summarization: Generate classic and strategic summaries for large text documents.
- Robust Translation: Translate documents with preserved formatting, including HTML and other text formats.
- Error Handling: Manage OpenAI errors with detailed extraction and handling mechanisms.
- Document Conversion: Convert various document formats to plain text using integrated utilities.
This repository includes sample code to help you get started with the following ChatMotor API functionalities:
- Text Summarization: Generate concise summaries of large text documents.
- Strategic Summarization: Create high-level, strategic summaries focusing on key insights.
- Document Translation: Translate text and HTML documents, with future support for additional formats.
- Audio Transcription: Transcribe audio files of any size into text.
- Text-to-Speech Conversion: Convert text to speech and save it as audio files.
- Error Management: Handle OpenAI errors effectively in your applications.
- File Conversion Utilities: Convert various document formats to plain text for further processing.
Before running the samples, ensure you have the following prerequisites:
- Java Development Kit (JDK): Version 11 or higher.
- Maven: For managing project dependencies.
- ChatGPT: Obtain an API key from the OpenAI Website.
Clone the Repository:
git clone https://github.com/yourusername/chatmotor-java-samples.git
Set Up Environment Variables:
Ensure that the following environment variables are set:
export CHATMOTOR_HOME=/path/to/chatmotor-api-1.2-beta
export MOTOR_API_KEY=your_openai_api_key
Install test files
Move the test files from src/main/resources
to <user.home>/chatmotor-samples
(or to any directory defined by the SamplesParms.SAMPLE_FILES_DIR
static String.
This project is licensed under the MIT License. See the LICENSE file for more details.
If you encounter any issues or have questions, please open an issue on GitHub or contact our support team via the ChatMotor Contact Page.