|
1 | 1 | [](https://maven-badges.herokuapp.com/maven-central/co.yml/ychatgpt/)
|
2 | 2 | 
|
| 3 | + |
| 4 | + |
3 | 5 |
|
4 | 6 | # YChatGPT (Working in Progress 🚧)
|
5 | 7 |
|
6 | 8 | ChatGPT is a large language model developed by OpenAI that is trained to generate human-like text based on a given prompt or context.
|
7 | 9 |
|
8 |
| -YChatGPT aims to abstract all API call logic from ChatGPT for multiple platforms. |
| 10 | +YChatGPT aims to abstract all API call logic from ChatGPT for multiple platforms. YChatGPT is a Kotlin Multiplatform (KMP) project, that generates artifacts for both iOS and Android. |
9 | 11 |
|
10 | 12 |
|
| 13 | +## Android setup |
| 14 | + |
| 15 | +Add the following line to import the library via Gradle. First, make sure Maven Central has been added: |
| 16 | + |
| 17 | + |
| 18 | +```kotlin |
| 19 | +repositories { |
| 20 | + mavenCentral() |
| 21 | + // ... |
| 22 | +} |
| 23 | +``` |
| 24 | + |
| 25 | +Then, simply import the dependency to your common source-set dependencies: |
| 26 | + |
| 27 | +```kotlin |
| 28 | +implementation("co.yml:ychatgpt:1.0.0") |
| 29 | +``` |
| 30 | + |
| 31 | +In the snippet below, you can see how to initialize the object and perform a first search: |
| 32 | + |
| 33 | + |
| 34 | +```kotlin |
| 35 | +val yChatGpt by lazy { |
| 36 | + YChatGpt.create("your-api-key") |
| 37 | +} |
| 38 | + |
| 39 | +try { |
| 40 | + val result = yChatGpt.completion() |
| 41 | + .setInput("Say this is a test.") |
| 42 | + .saveHistory(false) |
| 43 | + .setMaxTokens(1024) |
| 44 | + .set... // you can set more parameters |
| 45 | + .execute() |
| 46 | + |
| 47 | +} catch (e: exception) { |
| 48 | + // catch any error that may occurs on api call. |
| 49 | +} |
| 50 | +``` |
| 51 | + |
11 | 52 | ## 🤝 Contributions
|
12 | 53 |
|
13 | 54 | Feel free to make a suggestion or if you find any error in this project, please open an issue. Make sure to read our [contribution guidelines](https://github.com/yml-org/chatgpt-sdk/blob/main/CONTRIBUTING.md) before.
|
14 | 55 |
|
15 | 56 | ## License
|
16 | 57 |
|
17 | 58 | ```
|
18 |
| - Copyright 2023 YChatGPT |
| 59 | + Copyright 2023 YML |
19 | 60 |
|
20 | 61 | Licensed under the Apache License, Version 2.0 (the "License");
|
21 | 62 | you may not use this file except in compliance with the License.
|
|
0 commit comments