Skip to content

Commit edd3f4e

Browse files
Added code comments in aiproxy init
1 parent c4cf758 commit edd3f4e

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

Sources/OpenAI/AIProxy/AIProxyService.swift

+14-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,20 @@ struct AIProxyService: OpenAIService {
3030

3131
private static let assistantsBetaV2 = "assistants=v2"
3232

33-
/// Your service URL is also provided during the integration process. If you integrated before
34-
/// July 22nd, 2024, you can continue to leave `serviceURL` blank.
33+
/// Initializes an instance of the OpenAI service with the required configurations.
34+
///
35+
/// - Parameters:
36+
/// - partialKey: Your partial key provided during the integration process at `dashboard.aiproxy.pro`.
37+
/// Refer to the [integration guide](https://www.aiproxy.pro/docs/integration-guide.html)
38+
/// for details on acquiring your partial key. This is required.
39+
/// - serviceURL: Your service URL, also provided during the integration process. If you integrated before
40+
/// July 22nd, 2024, you can leave this parameter blank, and it will default to
41+
/// `"https://api.aiproxy.pro"`. This is optional.
42+
/// - clientID: An optional client ID to annotate requests in the AIProxy developer dashboard.
43+
/// If left blank, AIProxy generates client IDs for you. Most users can safely leave this blank.
44+
/// - organizationID: An optional OpenAI organization ID. Refer to the [organization documentation](https://platform.openai.com/docs/api-reference/organization-optional)
45+
/// for details on its usage. Defaults to `nil`.
46+
/// - debugEnabled: A flag to enable printing request events during DEBUG builds. Set this to `true` for debugging.
3547
init(
3648
partialKey: String,
3749
serviceURL: String? = nil,

Sources/OpenAI/Public/Service/OpenAIServiceFactory.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class OpenAIServiceFactory {
5353
urlSessionConfiguration: URLSessionConfiguration = .default,
5454
decoder: JSONDecoder = .init(),
5555
debugEnabled: Bool = false)
56-
-> OpenAIService
56+
-> OpenAIService
5757
{
5858
DefaultOpenAIAzureService(
5959
azureConfiguration: azureConfiguration,
@@ -87,7 +87,7 @@ public class OpenAIServiceFactory {
8787
aiproxyServiceURL: String? = nil,
8888
aiproxyClientID: String? = nil,
8989
debugEnabled: Bool = false)
90-
-> OpenAIService
90+
-> OpenAIService
9191
{
9292
AIProxyService(
9393
partialKey: aiproxyPartialKey,
@@ -132,7 +132,7 @@ public class OpenAIServiceFactory {
132132
/// - apiKey: The optional API key required for authentication.
133133
/// - baseURL: The local host URL. e.g "https://api.groq.com" or "https://generativelanguage.googleapis.com"
134134
/// - proxyPath: The proxy path e.g `openai`
135-
/// - overrideVersion: The API version. defaults to `V1`
135+
/// - overrideVersion: The API version. defaults to `v1`
136136
/// - extraHeaders: Additional headers needed for the request. Do not provide API key in these headers.
137137
/// - debugEnabled: If `true` service prints event on DEBUG builds, default to `false`.
138138
///

0 commit comments

Comments
 (0)