Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
depombo authored Sep 3, 2024
1 parent 6e36caa commit a147818
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const client = new OpenAI({
});
```

### Chat Completions Streaming API
### Usage

The streaming APIs uses an [EventSource](https://developer.mozilla.org/en-US/docs/Web/API/EventSource) from [react-native-sse](https://github.com/binaryminds/react-native-sse) under the hood to provide a required typed `onData` stream event callback and three optional ones: `onDone`, `onOpen` and `onError`.

Expand Down Expand Up @@ -58,8 +58,6 @@ client.chat.completions.stream(
);
```

### Files API

The file upload API is async, requires a `purpose` string and leverages the [Expo File System](https://docs.expo.dev/versions/latest/sdk/filesystem/) so only a filepath needs to be provided.

```typescript
Expand All @@ -72,6 +70,8 @@ try {
}
```

Check the [example](https://github.com/backmesh/openai-react-native/blob/main/sample/app/index.tsx) for more details

## Coverage

- [x] [Chat Completion](https://platform.openai.com/docs/api-reference/chat)
Expand Down

0 comments on commit a147818

Please sign in to comment.