Skip to content

Commit

Permalink
[ Add ] added documentation for the audio APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
anasfik committed Mar 9, 2023
1 parent 4a47501 commit 496ef5c
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ example/.env
*.jsonl
env.g.dart
.env
*.mp3
*.png
Binary file removed 1678360420020361.png
Binary file not shown.
Binary file removed 1678360427710524.mp3
Binary file not shown.
38 changes: 33 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# NEW: ChatGPT API is [added](#chat-chatgpt) to the library and can be used directly.
# NEW: ChatGPT & Whisper APIs are [added](#chat-chatgpt) to the library and can be used directly.

<br>
<p align="center">
Expand Down Expand Up @@ -46,7 +46,7 @@ Please note that this client SDK connects directly to [OpenAI APIs](https://plat
- Developer-friendly.
- `Stream` functionality for completions API & fine-tune events API.

## 👑 Code Progress (94 %)
## 👑 Code Progress (100 %)

- [x] [Authentication](#authentication)
- [x] [Models](#models)
Expand All @@ -57,13 +57,13 @@ Please note that this client SDK connects directly to [OpenAI APIs](https://plat
- [x] [Edits](#edits)
- [x] [Images](#images)
- [x] [Embeddings](#embeddings)
- [ ] [Audio](#audio)
- [x] [Audio](#audio)
- [x] [Files](#files)
- [x] [Fine-tunes](#fine-tunes)
- [x] With events `Stream` responses.
- [x] [Moderation](#moderations)

## 💫 Testing Progress (94 %)
## 💫 Testing Progress (100 %)

- [x] [Authentication](#authentication)
- [x] [Models](#models)
Expand All @@ -72,7 +72,7 @@ Please note that this client SDK connects directly to [OpenAI APIs](https://plat
- [x] [Edits](#edits)
- [x] [Images](#images)
- [x] [Embeddings](#embeddings)
- [ ] [Audio](#audio)
- [x] [Audio](#audio)
- [x] [Files](#files)
- [x] [Fine-tunes](#fine-tunes)
- [x] [Moderation](#moderations)</br>
Expand Down Expand Up @@ -244,6 +244,8 @@ print(chatStreamEvent); // ...
})
```

</br>

## Edits

### Create edit
Expand Down Expand Up @@ -328,6 +330,32 @@ OpenAIEmbeddingsModel embeddings = await OpenAI.instance.embedding.create(

</br>

# Audio

## Create transcription

for transcribing an audio `File`, you can use the `createTranscription()` method directly by providing the `file` property:

```dart
OpenAIAudioModel transcription = OpenAI.instance.audio.createTranscription(
file: /* THE AUDIO FILE HERE */,
model: "whisper-1",
);
```

## Create translation

to get access to the translation API, and translate an audio file to english, you can use the `createTranslation()` method, by providing the `file`` property:

```dart
OpenAIAudioModel translation = await OpenAI.instance.audio.createTranslation(
file: /* THE AUDIO FILE HERE */,
model: "whisper-1",
);
```

</br>

## Files

Files are used to upload documents that can be used with features like [Fine-tuning](#fine-tunes).
Expand Down

0 comments on commit 496ef5c

Please sign in to comment.