Welcome to EasyChatGPT - your AI-powered chat application! This app demonstrates real-time conversations with the OpenAI GPT-3 model using the OkHttp library for API calls. Below, we provide an overview of key files and features:
- Real-time Conversations: Engage in dynamic conversations with the OpenAI GPT-3 model.
- User-friendly Interface: Simple and intuitive user interface for seamless chatting.
- Message History: Display a history of sent and received messages.
- OpenAI Integration: Utilize the power of the OpenAI API for text completion.
- Clone or download the repository to your local machine.
- Open the project in Android Studio.
- Replace
YOUR_API_KEY
incallAPI()
with your OpenAI API key. - Build and run the app on your Android device or emulator.
MainActivity.java
: The main activity managing chat functionality and API calls.Message.java
: Data model for individual chat messages.MessageAdapter.java
: RecyclerView adapter for displaying messages.activity_main.xml
: Layout XML file for the main chat activity.
- User inputs a message and taps the send button.
- The message is added to the chat history as "Sent by Me".
- The app calls the OpenAI API with the user's message.
- The API response (bot's reply) is added to the chat history as "Sent by Bot".
Ensure you have obtained your OpenAI API key and added it to the Authorization
header in the callAPI()
function.
Please be cautious while integrating API keys and sensitive information in your code. This repository is for educational purposes and to showcase integration with the OpenAI API.
Feel free to explore, experiment, and contribute to this project. Happy coding!
Disclaimer: This repository is for educational purposes and does not provide guarantees or warranties for any purpose. It is recommended to follow best practices for securing API keys and sensitive information.