Skip to content

Commit

Permalink
Added code comments in aiproxy init
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesrochabrun committed Jan 23, 2025
1 parent c4cf758 commit edd3f4e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
16 changes: 14 additions & 2 deletions Sources/OpenAI/AIProxy/AIProxyService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,20 @@ struct AIProxyService: OpenAIService {

private static let assistantsBetaV2 = "assistants=v2"

/// Your service URL is also provided during the integration process. If you integrated before
/// July 22nd, 2024, you can continue to leave `serviceURL` blank.
/// Initializes an instance of the OpenAI service with the required configurations.
///
/// - Parameters:
/// - partialKey: Your partial key provided during the integration process at `dashboard.aiproxy.pro`.
/// Refer to the [integration guide](https://www.aiproxy.pro/docs/integration-guide.html)
/// for details on acquiring your partial key. This is required.
/// - serviceURL: Your service URL, also provided during the integration process. If you integrated before
/// July 22nd, 2024, you can leave this parameter blank, and it will default to
/// `"https://api.aiproxy.pro"`. This is optional.
/// - clientID: An optional client ID to annotate requests in the AIProxy developer dashboard.
/// If left blank, AIProxy generates client IDs for you. Most users can safely leave this blank.
/// - organizationID: An optional OpenAI organization ID. Refer to the [organization documentation](https://platform.openai.com/docs/api-reference/organization-optional)
/// for details on its usage. Defaults to `nil`.
/// - debugEnabled: A flag to enable printing request events during DEBUG builds. Set this to `true` for debugging.
init(
partialKey: String,
serviceURL: String? = nil,
Expand Down
6 changes: 3 additions & 3 deletions Sources/OpenAI/Public/Service/OpenAIServiceFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class OpenAIServiceFactory {
urlSessionConfiguration: URLSessionConfiguration = .default,
decoder: JSONDecoder = .init(),
debugEnabled: Bool = false)
-> OpenAIService
-> OpenAIService
{
DefaultOpenAIAzureService(
azureConfiguration: azureConfiguration,
Expand Down Expand Up @@ -87,7 +87,7 @@ public class OpenAIServiceFactory {
aiproxyServiceURL: String? = nil,
aiproxyClientID: String? = nil,
debugEnabled: Bool = false)
-> OpenAIService
-> OpenAIService
{
AIProxyService(
partialKey: aiproxyPartialKey,
Expand Down Expand Up @@ -132,7 +132,7 @@ public class OpenAIServiceFactory {
/// - apiKey: The optional API key required for authentication.
/// - baseURL: The local host URL. e.g "https://api.groq.com" or "https://generativelanguage.googleapis.com"
/// - proxyPath: The proxy path e.g `openai`
/// - overrideVersion: The API version. defaults to `V1`
/// - overrideVersion: The API version. defaults to `v1`
/// - extraHeaders: Additional headers needed for the request. Do not provide API key in these headers.
/// - debugEnabled: If `true` service prints event on DEBUG builds, default to `false`.
///
Expand Down

0 comments on commit edd3f4e

Please sign in to comment.