Skip to content

Commit

Permalink
fix: api updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gtokman committed Aug 27, 2023
1 parent 1411cb8 commit cbdf63a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

<div align="center">
<img alt="npm downloads" src="https://img.shields.io/npm/dw/@candlefinance/react-native-openai?logo=npm&label=NPM%20downloads&cacheSeconds=3600"/>
<img alt="discord users online" src="https://discord.gg/qnAgjxhg6n"
<a alt="discord users online" src="https://discord.gg/qnAgjxhg6n"
target="_blank"
/>
rel="noopener noreferrer">
<img alt="discord users online" src="https://img.shields.io/discord/986610142768406548?label=Discord&logo=discord&logoColor=white&cacheSeconds=3600"/>
</div>

<br/>
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class OpenAI {
ReactNativeOpenAI.initialize(apiKey, organization);
}

public stream(prompt: string) {
public createCompletion(prompt: string) {
return ReactNativeOpenAI.stream(prompt);
}

Expand Down

0 comments on commit cbdf63a

Please sign in to comment.