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
Copy file name to clipboardExpand all lines: Examples/SwiftOpenAIExample/SwiftOpenAIExample/AIProxyIntroView.swift
+2-2
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ struct AIProxyIntroView: View {
36
36
.disabled(partialKey.isEmpty)
37
37
Spacer()
38
38
Group{
39
-
Text("You can now use SwiftOpenAI for development and production! AI Proxy keeps your OpenAI API key secure. To configure AI Proxy for your project, or to learn more about how it works, please see the docs at ")+ Text("[this link](https://www.aiproxy.pro/docs).")
39
+
Text("You can now use SwiftOpenAI for development and production! AIProxy keeps your OpenAI API key secure. To configure AIProxy for your project, or to learn more about how it works, please see the docs at ")+ Text("[this link](https://www.aiproxy.pro/docs).")
40
40
}
41
41
.font(.caption)
42
42
}
@@ -46,7 +46,7 @@ struct AIProxyIntroView: View {
46
46
}
47
47
48
48
privatevaraiproxyService:someOpenAIService{
49
-
// Attention AI Proxy customers!
49
+
// Attention AIProxy customers!
50
50
//
51
51
// Please do not let a `deviceCheckBypass` slip into an archived version of your app that you distribute (including through TestFlight).
52
52
// Doing so would allow an attacker to use the bypass themselves.
Copy file name to clipboardExpand all lines: README.md
+84-7
Original file line number
Diff line number
Diff line change
@@ -15,12 +15,13 @@ An open-source Swift package designed for effortless interaction with OpenAI's p
15
15
-[Getting an API Key](#getting-an-api-key)
16
16
-[Installation](#installation)
17
17
-[Usage](#usage)
18
-
-[Azure OpenAI](#azure-openAI)
18
+
-[Azure OpenAI](#azure-openai)
19
+
-[AIProxy](#aiproxy)
19
20
-[Collaboration](#collaboration)
20
21
21
22
## Description
22
23
23
-
`SwiftOpenAI` is an open-source Swift package that streamlines interactions with **all** OpenAI's API endpoints, now with added support for Azureand Assistant stream APIs.
24
+
`SwiftOpenAI` is an open-source Swift package that streamlines interactions with **all** OpenAI's API endpoints, now with added support for Azure, AIProxy, and Assistant stream APIs.
24
25
25
26
### OpenAI ENDPOINTS
26
27
@@ -63,6 +64,17 @@ To interact with OpenAI services, you'll need an API key. Follow these steps to
63
64
64
65
For more information, consult OpenAI's [official documentation](https://platform.openai.com/docs/).
65
66
67
+
⚠️ Please take precaution to keep your API key secure per [OpenAI's guidance](https://platform.openai.com/docs/api-reference/authentication):
68
+
69
+
> Remember that your API key is a secret! Do not share it with others or expose
70
+
> it in any client-side code (browsers, apps). Production requests must be
71
+
> routed through your own backend server where your API key can be securely
72
+
> loaded from an environment variable or key management service.
73
+
74
+
SwiftOpenAI has built-in support for AIProxy, which is a backend for AI apps, to satisfy this requirement.
75
+
To configure AIProxy, see the instructions [here](#aiproxy).
76
+
77
+
66
78
## Installation
67
79
68
80
### Swift Package Manager
@@ -1021,11 +1033,11 @@ let content: ChatCompletionParameters.Message.ContentType = .text(prompt)
let chatCompletionObject =tryawait service.startStreamedChat(parameters: parameters)
1023
1035
```
1024
-
For more details about how to also uploadin base 64 encoded images in iOS check the [ChatFunctionsCalllDemo](https://github.com/jamesrochabrun/SwiftOpenAI/tree/main/Examples/SwiftOpenAIExample/SwiftOpenAIExample/ChatFunctionsCall) demo on the Examples section of this package.
1036
+
For more details about how to also uploading base 64 encoded images in iOS check the [ChatFunctionsCalllDemo](https://github.com/jamesrochabrun/SwiftOpenAI/tree/main/Examples/SwiftOpenAIExample/SwiftOpenAIExample/ChatFunctionsCall) demo on the Examples section of this package.
1025
1037
1026
1038
### Vision
1027
1039
1028
-
[Vison](https://platform.openai.com/docs/guides/vision) API is available for use; developers must access it through the chat completions API, specifically using the gpt-4-vision-preview model. Using any other model will not provide an image description
1040
+
[Vision](https://platform.openai.com/docs/guides/vision) API is available for use; developers must access it through the chat completions API, specifically using the gpt-4-vision-preview model. Using any other model will not provide an image description
For more details about how to also uploadin base 64 encoded images in iOS check the [ChatVision](https://github.com/jamesrochabrun/SwiftOpenAI/tree/main/Examples/SwiftOpenAIExample/SwiftOpenAIExample/Vision) demo on the Examples section of this package.
1053
+
For more details about how to also uploading base 64 encoded images in iOS check the [ChatVision](https://github.com/jamesrochabrun/SwiftOpenAI/tree/main/Examples/SwiftOpenAIExample/SwiftOpenAIExample/Vision) demo on the Examples section of this package.
0 commit comments