diff --git a/README.md b/README.md index 8079eeb..3ad5069 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ repositories { Then, simply import the dependency to your `build.gradle` dependencies: ```kotlin -implementation("co.yml:ychat:1.1.1") +implementation("co.yml:ychat:1.2.0") ``` Take a look at the Kotlin code snippet below for an example of how to initialize and use one of the supported features: diff --git a/YChat-1.1.1.zip b/YChat-1.2.0.zip similarity index 53% rename from YChat-1.1.1.zip rename to YChat-1.2.0.zip index 7c039ac..ccff79c 100644 Binary files a/YChat-1.1.1.zip and b/YChat-1.2.0.zip differ diff --git a/YChat.xcframework/ios-arm64/YChat.framework/Headers/YChat.h b/YChat.xcframework/ios-arm64/YChat.framework/Headers/YChat.h index dd8fd13..4941168 100644 --- a/YChat.xcframework/ios-arm64/YChat.framework/Headers/YChat.h +++ b/YChat.xcframework/ios-arm64/YChat.framework/Headers/YChat.h @@ -6,9 +6,9 @@ #import #import -@class YChatKotlinThrowable, YChatYChatCompanion, YChatChatMessage, YChatKotlinArray, YChatKotlinException, YChatKotlinRuntimeException, YChatKotlinIllegalStateException; +@class YChatKotlinThrowable, YChatYChatCompanion, YChatAIModelPermission, YChatAIModel, YChatChatMessage, YChatKotlinArray, YChatKotlinException, YChatKotlinRuntimeException, YChatKotlinIllegalStateException; -@protocol YChatChatCompletions, YChatCompletion, YChatEdits, YChatImageGenerations, YChatYChat, YChatYChatCallback, YChatKotlinIterator; +@protocol YChatChatCompletions, YChatCompletion, YChatEdits, YChatImageGenerations, YChatListModels, YChatRetrieveModel, YChatYChat, YChatYChatCallback, YChatKotlinIterator; NS_ASSUME_NONNULL_BEGIN #pragma clang diagnostic push @@ -151,6 +151,8 @@ __attribute__((swift_name("YChat"))) - (id)completion __attribute__((swift_name("completion()"))); - (id)edits __attribute__((swift_name("edits()"))); - (id)imageGenerations __attribute__((swift_name("imageGenerations()"))); +- (id)listModels __attribute__((swift_name("listModels()"))); +- (id)retrieveModel __attribute__((swift_name("retrieveModel()"))); @end __attribute__((swift_name("YChatCallback"))) @@ -175,6 +177,50 @@ __attribute__((swift_name("YChatCompanion"))) - (id)createApiKey:(NSString *)apiKey __attribute__((swift_name("create(apiKey:)"))); @end +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("AIModel"))) +@interface YChatAIModel : YChatBase +- (instancetype)initWithId:(NSString *)id ownedBy:(NSString *)ownedBy permission:(NSArray *)permission __attribute__((swift_name("init(id:ownedBy:permission:)"))) __attribute__((objc_designated_initializer)); +- (NSString *)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); +- (NSString *)component2 __attribute__((swift_name("component2()"))) __attribute__((deprecated("use corresponding property instead"))); +- (NSArray *)component3 __attribute__((swift_name("component3()"))) __attribute__((deprecated("use corresponding property instead"))); +- (YChatAIModel *)doCopyId:(NSString *)id ownedBy:(NSString *)ownedBy permission:(NSArray *)permission __attribute__((swift_name("doCopy(id:ownedBy:permission:)"))); +- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)"))); +- (NSUInteger)hash __attribute__((swift_name("hash()"))); +- (NSString *)description __attribute__((swift_name("description()"))); +@property (readonly) NSString *id __attribute__((swift_name("id"))); +@property (readonly) NSString *ownedBy __attribute__((swift_name("ownedBy"))); +@property (readonly) NSArray *permission __attribute__((swift_name("permission"))); +@end + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("AIModelPermission"))) +@interface YChatAIModelPermission : YChatBase +- (instancetype)initWithId:(NSString *)id allowCreateEngine:(BOOL)allowCreateEngine allowSampling:(BOOL)allowSampling allowLogProbs:(BOOL)allowLogProbs allowSearchIndices:(BOOL)allowSearchIndices allowView:(BOOL)allowView allowFineTuning:(BOOL)allowFineTuning organization:(NSString *)organization isBlocking:(BOOL)isBlocking __attribute__((swift_name("init(id:allowCreateEngine:allowSampling:allowLogProbs:allowSearchIndices:allowView:allowFineTuning:organization:isBlocking:)"))) __attribute__((objc_designated_initializer)); +- (NSString *)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); +- (BOOL)component2 __attribute__((swift_name("component2()"))) __attribute__((deprecated("use corresponding property instead"))); +- (BOOL)component3 __attribute__((swift_name("component3()"))) __attribute__((deprecated("use corresponding property instead"))); +- (BOOL)component4 __attribute__((swift_name("component4()"))) __attribute__((deprecated("use corresponding property instead"))); +- (BOOL)component5 __attribute__((swift_name("component5()"))) __attribute__((deprecated("use corresponding property instead"))); +- (BOOL)component6 __attribute__((swift_name("component6()"))) __attribute__((deprecated("use corresponding property instead"))); +- (BOOL)component7 __attribute__((swift_name("component7()"))) __attribute__((deprecated("use corresponding property instead"))); +- (NSString *)component8 __attribute__((swift_name("component8()"))) __attribute__((deprecated("use corresponding property instead"))); +- (BOOL)component9 __attribute__((swift_name("component9()"))) __attribute__((deprecated("use corresponding property instead"))); +- (YChatAIModelPermission *)doCopyId:(NSString *)id allowCreateEngine:(BOOL)allowCreateEngine allowSampling:(BOOL)allowSampling allowLogProbs:(BOOL)allowLogProbs allowSearchIndices:(BOOL)allowSearchIndices allowView:(BOOL)allowView allowFineTuning:(BOOL)allowFineTuning organization:(NSString *)organization isBlocking:(BOOL)isBlocking __attribute__((swift_name("doCopy(id:allowCreateEngine:allowSampling:allowLogProbs:allowSearchIndices:allowView:allowFineTuning:organization:isBlocking:)"))); +- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)"))); +- (NSUInteger)hash __attribute__((swift_name("hash()"))); +- (NSString *)description __attribute__((swift_name("description()"))); +@property (readonly) BOOL allowCreateEngine __attribute__((swift_name("allowCreateEngine"))); +@property (readonly) BOOL allowFineTuning __attribute__((swift_name("allowFineTuning"))); +@property (readonly) BOOL allowLogProbs __attribute__((swift_name("allowLogProbs"))); +@property (readonly) BOOL allowSampling __attribute__((swift_name("allowSampling"))); +@property (readonly) BOOL allowSearchIndices __attribute__((swift_name("allowSearchIndices"))); +@property (readonly) BOOL allowView __attribute__((swift_name("allowView"))); +@property (readonly) NSString *id __attribute__((swift_name("id"))); +@property (readonly) BOOL isBlocking __attribute__((swift_name("isBlocking"))); +@property (readonly) NSString *organization __attribute__((swift_name("organization"))); +@end + __attribute__((objc_subclassing_restricted)) __attribute__((swift_name("ChatMessage"))) @interface YChatChatMessage : YChatBase @@ -294,6 +340,30 @@ __attribute__((swift_name("ImageGenerations"))) - (id)setSizeSize:(NSString *)size __attribute__((swift_name("setSize(size:)"))); @end +__attribute__((swift_name("ListModels"))) +@protocol YChatListModels +@required + +/** + * @note This method converts instances of CancellationException, ChatGptException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executeWithCompletionHandler:(void (^)(NSArray * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(completionHandler:)"))); +- (void)executeCallback_:(id)callback __attribute__((swift_name("execute(callback_:)"))); +@end + +__attribute__((swift_name("RetrieveModel"))) +@protocol YChatRetrieveModel +@required + +/** + * @note This method converts instances of CancellationException, ChatGptException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executeId:(NSString *)id completionHandler:(void (^)(YChatAIModel * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(id:completionHandler:)"))); +- (void)executeId:(NSString *)id callback:(id)callback __attribute__((swift_name("execute(id:callback:)"))); +@end + __attribute__((objc_subclassing_restricted)) __attribute__((swift_name("KotlinArray"))) @interface YChatKotlinArray : YChatBase diff --git a/YChat.xcframework/ios-arm64/YChat.framework/YChat b/YChat.xcframework/ios-arm64/YChat.framework/YChat index 67e9d46..e4e7394 100755 Binary files a/YChat.xcframework/ios-arm64/YChat.framework/YChat and b/YChat.xcframework/ios-arm64/YChat.framework/YChat differ diff --git a/YChat.xcframework/ios-x86_64-simulator/YChat.framework/Headers/YChat.h b/YChat.xcframework/ios-x86_64-simulator/YChat.framework/Headers/YChat.h index dd8fd13..4941168 100644 --- a/YChat.xcframework/ios-x86_64-simulator/YChat.framework/Headers/YChat.h +++ b/YChat.xcframework/ios-x86_64-simulator/YChat.framework/Headers/YChat.h @@ -6,9 +6,9 @@ #import #import -@class YChatKotlinThrowable, YChatYChatCompanion, YChatChatMessage, YChatKotlinArray, YChatKotlinException, YChatKotlinRuntimeException, YChatKotlinIllegalStateException; +@class YChatKotlinThrowable, YChatYChatCompanion, YChatAIModelPermission, YChatAIModel, YChatChatMessage, YChatKotlinArray, YChatKotlinException, YChatKotlinRuntimeException, YChatKotlinIllegalStateException; -@protocol YChatChatCompletions, YChatCompletion, YChatEdits, YChatImageGenerations, YChatYChat, YChatYChatCallback, YChatKotlinIterator; +@protocol YChatChatCompletions, YChatCompletion, YChatEdits, YChatImageGenerations, YChatListModels, YChatRetrieveModel, YChatYChat, YChatYChatCallback, YChatKotlinIterator; NS_ASSUME_NONNULL_BEGIN #pragma clang diagnostic push @@ -151,6 +151,8 @@ __attribute__((swift_name("YChat"))) - (id)completion __attribute__((swift_name("completion()"))); - (id)edits __attribute__((swift_name("edits()"))); - (id)imageGenerations __attribute__((swift_name("imageGenerations()"))); +- (id)listModels __attribute__((swift_name("listModels()"))); +- (id)retrieveModel __attribute__((swift_name("retrieveModel()"))); @end __attribute__((swift_name("YChatCallback"))) @@ -175,6 +177,50 @@ __attribute__((swift_name("YChatCompanion"))) - (id)createApiKey:(NSString *)apiKey __attribute__((swift_name("create(apiKey:)"))); @end +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("AIModel"))) +@interface YChatAIModel : YChatBase +- (instancetype)initWithId:(NSString *)id ownedBy:(NSString *)ownedBy permission:(NSArray *)permission __attribute__((swift_name("init(id:ownedBy:permission:)"))) __attribute__((objc_designated_initializer)); +- (NSString *)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); +- (NSString *)component2 __attribute__((swift_name("component2()"))) __attribute__((deprecated("use corresponding property instead"))); +- (NSArray *)component3 __attribute__((swift_name("component3()"))) __attribute__((deprecated("use corresponding property instead"))); +- (YChatAIModel *)doCopyId:(NSString *)id ownedBy:(NSString *)ownedBy permission:(NSArray *)permission __attribute__((swift_name("doCopy(id:ownedBy:permission:)"))); +- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)"))); +- (NSUInteger)hash __attribute__((swift_name("hash()"))); +- (NSString *)description __attribute__((swift_name("description()"))); +@property (readonly) NSString *id __attribute__((swift_name("id"))); +@property (readonly) NSString *ownedBy __attribute__((swift_name("ownedBy"))); +@property (readonly) NSArray *permission __attribute__((swift_name("permission"))); +@end + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("AIModelPermission"))) +@interface YChatAIModelPermission : YChatBase +- (instancetype)initWithId:(NSString *)id allowCreateEngine:(BOOL)allowCreateEngine allowSampling:(BOOL)allowSampling allowLogProbs:(BOOL)allowLogProbs allowSearchIndices:(BOOL)allowSearchIndices allowView:(BOOL)allowView allowFineTuning:(BOOL)allowFineTuning organization:(NSString *)organization isBlocking:(BOOL)isBlocking __attribute__((swift_name("init(id:allowCreateEngine:allowSampling:allowLogProbs:allowSearchIndices:allowView:allowFineTuning:organization:isBlocking:)"))) __attribute__((objc_designated_initializer)); +- (NSString *)component1 __attribute__((swift_name("component1()"))) __attribute__((deprecated("use corresponding property instead"))); +- (BOOL)component2 __attribute__((swift_name("component2()"))) __attribute__((deprecated("use corresponding property instead"))); +- (BOOL)component3 __attribute__((swift_name("component3()"))) __attribute__((deprecated("use corresponding property instead"))); +- (BOOL)component4 __attribute__((swift_name("component4()"))) __attribute__((deprecated("use corresponding property instead"))); +- (BOOL)component5 __attribute__((swift_name("component5()"))) __attribute__((deprecated("use corresponding property instead"))); +- (BOOL)component6 __attribute__((swift_name("component6()"))) __attribute__((deprecated("use corresponding property instead"))); +- (BOOL)component7 __attribute__((swift_name("component7()"))) __attribute__((deprecated("use corresponding property instead"))); +- (NSString *)component8 __attribute__((swift_name("component8()"))) __attribute__((deprecated("use corresponding property instead"))); +- (BOOL)component9 __attribute__((swift_name("component9()"))) __attribute__((deprecated("use corresponding property instead"))); +- (YChatAIModelPermission *)doCopyId:(NSString *)id allowCreateEngine:(BOOL)allowCreateEngine allowSampling:(BOOL)allowSampling allowLogProbs:(BOOL)allowLogProbs allowSearchIndices:(BOOL)allowSearchIndices allowView:(BOOL)allowView allowFineTuning:(BOOL)allowFineTuning organization:(NSString *)organization isBlocking:(BOOL)isBlocking __attribute__((swift_name("doCopy(id:allowCreateEngine:allowSampling:allowLogProbs:allowSearchIndices:allowView:allowFineTuning:organization:isBlocking:)"))); +- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)"))); +- (NSUInteger)hash __attribute__((swift_name("hash()"))); +- (NSString *)description __attribute__((swift_name("description()"))); +@property (readonly) BOOL allowCreateEngine __attribute__((swift_name("allowCreateEngine"))); +@property (readonly) BOOL allowFineTuning __attribute__((swift_name("allowFineTuning"))); +@property (readonly) BOOL allowLogProbs __attribute__((swift_name("allowLogProbs"))); +@property (readonly) BOOL allowSampling __attribute__((swift_name("allowSampling"))); +@property (readonly) BOOL allowSearchIndices __attribute__((swift_name("allowSearchIndices"))); +@property (readonly) BOOL allowView __attribute__((swift_name("allowView"))); +@property (readonly) NSString *id __attribute__((swift_name("id"))); +@property (readonly) BOOL isBlocking __attribute__((swift_name("isBlocking"))); +@property (readonly) NSString *organization __attribute__((swift_name("organization"))); +@end + __attribute__((objc_subclassing_restricted)) __attribute__((swift_name("ChatMessage"))) @interface YChatChatMessage : YChatBase @@ -294,6 +340,30 @@ __attribute__((swift_name("ImageGenerations"))) - (id)setSizeSize:(NSString *)size __attribute__((swift_name("setSize(size:)"))); @end +__attribute__((swift_name("ListModels"))) +@protocol YChatListModels +@required + +/** + * @note This method converts instances of CancellationException, ChatGptException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executeWithCompletionHandler:(void (^)(NSArray * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(completionHandler:)"))); +- (void)executeCallback_:(id)callback __attribute__((swift_name("execute(callback_:)"))); +@end + +__attribute__((swift_name("RetrieveModel"))) +@protocol YChatRetrieveModel +@required + +/** + * @note This method converts instances of CancellationException, ChatGptException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executeId:(NSString *)id completionHandler:(void (^)(YChatAIModel * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(id:completionHandler:)"))); +- (void)executeId:(NSString *)id callback:(id)callback __attribute__((swift_name("execute(id:callback:)"))); +@end + __attribute__((objc_subclassing_restricted)) __attribute__((swift_name("KotlinArray"))) @interface YChatKotlinArray : YChatBase diff --git a/YChat.xcframework/ios-x86_64-simulator/YChat.framework/YChat b/YChat.xcframework/ios-x86_64-simulator/YChat.framework/YChat index 49c3dc1..cfac731 100755 Binary files a/YChat.xcframework/ios-x86_64-simulator/YChat.framework/YChat and b/YChat.xcframework/ios-x86_64-simulator/YChat.framework/YChat differ diff --git a/gradle.properties b/gradle.properties index 8388d54..141bf8e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,7 @@ kotlin.mpp.enableCInteropCommonization=true # Lib GROUP=co.yml POM_ARTIFACT_ID=ychat -VERSION_NAME=1.1.1 +VERSION_NAME=1.2.0 IOS_NAME=YChat # OSS