Skip to content

Commit 4799f72

Browse files
authored
Merge pull request #27 from yml-org/chore/improved_readme
Added Build Status badge
2 parents 89b525f + 66455d6 commit 4799f72

File tree

2 files changed

+43
-2
lines changed

2 files changed

+43
-2
lines changed

README.md

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,62 @@
11
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/co.yml/ychatgpt/badge.svg)](https://maven-badges.herokuapp.com/maven-central/co.yml/ychatgpt/)
22
![Apache-2.0](https://img.shields.io/badge/license-Apache-blue)
3+
![Build Status](https://github.com/yml-org/chatgpt-sdk/actions/workflows/test.yml/badge.svg?branch=main)
4+
![Y-ChatGPT SDK](https://github.com/yml-org/chatgpt-sdk/raw/main/art/logo.png)
35

46
# YChatGPT (Working in Progress 🚧)
57

68
ChatGPT is a large language model developed by OpenAI that is trained to generate human-like text based on a given prompt or context.
79

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.
911

1012

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+
1152
## 🤝 Contributions
1253

1354
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.
1455

1556
## License
1657

1758
```
18-
Copyright 2023 YChatGPT
59+
Copyright 2023 YML
1960
2061
Licensed under the Apache License, Version 2.0 (the "License");
2162
you may not use this file except in compliance with the License.

art/logo.png

51 KB
Loading

0 commit comments

Comments
 (0)