├── .gitignore ├── .idea ├── .gitignore ├── .name ├── compiler.xml ├── gradle.xml ├── misc.xml └── vcs.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── deimos │ │ └── openaiapikotlin │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── deimos │ │ │ └── openaiapikotlin │ │ │ └── MainActivity.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── values-night │ │ └── themes.xml │ │ ├── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── themes.xml │ │ └── xml │ │ ├── backup_rules.xml │ │ └── data_extraction_rules.xml │ └── test │ └── java │ └── com │ └── deimos │ └── openaiapikotlin │ └── ExampleUnitTest.kt ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── library ├── .gitignore ├── build.gradle ├── consumer-rules.pro ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── deimos │ │ └── openaiapi │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── deimos │ │ └── openaiapi │ │ ├── Choices.kt │ │ ├── CompletionRequest.kt │ │ ├── CompletionResponse.kt │ │ ├── OpenAI.kt │ │ └── OpenAIService.kt │ └── test │ └── java │ └── com │ └── deimos │ └── openaiapi │ └── ExampleUnitTest.kt ├── libs └── OpenAI API-release.aar ├── settings.gradle └── sources ├── app.jpg ├── dependencies.png └── permissions.png /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | 17 | app/src/main/java/com/deimos/openaiapikotlin/key.kt 18 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | OpenAI API Kotlin -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenAI API for Android/Kotlin 2 | Do you want to build your own Chat GPT? Well, you can find an example 3 | here! If you have any issues please let me know it in some of my 4 | social networks, you can find them 5 | [here](https://github.com/DeimosHall). 6 | 7 | ## Add the dependencies to you project 8 | 9 | Open the build.gradle (app) file and add the dependencies. 10 | 11 | ~~~ 12 | dependencies { 13 | implementation 'com.github.DeimosHall:OpenAI-API-Kotlin:1.0.3' 14 | ... 15 | } 16 | ~~~ 17 | 18 | If you want to follow the example you will also need 19 | 20 | ~~~ 21 | android { 22 | ... 23 | buildFeatures { 24 | viewBinding true 25 | } 26 | } 27 | ~~~ 28 | 29 | Remember to give a star to the project :D 30 | 31 |

32 | 33 |

34 | 35 | ## Permissions 36 | 37 | Your app will need the internet permission, add it in the 38 | AndroidManifest.xml file 39 | 40 | ~~~ 41 | 42 | ~~~ 43 | 44 |

45 | 46 |

47 | 48 | ## User interface 49 | You can skip this step if you just want to see the code. However, 50 | if you want to get the same behavior you can copy the code of the 51 | activity_main.xml from bellow. 52 | 53 |

54 | 55 |

56 | 57 | activity_main.xml: 58 | 59 | ~~~ 60 | 61 | 68 | 69 | 78 | 79 | 88 | 89 |