Skip to content

Commit 29a4a89

Browse files
committed
doc: Update readme
1 parent f864c37 commit 29a4a89

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ try {
8585

8686
### Features
8787

88+
- [ListModels](guides/Features.md#listmodels)
8889
- [Completions](guides/Features.md#completion)
8990
- [ChatCompletions](guides/Features.md#chatcompletions)
9091
- [ImageGenerations](guides/Features.md#imagegenerations)

guides/Features.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,44 @@
11
# Features
22

3+
- [ListModels](#listModels)
34
- [Completion](#completion)
45
- [ChatCompletions](#chatcompletions)
56
- [ImageGenerations](#imagegenerations)
67
- [Edits](#edits)
78

9+
## ListModels
10+
11+
The listModels api lists the currently available models, and provides basic information about each one such as the owner and availability.
12+
13+
### Swift
14+
15+
```swift
16+
var yChat: YChat {
17+
YChatCompanion.shared.create(apiKey: "your-api-key")
18+
}
19+
20+
do {
21+
let result = try await yChat.listModels().execute()
22+
} catch {
23+
// catch any error that may occurs on api call.
24+
}
25+
```
26+
27+
### Kotlin
28+
29+
```kotlin
30+
val yChat by lazy {
31+
YChat.create("your-api-key")
32+
}
33+
34+
try {
35+
val result = yChat.listModels().execute()
36+
37+
} catch (e: exception) {
38+
// catch any error that may occurs on api call.
39+
}
40+
```
41+
842
## Completion
943

1044
The completions api can be used for a wide variety of tasks. You input some text as a prompt, and the model will generate a text completion that attempts to match whatever context or pattern you gave it. For example, if you give the API the prompt, "As Descartes said, I think, therefore", it will return the completion " I am" with high probability.

0 commit comments

Comments
 (0)