This README is written by ChatGPT
Compose ChatGPT Kotlin is an open-source Android chatbot application built using Jetpack Compose and Kotlin programming language. It integrates with OpenAI's GPT-3, GPT-4 API to generate human-like responses to user messages. The app is designed to be easy to use and highly customizable, allowing users to easily integrate the chatbot functionality into their existing projects.
This project showcases the use of modern Android development tools and techniques, including Jetpack Compose for building responsive UIs, Kotlin Coroutines for asynchronous programming, and Dagger Hilt for dependency injection. It also demonstrates how to use the OpenAI GPT-3, GPT-4 API to create a powerful and intelligent chatbot.
The project has a well-organized folder structure that makes it easy to navigate and understand the codebase. The code is well-documented and follows best practices for clean and maintainable code.
Overall, Compose ChatGPT Kotlin is a powerful and flexible chatbot solution that can be easily integrated into any Android project. With its modern architecture and powerful features, it is an excellent example of how to build high-quality Android applications using the latest tools and techniques.
- Android Studio Arctic Fox or later
- OpenAI API Key
- Firebase
- Clone the repository.
- Setup your Firebase and put file google-services.json into app/
- Obtain an OpenAI API Key from the OpenAI website.
- In the app/src/main/java/com/chatgptlite/wanted/constants/Constants.kt file, add the following line and replace with your actual API key: openAIApiKey=
- Build and run the app on an emulator or physical device.
.
βββ app
β βββ build.gradle
β βββ proguard-rules.pro
β βββ src
β β βββ androidTest
β β βββ main
β β β βββ java/com/chatgptlite/wanted
β β β β βββ constants
β β β β βββ data
β β β β βββ di
β β β β βββ helpers
β β β β βββ models
β β β β βββ ui
β β β β βββ MainActivity.kt
β β β β βββ MainViewModel.kt
β β β βββ res
β β β βββ AndroidManifest.xml
β β βββ test
β β βββ ...
βββ build.gradle
βββ gradle
β βββ wrapper
β βββ gradle-wrapper.jar
β βββ gradle-wrapper.properties
βββ gradle.properties
βββ gradlew
βββ gradlew.bat
βββ settings.gradle
The app directory contains all the source code and resources of the application. It contains a build.gradle file, which is used to configure the build process for the application, and a proguard-rules.pro file, which contains rules for ProGuard, a tool used to shrink and obfuscate code.
Within the src directory, there are two subdirectories: androidTest and main. The androidTest directory contains integration tests for the application on Android. The main directory contains the majority of the source code and resources for the application, and is further broken down into subdirectories:
constants
: This directory contains constant values used throughout the application.data
: This directory contains the data layer of the application, including repositories and data sources.di
: This directory contains the Dependency Injection setup for the application.helpers
: This directory contains utility classes used throughout the application.models
: This directory contains the data models used throughout the application.ui
: This directory contains the user interface components of the application, including Activities, Fragments, and Composables.MainActivity.kt
: This file contains the implementation of the main activity for the application.MainViewModel.kt
: This file contains the implementation of the main view model for the application.
The project also contains other files and directories at the root level, including the build.gradle file, which is used to configure the build process for the entire project, the gradle directory, which contains files related to the Gradle build system, and the gradlew and gradlew.bat scripts, which are used to run Gradle commands. The gradle.properties file contains properties used by the Gradle build system, and the settings.gradle file is used to configure the Gradle settings for the project.
- New Chat
- Chat History
- ChatBot with ChatGPT
- stream: true
- gpt-3.5-turbo
- gpt-4
- text-davinci-003, text-curie-001, text-babbage-001, text-ada-001
- stream: false
- gpt-3.5-turbo
- text-davinci-003, text-curie-001, text-babbage-001, text-ada-001
- stream: true
- Stop generating
- Delete conversation
- Settings for ChatGPT
- Light/Dart Themes
- Jetpack Compose
- Retrofit
- OpenAI GPT-3 API
- Kotlin Coroutines
Contributions are welcome! Please feel free to submit a pull request or open an issue if you encounter any problems or have suggestions for improvements.
If you have any questions or suggestions related to this application, please contact me via email: lambiengcode@gmail.com.
MIT License
Copyright (c) 2022 lambiengcode
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.