You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: unity web req impl
* feat: null and length check for results
* feat: make form uploads with net.http only
* chore: message updated
* feat: arrays turned into list to prevent WebGL error
* feat: samples are updated
* feat: samples are updated
* fix: minor fixes
* feat: readme updated
* chore: version bumped
Copy file name to clipboardExpand all lines: README.md
+15-6Lines changed: 15 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,13 @@ To do this, follow these steps:
33
33
"organization": "org-...L7W"
34
34
}
35
35
```
36
+
37
+
You can also pass your API key into `OpenAIApi` ctor when creating an instance of it but again, this is not recommended!
38
+
39
+
```csharp
40
+
varopenai=newOpenAIApi("sk-Me8...6yi");
41
+
```
42
+
36
43
**IMPORTANT:** Your API key is a secret.
37
44
Do not share it with others or expose it in any client-side code (e.g. browsers, apps).
38
45
If you are using OpenAI for production, make sure to run it on the server side, where your API key can be securely loaded from an environment variable or key management service.
You can also pass your API key into OpenAIApi ctor when creating an instance of it but again, this is not recommended!
60
-
61
-
```csharp
62
-
varopenai=newOpenAIApi("sk-Me8...6yi");
63
-
```
64
-
65
66
### Sample Projects
66
67
This package includes two sample scenes that you can import via the Package Manager:
67
68
68
69
-**ChatGPT sample:** A simple ChatGPT like chat example.
69
70
-**DallE sample:** A DALL.E text to image generation example.
70
71
72
+
### Known Issues
73
+
-**Some Endpoints are not available in WebGL Project:** Some of the endpoints such as image edits, image variations, file and fine tune creations depend on multipart form uploads,
74
+
and UnityWebRequests with forms does not work as expected. For that reason C# Net.Http library is used however usage of the
75
+
library is blocked in WebGL due to security reasons.
76
+
77
+
-**Can't See the Image Result in WebGL Builds:** Due to CORS policy of OpenAI image storage in local WebGL builds you will get the generated image's URL however it will not be
78
+
downloaded using UnityWebRequest until you run it out of localhost, on a server.
79
+
71
80
### Further Reading
72
81
For more information on how to use the various request parameters,
73
82
please refer to the OpenAI documentation: https://beta.openai.com/docs/api-reference/introduction
0 commit comments