Comments (7)
Thank you @andrewcar for confirming. So let me share my sample code;
openAI.sendCompletion(with: "Hello how are you", maxTokens: 100) { result in
switch result {
case .success(let success):
print(success.choices.first?.text ?? "")
case .failure(let failure):
print(failure.localizedDescription)
}
}
Console output is:
I'm doing great, thank you! How are you?
from openaiswift.
I am getting the same issue.
UPDATE: Fixed! I had apparently left out some characters when using my API key. After generating a new one, it works! Thanks for making this library, @adamrushy!
from openaiswift.
@andrewcar which characters are you talking about? I am also facing same error. Maybe your solution can help.
If you go to your API keys, and if you have generated any secret keys, you'll see them there with the middle truncated.
So, when I visited there to double check mine, I noticed that the last characters didn't match up with what I was using to initialize the Swift library. I just created a new one and my issue was resolved.
UPDATE: The one I was using last night stopped working and also didn't match up with what I had in the truncated version on their site. Generated a new one just fine. Even though I haven't used mine in any public fashion, what I think is causing that is this:
In order to protect the security of your account, OpenAI may also automatically rotate any API key that we've found has leaked publicly.
from openaiswift.
Hey, @chetan-diy-ios
Can you share the text
you're sending, please?
Thank you,
Adam
from openaiswift.
I tried many questions.
"Hello how are you"
"Biggest animal on planet"
"when is iPhone will actually get a update"
from openaiswift.
@andrewcar which characters are you talking about? I am also facing same error. Maybe your solution can help.
from openaiswift.
Closing based on above discussion, please open new issue with the issue persists 😀
from openaiswift.
Related Issues (20)
- "The operation couldn’t be completed. (OpenAISwift.OpenAIError error 2.)" HOT 2
- Always returning nil HOT 3
- OpenAIEndpointModelType that replaces the OpenAIModelType so only compatible models are available for each method
- Trying to take a sendCompletion request with gpt4 model HOT 1
- Cannot use instance member 'key' within property initializer; property initializers run before 'self' is available
- no response from openAI webAPI? HOT 3
- OpenAISwift 1.4.0 multiple errors with new Xcode 15 release HOT 1
- theres a typo for URLRequest it say inout instead of "input" HOT 1
- Stay away from this package HOT 12
- OpenAISwift - New Fork with merged Pull Requests
- Latest Models & Updates HOT 1
- 2023 Dev Conf Updates
- Is gpt-4-vision-preview model possible? HOT 1
- Not getting any responses from API HOT 3
- Updated Jan 2024 Models and Endpoints
- Simple request
- Please add support for setting base_url HOT 1
- How to use Vision function?Supports GPT-4o and GPT-4 Turbo models.
- Got a blank message response from Chatgpt HOT 1
- Implement new GPT4o-mini model.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openaiswift.