Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"GPT4-Tarbo" and "JSON-Mode" Compatibility #9

Open
takuoka opened this issue Nov 8, 2023 · 1 comment
Open

"GPT4-Tarbo" and "JSON-Mode" Compatibility #9

takuoka opened this issue Nov 8, 2023 · 1 comment

Comments

@takuoka
Copy link

takuoka commented Nov 8, 2023

Hello,

First of all, I want to express my gratitude for providing this fantastic library. It has been incredibly useful, and I'm really thankful for your hard work.

I recently saw the exciting announcement regarding GPT-4 Tarbo and the JSON mode, and I couldn't be more thrilled. It got me thinking about the future of this library. Do you have any plans to support GPT-4 Tarbo and integrate a JSON mode? I believe these additions could take this library to the next level.

I'm looking forward to your response and eagerly anticipating the potential enhancements to this already amazing library. Thank you once again for your efforts!

Best regards.

@SwiftedMind
Copy link
Owner

Hey,
thanks for the kinds words! Glad you like the package :)

Yeah, I'm also really excited about the announced features. Originally, I was absolutely planning on expanding GPTSwift to include all of the cool new stuff, because there are a lot of interesting challenges involved with this (function calling, to name one) and I enjoy building these things with Swift.

However, I'm not entirely sure anymore. The reason is that having a Swift package like this in your app means having to ship your OpenAI API key with the app, which is not really secure. Everything that's shipped can be accessed by someone with enough willpower. It's probably fine for small-ish projects but in the general case, all calls to the OpenAI API should happen from a custom backend, using OAuth. And, there aren't many Swift backends that could make use of GPTSwift right now.

So unfortunately, it's hard to justify putting in a ton of effort (which it will need to support everything that's been announced) for something that shouldn't be used in a client 🤔. To be fair, I should have thought about this before I created this package, that's my bad. I'm really sorry about that!

However, if all you need is the new model and json mode: You can absolutely use the new model already, simply pass it as a .custom("gpt-4-1106-preview") model into the ChatGPT object.

As for the json mode: I think that's a simple toggle to send with the request, that's something I could add in an update to GPTSwift, that shouldn't be too much work :)

Sorry to disappoint you with this answer. I was also really hyped but then the realization kicked in that a client library for something like this is not the best idea, as much as I would prefer it over a backend solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants