From cbdf63a01672f89962e5fe5c7df5a0b7c0409369 Mon Sep 17 00:00:00 2001 From: Gary Tokman Date: Sun, 27 Aug 2023 12:58:09 -0400 Subject: [PATCH] fix: api updates --- README.md | 13 +++++++------ example/src/App.tsx | 2 +- src/index.tsx | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3952c0c..1097215 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,10 @@
npm downloads - discord users online + rel="noopener noreferrer"> + discord users online

@@ -43,14 +44,14 @@ React.useEffect(() => { }, []); // Create a new completion -openAI.stream(e.nativeEvent.text); +func ask(question: string) { + openAI.createCompletion(question); +} ``` ## Contributing -Join our [Discord](https://discord.gg/qnAgjxhg6n) in #dev channel to chat and ask questions! - -See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow. +Join our [Discord](https://discord.gg/qnAgjxhg6n) and ask questions in the **#dev** channel. ## License diff --git a/example/src/App.tsx b/example/src/App.tsx index 92fbbfe..d5f7b29 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -24,7 +24,7 @@ export default function App() { placeholder="Ask me a question." onEndEditing={(e) => { console.log(e.nativeEvent.text); - ai.stream(e.nativeEvent.text); + ai.createCompletion(e.nativeEvent.text); }} style={styles.input} /> diff --git a/src/index.tsx b/src/index.tsx index f93e797..ba12615 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -27,7 +27,7 @@ class OpenAI { ReactNativeOpenAI.initialize(apiKey, organization); } - public stream(prompt: string) { + public createCompletion(prompt: string) { return ReactNativeOpenAI.stream(prompt); }