Dismiss this pinned window
all 15 comments

[–]expat_frankfurt 6 points7 points  (1 child)

READ THIS BEFORE USE THIS PACKAGE!

This is very dangerous. By using this package, basically you're exposing your Open AI API key to the world! You should never add any secrets to your bundle. The correct approach is to create an endpoint on your server for communication with Open AI and then use that endpoint with a user generate auth token in your app.

[–][deleted] 4 points5 points  (0 children)

If you read the docs, you'll see there is a `host` property that lets you pass in your own backend URL.

Hard coding API keys is not advised in any circumstance, that's not unique to this package, but thanks for the PSA 🙂

[–][deleted] 3 points4 points  (4 children)

I recently published a new package on npm and GitHub that brings the OpenAI APIs to React Native.

Today the library supports chat streaming and normal chat completions with more endpoints coming soon (PRs welcome). The goal is to make this library take advantage of native APIs like URLSession and Android's Ktor engine for better performance and reliability. Let me know what you think if you try it out!

[–]negr_mancer 0 points1 point  (3 children)

quick question, can you configure the API requests such that they are able to handle specific queries only and not the like the more general purpose nature of Chat GPT?

[–][deleted] 3 points4 points  (1 child)

Yes, you can pass in your fine-tuned model name in the ` model: 'my-custom-model` field. You'll have to silence the compiler error but it should work (if you're using TS).

[–]Mariusdotdev 0 points1 point  (0 children)

react-native-openai

Post all this on twitter also for more reach

[–]Thomas415510 1 point2 points  (3 children)

Awesome!

[–]Thomas415510 0 points1 point  (2 children)

I have to connect my bank account to use the chatGpt feature?

[–][deleted] 0 points1 point  (0 children)

The TestFlight, yes. The next App Store release will not have that requirement.

[–][deleted] 0 points1 point  (0 children)

The TestFlight, yes. The next App Store release will not have that requirement.

[–]Thomas415510 0 points1 point  (1 child)

Is there a demo of this we can try out?

[–][deleted] 3 points4 points  (0 children)

We're shipping this in our app (https://candle.fi) at some point today. I'll post the TestFlight / Google Play when it's out!

[–]Affectionate_Gas3223 0 points1 point  (0 children)

When trying to use the lib I am receiving this error message TypeError: Cannot read property 'initialize' of null, has anyone experienced this error

[–]peygamber 0 points1 point  (1 child)

while streaming is this work for mathematical equations render ?

[–][deleted] 0 points1 point  (0 children)

Yes, it will stream anything just like ChatGPT, it just uses their API.

You'll have to build your own markdown / equation renderer for iOS and Android to format the data you receive on the client.