diff --git a/Examples/iOS_Example/iOS_Example/Completion/EditExample.swift b/Examples/iOS_Example/iOS_Example/Completion/EditExample.swift index 128dd3e..378f629 100644 --- a/Examples/iOS_Example/iOS_Example/Completion/EditExample.swift +++ b/Examples/iOS_Example/iOS_Example/Completion/EditExample.swift @@ -58,7 +58,7 @@ struct EditExample: View { ) let openAI = OpenAI(config) let editParameter = EditParameters( - model: "text-davinci-edit-003", + model: "text-davinci-edit-001", input: input, instruction: instruction ) diff --git a/Examples/iOS_Example/iOS_Example/Content Policy/ContentPolicyExample.swift b/Examples/iOS_Example/iOS_Example/Content Policy/ContentPolicyExample.swift index 0c0b4d8..2db7620 100644 --- a/Examples/iOS_Example/iOS_Example/Content Policy/ContentPolicyExample.swift +++ b/Examples/iOS_Example/iOS_Example/Content Policy/ContentPolicyExample.swift @@ -49,7 +49,7 @@ struct ContentPolicyExample: View { Task { do { - let openAI = OpenAI(Configuration(organization: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY")) + let openAI = OpenAI(Configuration(organizationId: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY")) let contentParameter = ContentPolicyParameters(input: input) let contentResult = try await openAI.checkContentPolicy(parameters: contentParameter) diff --git a/Examples/iOS_Example/iOS_Example/Embeddings/CreateEmbeddingsExample.swift b/Examples/iOS_Example/iOS_Example/Embeddings/CreateEmbeddingsExample.swift index d77abbd..5d5e124 100644 --- a/Examples/iOS_Example/iOS_Example/Embeddings/CreateEmbeddingsExample.swift +++ b/Examples/iOS_Example/iOS_Example/Embeddings/CreateEmbeddingsExample.swift @@ -63,7 +63,7 @@ struct CreateEmbeddingsExample: View { Task { do { - let config = Configuration(organization: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") + let config = Configuration(organizationId: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") let openAI = OpenAI(config) let embeddingsParam = EmbeddingsParameters(model: "text-similarity-babbage-001", input: input) diff --git a/Examples/iOS_Example/iOS_Example/File/DeleteFileExample.swift b/Examples/iOS_Example/iOS_Example/File/DeleteFileExample.swift index fe6e3d7..25c1e63 100644 --- a/Examples/iOS_Example/iOS_Example/File/DeleteFileExample.swift +++ b/Examples/iOS_Example/iOS_Example/File/DeleteFileExample.swift @@ -50,7 +50,7 @@ struct DeleteFileExample: View { Task { do { - let config = Configuration(organization: "INSERT-ORGANIZATION-NAME", apiKey: "INSERT-API-KEY") + let config = Configuration(organizationId: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") let openAI = OpenAI(config) self.deleteFileResponse = try await openAI.deleteFile(fileId: "INSERT-FILE-ID") diff --git a/Examples/iOS_Example/iOS_Example/File/ListFilesExample.swift b/Examples/iOS_Example/iOS_Example/File/ListFilesExample.swift index be25d4e..c4f5207 100644 --- a/Examples/iOS_Example/iOS_Example/File/ListFilesExample.swift +++ b/Examples/iOS_Example/iOS_Example/File/ListFilesExample.swift @@ -53,7 +53,7 @@ struct ListFilesExample: View { Task { do { - let config = Configuration(organization: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") + let config = Configuration(organizationId: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") let openAI = OpenAI(config) let filesResponse = try await openAI.listFiles() diff --git a/Examples/iOS_Example/iOS_Example/File/RetrieveFileContentsExample.swift b/Examples/iOS_Example/iOS_Example/File/RetrieveFileContentsExample.swift index 827cce5..1a49d22 100644 --- a/Examples/iOS_Example/iOS_Example/File/RetrieveFileContentsExample.swift +++ b/Examples/iOS_Example/iOS_Example/File/RetrieveFileContentsExample.swift @@ -52,7 +52,7 @@ struct RetrieveFileContentsExample: View { Task { do { - let config = Configuration(organization: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") + let config = Configuration(organizationId: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") let openAI = OpenAI(config) self.fineTunes = try await openAI.retrieveFileContent(fileId: "INSERT-FILE-ID") diff --git a/Examples/iOS_Example/iOS_Example/File/RetrieveFileExample.swift b/Examples/iOS_Example/iOS_Example/File/RetrieveFileExample.swift index bc5552d..aed73b2 100644 --- a/Examples/iOS_Example/iOS_Example/File/RetrieveFileExample.swift +++ b/Examples/iOS_Example/iOS_Example/File/RetrieveFileExample.swift @@ -53,7 +53,7 @@ struct RetrieveFileExample: View { Task { do { - let config = Configuration(organization: "INSERT-ORGANIZATION-NAME", apiKey: "INSERT-API-KEY") + let config = Configuration(organizationId: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") let openAI = OpenAI(config) self.file = try await openAI.retrieveFile(fileId: "INSERT-FILE-ID") diff --git a/Examples/iOS_Example/iOS_Example/File/UploadFileExample.swift b/Examples/iOS_Example/iOS_Example/File/UploadFileExample.swift index 4addf8a..5699e1d 100644 --- a/Examples/iOS_Example/iOS_Example/File/UploadFileExample.swift +++ b/Examples/iOS_Example/iOS_Example/File/UploadFileExample.swift @@ -53,7 +53,7 @@ struct UploadFileExample: View { Task { do { - let config = Configuration(organization: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") + let config = Configuration(organizationId: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") let openAI = OpenAI(config) guard let urlFile = Bundle.main.url( diff --git a/Examples/iOS_Example/iOS_Example/Finetunes/CancelFinetuneExample.swift b/Examples/iOS_Example/iOS_Example/Finetunes/CancelFinetuneExample.swift index d6f1929..d1e7a18 100644 --- a/Examples/iOS_Example/iOS_Example/Finetunes/CancelFinetuneExample.swift +++ b/Examples/iOS_Example/iOS_Example/Finetunes/CancelFinetuneExample.swift @@ -47,7 +47,7 @@ struct CancelFinetuneExample: View { Task { do { - let config = Configuration(organization: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") + let config = Configuration(organizationId: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") let openAI = OpenAI(config) self.fineTune = try await openAI.cancelFineTune(fineTune: "INSERT-FINE-TUNE-ID") diff --git a/Examples/iOS_Example/iOS_Example/Finetunes/CreateFinetuneExample.swift b/Examples/iOS_Example/iOS_Example/Finetunes/CreateFinetuneExample.swift index 261d1c7..350bb57 100644 --- a/Examples/iOS_Example/iOS_Example/Finetunes/CreateFinetuneExample.swift +++ b/Examples/iOS_Example/iOS_Example/Finetunes/CreateFinetuneExample.swift @@ -47,7 +47,7 @@ struct CreateFinetuneExample: View { Task { do { - let config = Configuration(organization: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") + let config = Configuration(organizationId: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") let openAI = OpenAI(config) let createFineTuneParam = CreateFineTuneParameters(trainingFile: "INSERT-TRAINING-FILE-ID") diff --git a/Examples/iOS_Example/iOS_Example/Finetunes/DeleteFinetuneExample.swift b/Examples/iOS_Example/iOS_Example/Finetunes/DeleteFinetuneExample.swift index 7f3dfb8..49523ae 100644 --- a/Examples/iOS_Example/iOS_Example/Finetunes/DeleteFinetuneExample.swift +++ b/Examples/iOS_Example/iOS_Example/Finetunes/DeleteFinetuneExample.swift @@ -50,7 +50,7 @@ struct DeleteFinetuneExample: View { Task { do { - let config = Configuration(organization: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") + let config = Configuration(organizationId: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") let openAI = OpenAI(config) self.deleted = try await openAI.deleteFineTuneModel(model: modelName) diff --git a/Examples/iOS_Example/iOS_Example/Finetunes/ListFinetuneEventsExample.swift b/Examples/iOS_Example/iOS_Example/Finetunes/ListFinetuneEventsExample.swift index a2d1fc4..0051c03 100644 --- a/Examples/iOS_Example/iOS_Example/Finetunes/ListFinetuneEventsExample.swift +++ b/Examples/iOS_Example/iOS_Example/Finetunes/ListFinetuneEventsExample.swift @@ -60,7 +60,7 @@ struct ListFinetuneEventsExample: View { Task { do { - let config = Configuration(organization: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") + let config = Configuration(organizationId: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") let openAI = OpenAI(config) let listFineTuneEventResponse = try await openAI.listFineTuneEvents(fineTune: fineTuneId) diff --git a/Examples/iOS_Example/iOS_Example/Finetunes/RetrieveFinetuneExample.swift b/Examples/iOS_Example/iOS_Example/Finetunes/RetrieveFinetuneExample.swift index 98fd805..389325c 100644 --- a/Examples/iOS_Example/iOS_Example/Finetunes/RetrieveFinetuneExample.swift +++ b/Examples/iOS_Example/iOS_Example/Finetunes/RetrieveFinetuneExample.swift @@ -47,7 +47,7 @@ struct RetrieveFinetuneExample: View { Task { do { - let config = Configuration(organization: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") + let config = Configuration(organizationId: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") let openAI = OpenAI(config) self.fineTune = try await openAI.retrieveFineTune(fineTune: "INSERT-FINE-TUNE-ID") diff --git a/Examples/iOS_Example/iOS_Example/Model/RetrieveModelExample.swift b/Examples/iOS_Example/iOS_Example/Model/RetrieveModelExample.swift index 4116fbc..d48ed50 100644 --- a/Examples/iOS_Example/iOS_Example/Model/RetrieveModelExample.swift +++ b/Examples/iOS_Example/iOS_Example/Model/RetrieveModelExample.swift @@ -69,7 +69,7 @@ struct RetrieveModelExample: View { Task { do { - let config = Configuration(organization: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") + let config = Configuration(organizationId: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") let openAI = OpenAI(config) self.model = try await openAI.retrieveModel(modelId: "text-davinci-001") diff --git a/README.md b/README.md index 5866b3b..d750fc3 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ import OpenAIKit // An API key and Organization ID is required to use the API library. // Note: It's recommended to load the API Key through a .plist dictionary, rather than hard coding it in a String. -let config = Configuration(organization: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") +let config = Configuration(organizationId: "INSERT-ORGANIZATION-ID", apiKey: "INSERT-API-KEY") // Create an `OpenAI` object using the Configuration object. let openAI = OpenAI(config) diff --git a/Sources/OpenAIKit/Types/Structs/Schemas/OpenAI/Configuration.swift b/Sources/OpenAIKit/Types/Structs/Schemas/OpenAI/Configuration.swift index fcbe78a..66f7a81 100644 --- a/Sources/OpenAIKit/Types/Structs/Schemas/OpenAI/Configuration.swift +++ b/Sources/OpenAIKit/Types/Structs/Schemas/OpenAI/Configuration.swift @@ -25,14 +25,14 @@ /// The configuration object used for the OpenAIKit object to represent the organization of the user. public struct Configuration { - /// The organization name of the user. - public let organization: String + /// The organization ID of the user. + public let organizationId: String /// The API key associated with the user. let apiKey: String - public init(organization: String, apiKey: String) { - self.organization = organization + public init(organizationId: String, apiKey: String) { + self.organizationId = organizationId self.apiKey = apiKey } }