- Notifications
You must be signed in to change notification settings - Fork35
Compose ChatGPT Kotlin - Android Chatbot using Kotlin + Jetpack Compose + Coroutine + MVVM + Retrofit2 + OpenAI's GPT-3 API. Allow stream response from ChatGPT API.
License
lambiengcode/compose-chatgpt-kotlin-android-chatbot
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
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 filegoogle-services.json intoapp/
- Obtain an OpenAI API Key from the OpenAI website.
- In theapp/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.gradleTheapp 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 thesrc 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 LicenseCopyright (c) 2022 lambiengcodePermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, 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 THESOFTWARE.About
Compose ChatGPT Kotlin - Android Chatbot using Kotlin + Jetpack Compose + Coroutine + MVVM + Retrofit2 + OpenAI's GPT-3 API. Allow stream response from ChatGPT API.
Topics
Resources
License
Code of conduct
Contributing
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.



