Skip to content

Commit

Permalink
Updated with iOS instructions (#29)
Browse files Browse the repository at this point in the history
* Updated with iOS instructions

* Art for iOS

* Right path for images
  • Loading branch information
kikoso authored Feb 20, 2023
1 parent 4799f72 commit f4e7ae1
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,44 @@
![Build Status](https://github.com/yml-org/chatgpt-sdk/actions/workflows/test.yml/badge.svg?branch=main)
![Y-ChatGPT SDK](https://github.com/yml-org/chatgpt-sdk/raw/main/art/logo.png)

# YChatGPT (Working in Progress 🚧)
# YChatGPT

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

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.


## iOS setup

- Go to your project’s file settings and click "Add Package":

![Y-ChatGPT iOS first screenshot](https://github.com/yml-org/chatgpt-sdk/raw/blob/art/ios-1.png)

- To add a new package, search for https://github.com/yml-org/chatgpt-sdk.git in the top right corner:

![Y-ChatGPT iOS second screenshot](https://github.com/yml-org/chatgpt-sdk/raw/blob/art/ios-2.png)

Once you have found the package click the "Add Package" button to add it to your project. Now you can start using the SDK in your iOS project!

See the code snippet below on how to initialize and use it:

```swift
var yChatGpt: YChatGpt {
YChatGptCompanion.shared.create(apiKey: "your-api-key")
}

do {
let result = try await chatGpt.completion()
.setInput(input: "Say this is a test.")
.setMaxTokens(tokens: 1024)
.saveHistory(isSaveHistory: false)
.set... // you can set more parameters
.execute()
} catch {
// catch any error that may occurs on api call.
}
```

## Android setup

Add the following line to import the library via Gradle. First, make sure Maven Central has been added:
Expand Down
Binary file added art/ios-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added art/ios-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f4e7ae1

Please sign in to comment.