diff --git a/Package.swift b/Package.swift index 96209a3..7e19be5 100644 --- a/Package.swift +++ b/Package.swift @@ -4,7 +4,8 @@ import PackageDescription let package = Package( name: "YChat", platforms: [ - .iOS(.v13) + .iOS(.v13), + .macOS(.v11) ], products: [ .library( diff --git a/README.md b/README.md index a1f95cf..afa1992 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Y—Chat is a Kotlin Multiplatform (KMP) project that provides a simple API for The repository contains the source code for the Y—Chat library, along with examples and documentation for getting started with the library. The Y—Chat library provides a consistent interface for interacting with ChatGPT, regardless of the platform, and makes it easy to generate human-like text based on a given prompt or context. -The library uses Kotlin Multiplatform to generate artifacts for both iOS, Android and JVM, allowing developers to write code once and use it on multiple platforms. The project is open source and actively maintained, with contributions from the community encouraged. Overall, Y—Chat provides a convenient and powerful way for mobile developers to incorporate the advanced natural language processing capabilities of ChatGPT into their applications. +The library uses Kotlin Multiplatform to generate artifacts for both iOS, macOS, Android and JVM, allowing developers to write code once and use it on multiple platforms. The project is open source and actively maintained, with contributions from the community encouraged. Overall, Y—Chat provides a convenient and powerful way for mobile developers to incorporate the advanced natural language processing capabilities of ChatGPT into their applications. ## ⚡️ Getting Started @@ -59,7 +59,7 @@ repositories { Then, simply import the dependency to your `build.gradle` dependencies: ```kotlin -implementation("co.yml:ychat:1.3.0") +implementation("co.yml:ychat:1.4.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.4.0.zip b/YChat-1.4.0.zip new file mode 100644 index 0000000..0e43659 Binary files /dev/null and b/YChat-1.4.0.zip differ diff --git a/YChat.xcframework/Info.plist b/YChat.xcframework/Info.plist index d8d368c..c87482f 100644 --- a/YChat.xcframework/Info.plist +++ b/YChat.xcframework/Info.plist @@ -8,31 +8,45 @@ DebugSymbolsPath dSYMs LibraryIdentifier - ios-x86_64-simulator + ios-arm64 LibraryPath YChat.framework SupportedArchitectures - x86_64 + arm64 SupportedPlatform ios - SupportedPlatformVariant - simulator + + + LibraryIdentifier + macos-arm64_x86_64 + LibraryPath + YChat.framework + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + macos DebugSymbolsPath dSYMs LibraryIdentifier - ios-arm64 + ios-arm64_x86_64-simulator LibraryPath YChat.framework SupportedArchitectures arm64 + x86_64 SupportedPlatform ios + SupportedPlatformVariant + simulator CFBundlePackageType diff --git a/YChat.xcframework/ios-arm64/YChat.framework/Headers/YChat.h b/YChat.xcframework/ios-arm64/YChat.framework/Headers/YChat.h index b1c4614..5902529 100644 --- a/YChat.xcframework/ios-arm64/YChat.framework/Headers/YChat.h +++ b/YChat.xcframework/ios-arm64/YChat.framework/Headers/YChat.h @@ -6,7 +6,7 @@ #import #import -@class YChatKotlinThrowable, YChatYChatCompanion, YChatAIModelPermission, YChatAIModel, YChatChatMessage, YChatKotlinArray, YChatKotlinException, NSData, YChatKotlinByteArray, YChatKotlinRuntimeException, YChatKotlinIllegalStateException, YChatKotlinByteIterator; +@class YChatKotlinThrowable, YChatYChatCompanion, YChatAIModelPermission, YChatAIModel, YChatChatMessage, NSData, YChatKotlinArray, YChatKotlinException, YChatKotlinRuntimeException, YChatKotlinIllegalStateException; @protocol YChatAudioTranscriptions, YChatAudioTranslations, YChatChatCompletions, YChatCompletion, YChatEdits, YChatImageGenerations, YChatListModels, YChatRetrieveModel, YChatYChat, YChatYChatCallback, YChatKotlinIterator; @@ -237,49 +237,12 @@ __attribute__((swift_name("ChatMessage"))) @property (readonly) NSString *role __attribute__((swift_name("role"))); @end -__attribute__((swift_name("KotlinThrowable"))) -@interface YChatKotlinThrowable : YChatBase -- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); -- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); -- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); -+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); -- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); -- (YChatKotlinArray *)getStackTrace __attribute__((swift_name("getStackTrace()"))); -- (void)printStackTrace __attribute__((swift_name("printStackTrace()"))); -- (NSString *)description __attribute__((swift_name("description()"))); -@property (readonly) YChatKotlinThrowable * _Nullable cause __attribute__((swift_name("cause"))); -@property (readonly) NSString * _Nullable message __attribute__((swift_name("message"))); -- (NSError *)asError __attribute__((swift_name("asError()"))); -@end - -__attribute__((swift_name("KotlinException"))) -@interface YChatKotlinException : YChatKotlinThrowable -- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); -+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); -- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); -- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); -- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); -@end - -__attribute__((objc_subclassing_restricted)) -__attribute__((swift_name("ChatGptException"))) -@interface YChatChatGptException : YChatKotlinException -- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause statusCode:(YChatInt * _Nullable)statusCode __attribute__((swift_name("init(cause:statusCode:)"))) __attribute__((objc_designated_initializer)); -- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause statusCode:(YChatInt * _Nullable)statusCode __attribute__((swift_name("init(message:cause:statusCode:)"))) __attribute__((objc_designated_initializer)); -- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); -+ (instancetype)new __attribute__((unavailable)); -- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); -- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); -- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); -@property YChatInt * _Nullable statusCode __attribute__((swift_name("statusCode"))); -@end - __attribute__((swift_name("AudioTranscriptions"))) @protocol YChatAudioTranscriptions @required /** - * @note This method converts instances of CancellationException, ChatGptException to errors. + * @note This method converts instances of CancellationException, YChatException to errors. * Other uncaught Kotlin exceptions are fatal. */ - (void)executeFilename:(NSString *)filename audioFile:(NSData *)audioFile completionHandler:(void (^)(NSString * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(filename:audioFile:completionHandler:)"))); @@ -296,7 +259,7 @@ __attribute__((swift_name("AudioTranslations"))) @required /** - * @note This method converts instances of CancellationException, ChatGptException to errors. + * @note This method converts instances of CancellationException, YChatException to errors. * Other uncaught Kotlin exceptions are fatal. */ - (void)executeFilename:(NSString *)filename audioFile:(NSData *)audioFile completionHandler:(void (^)(NSString * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(filename:audioFile:completionHandler:)"))); @@ -313,7 +276,7 @@ __attribute__((swift_name("ChatCompletions"))) - (id)addMessageRole:(NSString *)role content:(NSString *)content __attribute__((swift_name("addMessage(role:content:)"))); /** - * @note This method converts instances of CancellationException, ChatGptException to errors. + * @note This method converts instances of CancellationException, YChatException to errors. * Other uncaught Kotlin exceptions are fatal. */ - (void)executeContent:(NSString *)content completionHandler:(void (^)(NSArray * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(content:completionHandler:)"))); @@ -330,7 +293,7 @@ __attribute__((swift_name("Completion"))) @required /** - * @note This method converts instances of CancellationException, ChatGptException to errors. + * @note This method converts instances of CancellationException, YChatException to errors. * Other uncaught Kotlin exceptions are fatal. */ - (void)executeWithCompletionHandler:(void (^)(NSString * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(completionHandler:)"))); @@ -348,7 +311,7 @@ __attribute__((swift_name("Edits"))) @required /** - * @note This method converts instances of CancellationException, ChatGptException to errors. + * @note This method converts instances of CancellationException, YChatException to errors. * Other uncaught Kotlin exceptions are fatal. */ - (void)executeInstruction:(NSString *)instruction completionHandler:(void (^)(NSArray * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(instruction:completionHandler:)"))); @@ -365,7 +328,7 @@ __attribute__((swift_name("ImageGenerations"))) @required /** - * @note This method converts instances of CancellationException, ChatGptException to errors. + * @note This method converts instances of CancellationException, YChatException to errors. * Other uncaught Kotlin exceptions are fatal. */ - (void)executePrompt:(NSString *)prompt completionHandler:(void (^)(NSArray * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(prompt:completionHandler:)"))); @@ -380,7 +343,7 @@ __attribute__((swift_name("ListModels"))) @required /** - * @note This method converts instances of CancellationException, ChatGptException to errors. + * @note This method converts instances of CancellationException, YChatException to errors. * Other uncaught Kotlin exceptions are fatal. */ - (void)executeWithCompletionHandler:(void (^)(NSArray * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(completionHandler:)"))); @@ -392,29 +355,35 @@ __attribute__((swift_name("RetrieveModel"))) @required /** - * @note This method converts instances of CancellationException, ChatGptException to errors. + * @note This method converts instances of CancellationException, YChatException 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("FileBytesKt"))) -@interface YChatFileBytesKt : YChatBase -+ (YChatKotlinByteArray *)toByteArray:(NSData *)receiver __attribute__((swift_name("toByteArray(_:)"))); +__attribute__((swift_name("KotlinThrowable"))) +@interface YChatKotlinThrowable : YChatBase +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); +- (YChatKotlinArray *)getStackTrace __attribute__((swift_name("getStackTrace()"))); +- (void)printStackTrace __attribute__((swift_name("printStackTrace()"))); +- (NSString *)description __attribute__((swift_name("description()"))); +@property (readonly) YChatKotlinThrowable * _Nullable cause __attribute__((swift_name("cause"))); +@property (readonly) NSString * _Nullable message __attribute__((swift_name("message"))); +- (NSError *)asError __attribute__((swift_name("asError()"))); @end -__attribute__((objc_subclassing_restricted)) -__attribute__((swift_name("KotlinArray"))) -@interface YChatKotlinArray : YChatBase -+ (instancetype)arrayWithSize:(int32_t)size init:(T _Nullable (^)(YChatInt *))init __attribute__((swift_name("init(size:init:)"))); -+ (instancetype)alloc __attribute__((unavailable)); -+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); -- (T _Nullable)getIndex:(int32_t)index __attribute__((swift_name("get(index:)"))); -- (id)iterator __attribute__((swift_name("iterator()"))); -- (void)setIndex:(int32_t)index value:(T _Nullable)value __attribute__((swift_name("set(index:value:)"))); -@property (readonly) int32_t size __attribute__((swift_name("size"))); +__attribute__((swift_name("KotlinException"))) +@interface YChatKotlinException : YChatKotlinThrowable +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); @end __attribute__((swift_name("KotlinRuntimeException"))) @@ -450,15 +419,27 @@ __attribute__((swift_name("KotlinCancellationException"))) @end __attribute__((objc_subclassing_restricted)) -__attribute__((swift_name("KotlinByteArray"))) -@interface YChatKotlinByteArray : YChatBase -+ (instancetype)arrayWithSize:(int32_t)size __attribute__((swift_name("init(size:)"))); -+ (instancetype)arrayWithSize:(int32_t)size init:(YChatByte *(^)(YChatInt *))init __attribute__((swift_name("init(size:init:)"))); +__attribute__((swift_name("Ychat_coreYChatException"))) +@interface YChatYchat_coreYChatException : YChatKotlinException +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause statusCode:(YChatInt * _Nullable)statusCode __attribute__((swift_name("init(cause:statusCode:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause statusCode:(YChatInt * _Nullable)statusCode __attribute__((swift_name("init(message:cause:statusCode:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); ++ (instancetype)new __attribute__((unavailable)); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +@property YChatInt * _Nullable statusCode __attribute__((swift_name("statusCode"))); +@end + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("KotlinArray"))) +@interface YChatKotlinArray : YChatBase ++ (instancetype)arrayWithSize:(int32_t)size init:(T _Nullable (^)(YChatInt *))init __attribute__((swift_name("init(size:init:)"))); + (instancetype)alloc __attribute__((unavailable)); + (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); -- (int8_t)getIndex:(int32_t)index __attribute__((swift_name("get(index:)"))); -- (YChatKotlinByteIterator *)iterator __attribute__((swift_name("iterator()"))); -- (void)setIndex:(int32_t)index value:(int8_t)value __attribute__((swift_name("set(index:value:)"))); +- (T _Nullable)getIndex:(int32_t)index __attribute__((swift_name("get(index:)"))); +- (id)iterator __attribute__((swift_name("iterator()"))); +- (void)setIndex:(int32_t)index value:(T _Nullable)value __attribute__((swift_name("set(index:value:)"))); @property (readonly) int32_t size __attribute__((swift_name("size"))); @end @@ -469,14 +450,6 @@ __attribute__((swift_name("KotlinIterator"))) - (id _Nullable)next __attribute__((swift_name("next()"))); @end -__attribute__((swift_name("KotlinByteIterator"))) -@interface YChatKotlinByteIterator : YChatBase -- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); -+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); -- (YChatByte *)next __attribute__((swift_name("next()"))); -- (int8_t)nextByte __attribute__((swift_name("nextByte()"))); -@end - #pragma pop_macro("_Nullable_result") #pragma clang diagnostic pop NS_ASSUME_NONNULL_END diff --git a/YChat.xcframework/ios-arm64/YChat.framework/YChat b/YChat.xcframework/ios-arm64/YChat.framework/YChat index 1b0bfe7..6a107b4 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-arm64/dSYMs/YChat.framework.dSYM/Contents/Resources/DWARF/YChat b/YChat.xcframework/ios-arm64/dSYMs/YChat.framework.dSYM/Contents/Resources/DWARF/YChat index 2937e3b..49407c5 100644 Binary files a/YChat.xcframework/ios-arm64/dSYMs/YChat.framework.dSYM/Contents/Resources/DWARF/YChat and b/YChat.xcframework/ios-arm64/dSYMs/YChat.framework.dSYM/Contents/Resources/DWARF/YChat differ diff --git a/YChat.xcframework/ios-x86_64-simulator/YChat.framework/Headers/YChat.h b/YChat.xcframework/ios-arm64_x86_64-simulator/YChat.framework/Headers/YChat.h similarity index 93% rename from YChat.xcframework/ios-x86_64-simulator/YChat.framework/Headers/YChat.h rename to YChat.xcframework/ios-arm64_x86_64-simulator/YChat.framework/Headers/YChat.h index b1c4614..5902529 100644 --- a/YChat.xcframework/ios-x86_64-simulator/YChat.framework/Headers/YChat.h +++ b/YChat.xcframework/ios-arm64_x86_64-simulator/YChat.framework/Headers/YChat.h @@ -6,7 +6,7 @@ #import #import -@class YChatKotlinThrowable, YChatYChatCompanion, YChatAIModelPermission, YChatAIModel, YChatChatMessage, YChatKotlinArray, YChatKotlinException, NSData, YChatKotlinByteArray, YChatKotlinRuntimeException, YChatKotlinIllegalStateException, YChatKotlinByteIterator; +@class YChatKotlinThrowable, YChatYChatCompanion, YChatAIModelPermission, YChatAIModel, YChatChatMessage, NSData, YChatKotlinArray, YChatKotlinException, YChatKotlinRuntimeException, YChatKotlinIllegalStateException; @protocol YChatAudioTranscriptions, YChatAudioTranslations, YChatChatCompletions, YChatCompletion, YChatEdits, YChatImageGenerations, YChatListModels, YChatRetrieveModel, YChatYChat, YChatYChatCallback, YChatKotlinIterator; @@ -237,49 +237,12 @@ __attribute__((swift_name("ChatMessage"))) @property (readonly) NSString *role __attribute__((swift_name("role"))); @end -__attribute__((swift_name("KotlinThrowable"))) -@interface YChatKotlinThrowable : YChatBase -- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); -- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); -- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); -+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); -- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); -- (YChatKotlinArray *)getStackTrace __attribute__((swift_name("getStackTrace()"))); -- (void)printStackTrace __attribute__((swift_name("printStackTrace()"))); -- (NSString *)description __attribute__((swift_name("description()"))); -@property (readonly) YChatKotlinThrowable * _Nullable cause __attribute__((swift_name("cause"))); -@property (readonly) NSString * _Nullable message __attribute__((swift_name("message"))); -- (NSError *)asError __attribute__((swift_name("asError()"))); -@end - -__attribute__((swift_name("KotlinException"))) -@interface YChatKotlinException : YChatKotlinThrowable -- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); -+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); -- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); -- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); -- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); -@end - -__attribute__((objc_subclassing_restricted)) -__attribute__((swift_name("ChatGptException"))) -@interface YChatChatGptException : YChatKotlinException -- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause statusCode:(YChatInt * _Nullable)statusCode __attribute__((swift_name("init(cause:statusCode:)"))) __attribute__((objc_designated_initializer)); -- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause statusCode:(YChatInt * _Nullable)statusCode __attribute__((swift_name("init(message:cause:statusCode:)"))) __attribute__((objc_designated_initializer)); -- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); -+ (instancetype)new __attribute__((unavailable)); -- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); -- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); -- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); -@property YChatInt * _Nullable statusCode __attribute__((swift_name("statusCode"))); -@end - __attribute__((swift_name("AudioTranscriptions"))) @protocol YChatAudioTranscriptions @required /** - * @note This method converts instances of CancellationException, ChatGptException to errors. + * @note This method converts instances of CancellationException, YChatException to errors. * Other uncaught Kotlin exceptions are fatal. */ - (void)executeFilename:(NSString *)filename audioFile:(NSData *)audioFile completionHandler:(void (^)(NSString * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(filename:audioFile:completionHandler:)"))); @@ -296,7 +259,7 @@ __attribute__((swift_name("AudioTranslations"))) @required /** - * @note This method converts instances of CancellationException, ChatGptException to errors. + * @note This method converts instances of CancellationException, YChatException to errors. * Other uncaught Kotlin exceptions are fatal. */ - (void)executeFilename:(NSString *)filename audioFile:(NSData *)audioFile completionHandler:(void (^)(NSString * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(filename:audioFile:completionHandler:)"))); @@ -313,7 +276,7 @@ __attribute__((swift_name("ChatCompletions"))) - (id)addMessageRole:(NSString *)role content:(NSString *)content __attribute__((swift_name("addMessage(role:content:)"))); /** - * @note This method converts instances of CancellationException, ChatGptException to errors. + * @note This method converts instances of CancellationException, YChatException to errors. * Other uncaught Kotlin exceptions are fatal. */ - (void)executeContent:(NSString *)content completionHandler:(void (^)(NSArray * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(content:completionHandler:)"))); @@ -330,7 +293,7 @@ __attribute__((swift_name("Completion"))) @required /** - * @note This method converts instances of CancellationException, ChatGptException to errors. + * @note This method converts instances of CancellationException, YChatException to errors. * Other uncaught Kotlin exceptions are fatal. */ - (void)executeWithCompletionHandler:(void (^)(NSString * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(completionHandler:)"))); @@ -348,7 +311,7 @@ __attribute__((swift_name("Edits"))) @required /** - * @note This method converts instances of CancellationException, ChatGptException to errors. + * @note This method converts instances of CancellationException, YChatException to errors. * Other uncaught Kotlin exceptions are fatal. */ - (void)executeInstruction:(NSString *)instruction completionHandler:(void (^)(NSArray * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(instruction:completionHandler:)"))); @@ -365,7 +328,7 @@ __attribute__((swift_name("ImageGenerations"))) @required /** - * @note This method converts instances of CancellationException, ChatGptException to errors. + * @note This method converts instances of CancellationException, YChatException to errors. * Other uncaught Kotlin exceptions are fatal. */ - (void)executePrompt:(NSString *)prompt completionHandler:(void (^)(NSArray * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(prompt:completionHandler:)"))); @@ -380,7 +343,7 @@ __attribute__((swift_name("ListModels"))) @required /** - * @note This method converts instances of CancellationException, ChatGptException to errors. + * @note This method converts instances of CancellationException, YChatException to errors. * Other uncaught Kotlin exceptions are fatal. */ - (void)executeWithCompletionHandler:(void (^)(NSArray * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(completionHandler:)"))); @@ -392,29 +355,35 @@ __attribute__((swift_name("RetrieveModel"))) @required /** - * @note This method converts instances of CancellationException, ChatGptException to errors. + * @note This method converts instances of CancellationException, YChatException 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("FileBytesKt"))) -@interface YChatFileBytesKt : YChatBase -+ (YChatKotlinByteArray *)toByteArray:(NSData *)receiver __attribute__((swift_name("toByteArray(_:)"))); +__attribute__((swift_name("KotlinThrowable"))) +@interface YChatKotlinThrowable : YChatBase +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); +- (YChatKotlinArray *)getStackTrace __attribute__((swift_name("getStackTrace()"))); +- (void)printStackTrace __attribute__((swift_name("printStackTrace()"))); +- (NSString *)description __attribute__((swift_name("description()"))); +@property (readonly) YChatKotlinThrowable * _Nullable cause __attribute__((swift_name("cause"))); +@property (readonly) NSString * _Nullable message __attribute__((swift_name("message"))); +- (NSError *)asError __attribute__((swift_name("asError()"))); @end -__attribute__((objc_subclassing_restricted)) -__attribute__((swift_name("KotlinArray"))) -@interface YChatKotlinArray : YChatBase -+ (instancetype)arrayWithSize:(int32_t)size init:(T _Nullable (^)(YChatInt *))init __attribute__((swift_name("init(size:init:)"))); -+ (instancetype)alloc __attribute__((unavailable)); -+ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); -- (T _Nullable)getIndex:(int32_t)index __attribute__((swift_name("get(index:)"))); -- (id)iterator __attribute__((swift_name("iterator()"))); -- (void)setIndex:(int32_t)index value:(T _Nullable)value __attribute__((swift_name("set(index:value:)"))); -@property (readonly) int32_t size __attribute__((swift_name("size"))); +__attribute__((swift_name("KotlinException"))) +@interface YChatKotlinException : YChatKotlinThrowable +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); @end __attribute__((swift_name("KotlinRuntimeException"))) @@ -450,15 +419,27 @@ __attribute__((swift_name("KotlinCancellationException"))) @end __attribute__((objc_subclassing_restricted)) -__attribute__((swift_name("KotlinByteArray"))) -@interface YChatKotlinByteArray : YChatBase -+ (instancetype)arrayWithSize:(int32_t)size __attribute__((swift_name("init(size:)"))); -+ (instancetype)arrayWithSize:(int32_t)size init:(YChatByte *(^)(YChatInt *))init __attribute__((swift_name("init(size:init:)"))); +__attribute__((swift_name("Ychat_coreYChatException"))) +@interface YChatYchat_coreYChatException : YChatKotlinException +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause statusCode:(YChatInt * _Nullable)statusCode __attribute__((swift_name("init(cause:statusCode:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause statusCode:(YChatInt * _Nullable)statusCode __attribute__((swift_name("init(message:cause:statusCode:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); ++ (instancetype)new __attribute__((unavailable)); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +@property YChatInt * _Nullable statusCode __attribute__((swift_name("statusCode"))); +@end + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("KotlinArray"))) +@interface YChatKotlinArray : YChatBase ++ (instancetype)arrayWithSize:(int32_t)size init:(T _Nullable (^)(YChatInt *))init __attribute__((swift_name("init(size:init:)"))); + (instancetype)alloc __attribute__((unavailable)); + (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); -- (int8_t)getIndex:(int32_t)index __attribute__((swift_name("get(index:)"))); -- (YChatKotlinByteIterator *)iterator __attribute__((swift_name("iterator()"))); -- (void)setIndex:(int32_t)index value:(int8_t)value __attribute__((swift_name("set(index:value:)"))); +- (T _Nullable)getIndex:(int32_t)index __attribute__((swift_name("get(index:)"))); +- (id)iterator __attribute__((swift_name("iterator()"))); +- (void)setIndex:(int32_t)index value:(T _Nullable)value __attribute__((swift_name("set(index:value:)"))); @property (readonly) int32_t size __attribute__((swift_name("size"))); @end @@ -469,14 +450,6 @@ __attribute__((swift_name("KotlinIterator"))) - (id _Nullable)next __attribute__((swift_name("next()"))); @end -__attribute__((swift_name("KotlinByteIterator"))) -@interface YChatKotlinByteIterator : YChatBase -- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); -+ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); -- (YChatByte *)next __attribute__((swift_name("next()"))); -- (int8_t)nextByte __attribute__((swift_name("nextByte()"))); -@end - #pragma pop_macro("_Nullable_result") #pragma clang diagnostic pop NS_ASSUME_NONNULL_END diff --git a/YChat.xcframework/ios-arm64_x86_64-simulator/YChat.framework/Info.plist b/YChat.xcframework/ios-arm64_x86_64-simulator/YChat.framework/Info.plist new file mode 100644 index 0000000..bf0c753 --- /dev/null +++ b/YChat.xcframework/ios-arm64_x86_64-simulator/YChat.framework/Info.plist @@ -0,0 +1,31 @@ + + + + + CFBundleExecutable + YChat + CFBundleIdentifier + co.yml.ychat.YChat + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + YChat + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSupportedPlatforms + + iPhoneOS + + CFBundleVersion + 1 + MinimumOSVersion + 9.0 + UIDeviceFamily + + 1 + 2 + + + diff --git a/YChat.xcframework/ios-arm64_x86_64-simulator/YChat.framework/Modules/module.modulemap b/YChat.xcframework/ios-arm64_x86_64-simulator/YChat.framework/Modules/module.modulemap new file mode 100644 index 0000000..f6b5eaf --- /dev/null +++ b/YChat.xcframework/ios-arm64_x86_64-simulator/YChat.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module YChat { + umbrella header "YChat.h" + + export * + module * { export * } +} \ No newline at end of file diff --git a/YChat.xcframework/ios-arm64_x86_64-simulator/YChat.framework/YChat b/YChat.xcframework/ios-arm64_x86_64-simulator/YChat.framework/YChat new file mode 100755 index 0000000..8f0e982 Binary files /dev/null and b/YChat.xcframework/ios-arm64_x86_64-simulator/YChat.framework/YChat differ diff --git a/YChat.xcframework/ios-x86_64-simulator/dSYMs/YChat.framework.dSYM/Contents/Info.plist b/YChat.xcframework/ios-arm64_x86_64-simulator/dSYMs/YChat.framework.dSYM/Contents/Info.plist similarity index 100% rename from YChat.xcframework/ios-x86_64-simulator/dSYMs/YChat.framework.dSYM/Contents/Info.plist rename to YChat.xcframework/ios-arm64_x86_64-simulator/dSYMs/YChat.framework.dSYM/Contents/Info.plist diff --git a/YChat.xcframework/ios-arm64_x86_64-simulator/dSYMs/YChat.framework.dSYM/Contents/Resources/DWARF/YChat b/YChat.xcframework/ios-arm64_x86_64-simulator/dSYMs/YChat.framework.dSYM/Contents/Resources/DWARF/YChat new file mode 100644 index 0000000..87fe5b3 Binary files /dev/null and b/YChat.xcframework/ios-arm64_x86_64-simulator/dSYMs/YChat.framework.dSYM/Contents/Resources/DWARF/YChat differ diff --git a/YChat.xcframework/ios-x86_64-simulator/YChat.framework/YChat b/YChat.xcframework/ios-x86_64-simulator/YChat.framework/YChat deleted file mode 100755 index 0b8f3e2..0000000 Binary files a/YChat.xcframework/ios-x86_64-simulator/YChat.framework/YChat and /dev/null differ diff --git a/YChat.xcframework/ios-x86_64-simulator/dSYMs/YChat.framework.dSYM/Contents/Resources/DWARF/YChat b/YChat.xcframework/ios-x86_64-simulator/dSYMs/YChat.framework.dSYM/Contents/Resources/DWARF/YChat deleted file mode 100644 index aeb0eca..0000000 Binary files a/YChat.xcframework/ios-x86_64-simulator/dSYMs/YChat.framework.dSYM/Contents/Resources/DWARF/YChat and /dev/null differ diff --git a/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Headers/YChat.h b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Headers/YChat.h new file mode 100644 index 0000000..5902529 --- /dev/null +++ b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Headers/YChat.h @@ -0,0 +1,455 @@ +#import +#import +#import +#import +#import +#import +#import + +@class YChatKotlinThrowable, YChatYChatCompanion, YChatAIModelPermission, YChatAIModel, YChatChatMessage, NSData, YChatKotlinArray, YChatKotlinException, YChatKotlinRuntimeException, YChatKotlinIllegalStateException; + +@protocol YChatAudioTranscriptions, YChatAudioTranslations, YChatChatCompletions, YChatCompletion, YChatEdits, YChatImageGenerations, YChatListModels, YChatRetrieveModel, YChatYChat, YChatYChatCallback, YChatKotlinIterator; + +NS_ASSUME_NONNULL_BEGIN +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunknown-warning-option" +#pragma clang diagnostic ignored "-Wincompatible-property-type" +#pragma clang diagnostic ignored "-Wnullability" + +#pragma push_macro("_Nullable_result") +#if !__has_feature(nullability_nullable_result) +#undef _Nullable_result +#define _Nullable_result _Nullable +#endif + +__attribute__((swift_name("KotlinBase"))) +@interface YChatBase : NSObject +- (instancetype)init __attribute__((unavailable)); ++ (instancetype)new __attribute__((unavailable)); ++ (void)initialize __attribute__((objc_requires_super)); +@end + +@interface YChatBase (YChatBaseCopying) +@end + +__attribute__((swift_name("KotlinMutableSet"))) +@interface YChatMutableSet : NSMutableSet +@end + +__attribute__((swift_name("KotlinMutableDictionary"))) +@interface YChatMutableDictionary : NSMutableDictionary +@end + +@interface NSError (NSErrorYChatKotlinException) +@property (readonly) id _Nullable kotlinException; +@end + +__attribute__((swift_name("KotlinNumber"))) +@interface YChatNumber : NSNumber +- (instancetype)initWithChar:(char)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedChar:(unsigned char)value __attribute__((unavailable)); +- (instancetype)initWithShort:(short)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedShort:(unsigned short)value __attribute__((unavailable)); +- (instancetype)initWithInt:(int)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedInt:(unsigned int)value __attribute__((unavailable)); +- (instancetype)initWithLong:(long)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedLong:(unsigned long)value __attribute__((unavailable)); +- (instancetype)initWithLongLong:(long long)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedLongLong:(unsigned long long)value __attribute__((unavailable)); +- (instancetype)initWithFloat:(float)value __attribute__((unavailable)); +- (instancetype)initWithDouble:(double)value __attribute__((unavailable)); +- (instancetype)initWithBool:(BOOL)value __attribute__((unavailable)); +- (instancetype)initWithInteger:(NSInteger)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedInteger:(NSUInteger)value __attribute__((unavailable)); ++ (instancetype)numberWithChar:(char)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedChar:(unsigned char)value __attribute__((unavailable)); ++ (instancetype)numberWithShort:(short)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedShort:(unsigned short)value __attribute__((unavailable)); ++ (instancetype)numberWithInt:(int)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedInt:(unsigned int)value __attribute__((unavailable)); ++ (instancetype)numberWithLong:(long)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedLong:(unsigned long)value __attribute__((unavailable)); ++ (instancetype)numberWithLongLong:(long long)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedLongLong:(unsigned long long)value __attribute__((unavailable)); ++ (instancetype)numberWithFloat:(float)value __attribute__((unavailable)); ++ (instancetype)numberWithDouble:(double)value __attribute__((unavailable)); ++ (instancetype)numberWithBool:(BOOL)value __attribute__((unavailable)); ++ (instancetype)numberWithInteger:(NSInteger)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedInteger:(NSUInteger)value __attribute__((unavailable)); +@end + +__attribute__((swift_name("KotlinByte"))) +@interface YChatByte : YChatNumber +- (instancetype)initWithChar:(char)value; ++ (instancetype)numberWithChar:(char)value; +@end + +__attribute__((swift_name("KotlinUByte"))) +@interface YChatUByte : YChatNumber +- (instancetype)initWithUnsignedChar:(unsigned char)value; ++ (instancetype)numberWithUnsignedChar:(unsigned char)value; +@end + +__attribute__((swift_name("KotlinShort"))) +@interface YChatShort : YChatNumber +- (instancetype)initWithShort:(short)value; ++ (instancetype)numberWithShort:(short)value; +@end + +__attribute__((swift_name("KotlinUShort"))) +@interface YChatUShort : YChatNumber +- (instancetype)initWithUnsignedShort:(unsigned short)value; ++ (instancetype)numberWithUnsignedShort:(unsigned short)value; +@end + +__attribute__((swift_name("KotlinInt"))) +@interface YChatInt : YChatNumber +- (instancetype)initWithInt:(int)value; ++ (instancetype)numberWithInt:(int)value; +@end + +__attribute__((swift_name("KotlinUInt"))) +@interface YChatUInt : YChatNumber +- (instancetype)initWithUnsignedInt:(unsigned int)value; ++ (instancetype)numberWithUnsignedInt:(unsigned int)value; +@end + +__attribute__((swift_name("KotlinLong"))) +@interface YChatLong : YChatNumber +- (instancetype)initWithLongLong:(long long)value; ++ (instancetype)numberWithLongLong:(long long)value; +@end + +__attribute__((swift_name("KotlinULong"))) +@interface YChatULong : YChatNumber +- (instancetype)initWithUnsignedLongLong:(unsigned long long)value; ++ (instancetype)numberWithUnsignedLongLong:(unsigned long long)value; +@end + +__attribute__((swift_name("KotlinFloat"))) +@interface YChatFloat : YChatNumber +- (instancetype)initWithFloat:(float)value; ++ (instancetype)numberWithFloat:(float)value; +@end + +__attribute__((swift_name("KotlinDouble"))) +@interface YChatDouble : YChatNumber +- (instancetype)initWithDouble:(double)value; ++ (instancetype)numberWithDouble:(double)value; +@end + +__attribute__((swift_name("KotlinBoolean"))) +@interface YChatBoolean : YChatNumber +- (instancetype)initWithBool:(BOOL)value; ++ (instancetype)numberWithBool:(BOOL)value; +@end + +__attribute__((swift_name("YChat"))) +@protocol YChatYChat +@required +- (id)audioTranscriptions __attribute__((swift_name("audioTranscriptions()"))); +- (id)audioTranslations __attribute__((swift_name("audioTranslations()"))); +- (id)chatCompletions __attribute__((swift_name("chatCompletions()"))); +- (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"))) +@protocol YChatYChatCallback +@required +- (void)onErrorThrowable:(YChatKotlinThrowable *)throwable __attribute__((swift_name("onError(throwable:)"))); +- (void)onSuccessResult:(id _Nullable)result __attribute__((swift_name("onSuccess(result:)"))); +@end + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("YChatCompanion"))) +@interface YChatYChatCompanion : YChatBase ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); ++ (instancetype)companion __attribute__((swift_name("init()"))); +@property (class, readonly, getter=shared) YChatYChatCompanion *shared __attribute__((swift_name("shared"))); + +/** + * @note annotations + * kotlin.jvm.JvmStatic +*/ +- (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 +- (instancetype)initWithRole:(NSString *)role content:(NSString *)content __attribute__((swift_name("init(role:content:)"))) __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"))); +- (YChatChatMessage *)doCopyRole:(NSString *)role content:(NSString *)content __attribute__((swift_name("doCopy(role:content:)"))); +- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)"))); +- (NSUInteger)hash __attribute__((swift_name("hash()"))); +- (NSString *)description __attribute__((swift_name("description()"))); +@property (readonly) NSString *content __attribute__((swift_name("content"))); +@property (readonly) NSString *role __attribute__((swift_name("role"))); +@end + +__attribute__((swift_name("AudioTranscriptions"))) +@protocol YChatAudioTranscriptions +@required + +/** + * @note This method converts instances of CancellationException, YChatException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executeFilename:(NSString *)filename audioFile:(NSData *)audioFile completionHandler:(void (^)(NSString * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(filename:audioFile:completionHandler:)"))); +- (void)executeFilename:(NSString *)filename audioFile:(NSData *)audioFile callback:(id)callback __attribute__((swift_name("execute(filename:audioFile:callback:)"))); +- (id)setLanguageLanguage:(NSString *)language __attribute__((swift_name("setLanguage(language:)"))); +- (id)setModelModel:(NSString *)model __attribute__((swift_name("setModel(model:)"))); +- (id)setPromptPrompt:(NSString *)prompt __attribute__((swift_name("setPrompt(prompt:)"))); +- (id)setResponseFormatFormat:(NSString *)format __attribute__((swift_name("setResponseFormat(format:)"))); +- (id)setTemperatureTemperature:(double)temperature __attribute__((swift_name("setTemperature(temperature:)"))); +@end + +__attribute__((swift_name("AudioTranslations"))) +@protocol YChatAudioTranslations +@required + +/** + * @note This method converts instances of CancellationException, YChatException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executeFilename:(NSString *)filename audioFile:(NSData *)audioFile completionHandler:(void (^)(NSString * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(filename:audioFile:completionHandler:)"))); +- (void)executeFilename:(NSString *)filename audioFile:(NSData *)audioFile callback:(id)callback __attribute__((swift_name("execute(filename:audioFile:callback:)"))); +- (id)setModelModel:(NSString *)model __attribute__((swift_name("setModel(model:)"))); +- (id)setPromptPrompt:(NSString *)prompt __attribute__((swift_name("setPrompt(prompt:)"))); +- (id)setResponseFormatFormat:(NSString *)format __attribute__((swift_name("setResponseFormat(format:)"))); +- (id)setTemperatureTemperature:(double)temperature __attribute__((swift_name("setTemperature(temperature:)"))); +@end + +__attribute__((swift_name("ChatCompletions"))) +@protocol YChatChatCompletions +@required +- (id)addMessageRole:(NSString *)role content:(NSString *)content __attribute__((swift_name("addMessage(role:content:)"))); + +/** + * @note This method converts instances of CancellationException, YChatException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executeContent:(NSString *)content completionHandler:(void (^)(NSArray * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(content:completionHandler:)"))); +- (void)executeContent:(NSString *)content callback:(id)callback __attribute__((swift_name("execute(content:callback:)"))); +- (id)setMaxResultsResults:(int32_t)results __attribute__((swift_name("setMaxResults(results:)"))); +- (id)setMaxTokensTokens:(int32_t)tokens __attribute__((swift_name("setMaxTokens(tokens:)"))); +- (id)setModelModel:(NSString *)model __attribute__((swift_name("setModel(model:)"))); +- (id)setTemperatureTemperature:(double)temperature __attribute__((swift_name("setTemperature(temperature:)"))); +- (id)setTopPTopP:(double)topP __attribute__((swift_name("setTopP(topP:)"))); +@end + +__attribute__((swift_name("Completion"))) +@protocol YChatCompletion +@required + +/** + * @note This method converts instances of CancellationException, YChatException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executeWithCompletionHandler:(void (^)(NSString * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(completionHandler:)"))); +- (void)executeCallback:(id)callback __attribute__((swift_name("execute(callback:)"))); +- (id)saveHistoryIsSaveHistory:(BOOL)isSaveHistory __attribute__((swift_name("saveHistory(isSaveHistory:)"))); +- (id)setInputInput:(NSString *)input __attribute__((swift_name("setInput(input:)"))); +- (id)setMaxTokensTokens:(int32_t)tokens __attribute__((swift_name("setMaxTokens(tokens:)"))); +- (id)setModelModel:(NSString *)model __attribute__((swift_name("setModel(model:)"))); +- (id)setTemperatureTemperature:(double)temperature __attribute__((swift_name("setTemperature(temperature:)"))); +- (id)setTopPTopP:(double)topP __attribute__((swift_name("setTopP(topP:)"))); +@end + +__attribute__((swift_name("Edits"))) +@protocol YChatEdits +@required + +/** + * @note This method converts instances of CancellationException, YChatException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executeInstruction:(NSString *)instruction completionHandler:(void (^)(NSArray * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(instruction:completionHandler:)"))); +- (void)executeInstruction:(NSString *)instruction callback:(id)callback __attribute__((swift_name("execute(instruction:callback:)"))); +- (id)setInputInput:(NSString *)input __attribute__((swift_name("setInput(input:)"))); +- (id)setModelModel:(NSString *)model __attribute__((swift_name("setModel(model:)"))); +- (id)setResultsResults:(int32_t)results __attribute__((swift_name("setResults(results:)"))); +- (id)setTemperatureTemperature:(double)temperature __attribute__((swift_name("setTemperature(temperature:)"))); +- (id)setTopPTopP:(double)topP __attribute__((swift_name("setTopP(topP:)"))); +@end + +__attribute__((swift_name("ImageGenerations"))) +@protocol YChatImageGenerations +@required + +/** + * @note This method converts instances of CancellationException, YChatException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executePrompt:(NSString *)prompt completionHandler:(void (^)(NSArray * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(prompt:completionHandler:)"))); +- (void)executePrompt:(NSString *)prompt callback:(id)callback __attribute__((swift_name("execute(prompt:callback:)"))); +- (id)setResponseFormatResponseFormat:(NSString *)responseFormat __attribute__((swift_name("setResponseFormat(responseFormat:)"))); +- (id)setResultsResults:(int32_t)results __attribute__((swift_name("setResults(results:)"))); +- (id)setSizeSize:(NSString *)size __attribute__((swift_name("setSize(size:)"))); +@end + +__attribute__((swift_name("ListModels"))) +@protocol YChatListModels +@required + +/** + * @note This method converts instances of CancellationException, YChatException 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, YChatException 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__((swift_name("KotlinThrowable"))) +@interface YChatKotlinThrowable : YChatBase +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); +- (YChatKotlinArray *)getStackTrace __attribute__((swift_name("getStackTrace()"))); +- (void)printStackTrace __attribute__((swift_name("printStackTrace()"))); +- (NSString *)description __attribute__((swift_name("description()"))); +@property (readonly) YChatKotlinThrowable * _Nullable cause __attribute__((swift_name("cause"))); +@property (readonly) NSString * _Nullable message __attribute__((swift_name("message"))); +- (NSError *)asError __attribute__((swift_name("asError()"))); +@end + +__attribute__((swift_name("KotlinException"))) +@interface YChatKotlinException : YChatKotlinThrowable +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); +@end + +__attribute__((swift_name("KotlinRuntimeException"))) +@interface YChatKotlinRuntimeException : YChatKotlinException +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); +@end + +__attribute__((swift_name("KotlinIllegalStateException"))) +@interface YChatKotlinIllegalStateException : YChatKotlinRuntimeException +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); +@end + + +/** + * @note annotations + * kotlin.SinceKotlin(version="1.4") +*/ +__attribute__((swift_name("KotlinCancellationException"))) +@interface YChatKotlinCancellationException : YChatKotlinIllegalStateException +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); +@end + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("Ychat_coreYChatException"))) +@interface YChatYchat_coreYChatException : YChatKotlinException +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause statusCode:(YChatInt * _Nullable)statusCode __attribute__((swift_name("init(cause:statusCode:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause statusCode:(YChatInt * _Nullable)statusCode __attribute__((swift_name("init(message:cause:statusCode:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); ++ (instancetype)new __attribute__((unavailable)); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +@property YChatInt * _Nullable statusCode __attribute__((swift_name("statusCode"))); +@end + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("KotlinArray"))) +@interface YChatKotlinArray : YChatBase ++ (instancetype)arrayWithSize:(int32_t)size init:(T _Nullable (^)(YChatInt *))init __attribute__((swift_name("init(size:init:)"))); ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); +- (T _Nullable)getIndex:(int32_t)index __attribute__((swift_name("get(index:)"))); +- (id)iterator __attribute__((swift_name("iterator()"))); +- (void)setIndex:(int32_t)index value:(T _Nullable)value __attribute__((swift_name("set(index:value:)"))); +@property (readonly) int32_t size __attribute__((swift_name("size"))); +@end + +__attribute__((swift_name("KotlinIterator"))) +@protocol YChatKotlinIterator +@required +- (BOOL)hasNext __attribute__((swift_name("hasNext()"))); +- (id _Nullable)next __attribute__((swift_name("next()"))); +@end + +#pragma pop_macro("_Nullable_result") +#pragma clang diagnostic pop +NS_ASSUME_NONNULL_END diff --git a/YChat.xcframework/ios-x86_64-simulator/YChat.framework/Modules/module.modulemap b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Modules/module.modulemap similarity index 100% rename from YChat.xcframework/ios-x86_64-simulator/YChat.framework/Modules/module.modulemap rename to YChat.xcframework/macos-arm64_x86_64/YChat.framework/Modules/module.modulemap diff --git a/YChat.xcframework/ios-x86_64-simulator/YChat.framework/Info.plist b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Resources/Info.plist similarity index 76% rename from YChat.xcframework/ios-x86_64-simulator/YChat.framework/Info.plist rename to YChat.xcframework/macos-arm64_x86_64/YChat.framework/Resources/Info.plist index e675f2c..9268179 100644 --- a/YChat.xcframework/ios-x86_64-simulator/YChat.framework/Info.plist +++ b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Resources/Info.plist @@ -16,16 +16,9 @@ 1.0 CFBundleSupportedPlatforms - iPhoneSimulator + MacOSX CFBundleVersion 1 - MinimumOSVersion - 9.0 - UIDeviceFamily - - 1 - 2 - \ No newline at end of file diff --git a/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/A/Headers/YChat.h b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/A/Headers/YChat.h new file mode 100644 index 0000000..5902529 --- /dev/null +++ b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/A/Headers/YChat.h @@ -0,0 +1,455 @@ +#import +#import +#import +#import +#import +#import +#import + +@class YChatKotlinThrowable, YChatYChatCompanion, YChatAIModelPermission, YChatAIModel, YChatChatMessage, NSData, YChatKotlinArray, YChatKotlinException, YChatKotlinRuntimeException, YChatKotlinIllegalStateException; + +@protocol YChatAudioTranscriptions, YChatAudioTranslations, YChatChatCompletions, YChatCompletion, YChatEdits, YChatImageGenerations, YChatListModels, YChatRetrieveModel, YChatYChat, YChatYChatCallback, YChatKotlinIterator; + +NS_ASSUME_NONNULL_BEGIN +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunknown-warning-option" +#pragma clang diagnostic ignored "-Wincompatible-property-type" +#pragma clang diagnostic ignored "-Wnullability" + +#pragma push_macro("_Nullable_result") +#if !__has_feature(nullability_nullable_result) +#undef _Nullable_result +#define _Nullable_result _Nullable +#endif + +__attribute__((swift_name("KotlinBase"))) +@interface YChatBase : NSObject +- (instancetype)init __attribute__((unavailable)); ++ (instancetype)new __attribute__((unavailable)); ++ (void)initialize __attribute__((objc_requires_super)); +@end + +@interface YChatBase (YChatBaseCopying) +@end + +__attribute__((swift_name("KotlinMutableSet"))) +@interface YChatMutableSet : NSMutableSet +@end + +__attribute__((swift_name("KotlinMutableDictionary"))) +@interface YChatMutableDictionary : NSMutableDictionary +@end + +@interface NSError (NSErrorYChatKotlinException) +@property (readonly) id _Nullable kotlinException; +@end + +__attribute__((swift_name("KotlinNumber"))) +@interface YChatNumber : NSNumber +- (instancetype)initWithChar:(char)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedChar:(unsigned char)value __attribute__((unavailable)); +- (instancetype)initWithShort:(short)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedShort:(unsigned short)value __attribute__((unavailable)); +- (instancetype)initWithInt:(int)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedInt:(unsigned int)value __attribute__((unavailable)); +- (instancetype)initWithLong:(long)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedLong:(unsigned long)value __attribute__((unavailable)); +- (instancetype)initWithLongLong:(long long)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedLongLong:(unsigned long long)value __attribute__((unavailable)); +- (instancetype)initWithFloat:(float)value __attribute__((unavailable)); +- (instancetype)initWithDouble:(double)value __attribute__((unavailable)); +- (instancetype)initWithBool:(BOOL)value __attribute__((unavailable)); +- (instancetype)initWithInteger:(NSInteger)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedInteger:(NSUInteger)value __attribute__((unavailable)); ++ (instancetype)numberWithChar:(char)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedChar:(unsigned char)value __attribute__((unavailable)); ++ (instancetype)numberWithShort:(short)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedShort:(unsigned short)value __attribute__((unavailable)); ++ (instancetype)numberWithInt:(int)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedInt:(unsigned int)value __attribute__((unavailable)); ++ (instancetype)numberWithLong:(long)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedLong:(unsigned long)value __attribute__((unavailable)); ++ (instancetype)numberWithLongLong:(long long)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedLongLong:(unsigned long long)value __attribute__((unavailable)); ++ (instancetype)numberWithFloat:(float)value __attribute__((unavailable)); ++ (instancetype)numberWithDouble:(double)value __attribute__((unavailable)); ++ (instancetype)numberWithBool:(BOOL)value __attribute__((unavailable)); ++ (instancetype)numberWithInteger:(NSInteger)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedInteger:(NSUInteger)value __attribute__((unavailable)); +@end + +__attribute__((swift_name("KotlinByte"))) +@interface YChatByte : YChatNumber +- (instancetype)initWithChar:(char)value; ++ (instancetype)numberWithChar:(char)value; +@end + +__attribute__((swift_name("KotlinUByte"))) +@interface YChatUByte : YChatNumber +- (instancetype)initWithUnsignedChar:(unsigned char)value; ++ (instancetype)numberWithUnsignedChar:(unsigned char)value; +@end + +__attribute__((swift_name("KotlinShort"))) +@interface YChatShort : YChatNumber +- (instancetype)initWithShort:(short)value; ++ (instancetype)numberWithShort:(short)value; +@end + +__attribute__((swift_name("KotlinUShort"))) +@interface YChatUShort : YChatNumber +- (instancetype)initWithUnsignedShort:(unsigned short)value; ++ (instancetype)numberWithUnsignedShort:(unsigned short)value; +@end + +__attribute__((swift_name("KotlinInt"))) +@interface YChatInt : YChatNumber +- (instancetype)initWithInt:(int)value; ++ (instancetype)numberWithInt:(int)value; +@end + +__attribute__((swift_name("KotlinUInt"))) +@interface YChatUInt : YChatNumber +- (instancetype)initWithUnsignedInt:(unsigned int)value; ++ (instancetype)numberWithUnsignedInt:(unsigned int)value; +@end + +__attribute__((swift_name("KotlinLong"))) +@interface YChatLong : YChatNumber +- (instancetype)initWithLongLong:(long long)value; ++ (instancetype)numberWithLongLong:(long long)value; +@end + +__attribute__((swift_name("KotlinULong"))) +@interface YChatULong : YChatNumber +- (instancetype)initWithUnsignedLongLong:(unsigned long long)value; ++ (instancetype)numberWithUnsignedLongLong:(unsigned long long)value; +@end + +__attribute__((swift_name("KotlinFloat"))) +@interface YChatFloat : YChatNumber +- (instancetype)initWithFloat:(float)value; ++ (instancetype)numberWithFloat:(float)value; +@end + +__attribute__((swift_name("KotlinDouble"))) +@interface YChatDouble : YChatNumber +- (instancetype)initWithDouble:(double)value; ++ (instancetype)numberWithDouble:(double)value; +@end + +__attribute__((swift_name("KotlinBoolean"))) +@interface YChatBoolean : YChatNumber +- (instancetype)initWithBool:(BOOL)value; ++ (instancetype)numberWithBool:(BOOL)value; +@end + +__attribute__((swift_name("YChat"))) +@protocol YChatYChat +@required +- (id)audioTranscriptions __attribute__((swift_name("audioTranscriptions()"))); +- (id)audioTranslations __attribute__((swift_name("audioTranslations()"))); +- (id)chatCompletions __attribute__((swift_name("chatCompletions()"))); +- (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"))) +@protocol YChatYChatCallback +@required +- (void)onErrorThrowable:(YChatKotlinThrowable *)throwable __attribute__((swift_name("onError(throwable:)"))); +- (void)onSuccessResult:(id _Nullable)result __attribute__((swift_name("onSuccess(result:)"))); +@end + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("YChatCompanion"))) +@interface YChatYChatCompanion : YChatBase ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); ++ (instancetype)companion __attribute__((swift_name("init()"))); +@property (class, readonly, getter=shared) YChatYChatCompanion *shared __attribute__((swift_name("shared"))); + +/** + * @note annotations + * kotlin.jvm.JvmStatic +*/ +- (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 +- (instancetype)initWithRole:(NSString *)role content:(NSString *)content __attribute__((swift_name("init(role:content:)"))) __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"))); +- (YChatChatMessage *)doCopyRole:(NSString *)role content:(NSString *)content __attribute__((swift_name("doCopy(role:content:)"))); +- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)"))); +- (NSUInteger)hash __attribute__((swift_name("hash()"))); +- (NSString *)description __attribute__((swift_name("description()"))); +@property (readonly) NSString *content __attribute__((swift_name("content"))); +@property (readonly) NSString *role __attribute__((swift_name("role"))); +@end + +__attribute__((swift_name("AudioTranscriptions"))) +@protocol YChatAudioTranscriptions +@required + +/** + * @note This method converts instances of CancellationException, YChatException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executeFilename:(NSString *)filename audioFile:(NSData *)audioFile completionHandler:(void (^)(NSString * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(filename:audioFile:completionHandler:)"))); +- (void)executeFilename:(NSString *)filename audioFile:(NSData *)audioFile callback:(id)callback __attribute__((swift_name("execute(filename:audioFile:callback:)"))); +- (id)setLanguageLanguage:(NSString *)language __attribute__((swift_name("setLanguage(language:)"))); +- (id)setModelModel:(NSString *)model __attribute__((swift_name("setModel(model:)"))); +- (id)setPromptPrompt:(NSString *)prompt __attribute__((swift_name("setPrompt(prompt:)"))); +- (id)setResponseFormatFormat:(NSString *)format __attribute__((swift_name("setResponseFormat(format:)"))); +- (id)setTemperatureTemperature:(double)temperature __attribute__((swift_name("setTemperature(temperature:)"))); +@end + +__attribute__((swift_name("AudioTranslations"))) +@protocol YChatAudioTranslations +@required + +/** + * @note This method converts instances of CancellationException, YChatException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executeFilename:(NSString *)filename audioFile:(NSData *)audioFile completionHandler:(void (^)(NSString * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(filename:audioFile:completionHandler:)"))); +- (void)executeFilename:(NSString *)filename audioFile:(NSData *)audioFile callback:(id)callback __attribute__((swift_name("execute(filename:audioFile:callback:)"))); +- (id)setModelModel:(NSString *)model __attribute__((swift_name("setModel(model:)"))); +- (id)setPromptPrompt:(NSString *)prompt __attribute__((swift_name("setPrompt(prompt:)"))); +- (id)setResponseFormatFormat:(NSString *)format __attribute__((swift_name("setResponseFormat(format:)"))); +- (id)setTemperatureTemperature:(double)temperature __attribute__((swift_name("setTemperature(temperature:)"))); +@end + +__attribute__((swift_name("ChatCompletions"))) +@protocol YChatChatCompletions +@required +- (id)addMessageRole:(NSString *)role content:(NSString *)content __attribute__((swift_name("addMessage(role:content:)"))); + +/** + * @note This method converts instances of CancellationException, YChatException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executeContent:(NSString *)content completionHandler:(void (^)(NSArray * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(content:completionHandler:)"))); +- (void)executeContent:(NSString *)content callback:(id)callback __attribute__((swift_name("execute(content:callback:)"))); +- (id)setMaxResultsResults:(int32_t)results __attribute__((swift_name("setMaxResults(results:)"))); +- (id)setMaxTokensTokens:(int32_t)tokens __attribute__((swift_name("setMaxTokens(tokens:)"))); +- (id)setModelModel:(NSString *)model __attribute__((swift_name("setModel(model:)"))); +- (id)setTemperatureTemperature:(double)temperature __attribute__((swift_name("setTemperature(temperature:)"))); +- (id)setTopPTopP:(double)topP __attribute__((swift_name("setTopP(topP:)"))); +@end + +__attribute__((swift_name("Completion"))) +@protocol YChatCompletion +@required + +/** + * @note This method converts instances of CancellationException, YChatException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executeWithCompletionHandler:(void (^)(NSString * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(completionHandler:)"))); +- (void)executeCallback:(id)callback __attribute__((swift_name("execute(callback:)"))); +- (id)saveHistoryIsSaveHistory:(BOOL)isSaveHistory __attribute__((swift_name("saveHistory(isSaveHistory:)"))); +- (id)setInputInput:(NSString *)input __attribute__((swift_name("setInput(input:)"))); +- (id)setMaxTokensTokens:(int32_t)tokens __attribute__((swift_name("setMaxTokens(tokens:)"))); +- (id)setModelModel:(NSString *)model __attribute__((swift_name("setModel(model:)"))); +- (id)setTemperatureTemperature:(double)temperature __attribute__((swift_name("setTemperature(temperature:)"))); +- (id)setTopPTopP:(double)topP __attribute__((swift_name("setTopP(topP:)"))); +@end + +__attribute__((swift_name("Edits"))) +@protocol YChatEdits +@required + +/** + * @note This method converts instances of CancellationException, YChatException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executeInstruction:(NSString *)instruction completionHandler:(void (^)(NSArray * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(instruction:completionHandler:)"))); +- (void)executeInstruction:(NSString *)instruction callback:(id)callback __attribute__((swift_name("execute(instruction:callback:)"))); +- (id)setInputInput:(NSString *)input __attribute__((swift_name("setInput(input:)"))); +- (id)setModelModel:(NSString *)model __attribute__((swift_name("setModel(model:)"))); +- (id)setResultsResults:(int32_t)results __attribute__((swift_name("setResults(results:)"))); +- (id)setTemperatureTemperature:(double)temperature __attribute__((swift_name("setTemperature(temperature:)"))); +- (id)setTopPTopP:(double)topP __attribute__((swift_name("setTopP(topP:)"))); +@end + +__attribute__((swift_name("ImageGenerations"))) +@protocol YChatImageGenerations +@required + +/** + * @note This method converts instances of CancellationException, YChatException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executePrompt:(NSString *)prompt completionHandler:(void (^)(NSArray * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(prompt:completionHandler:)"))); +- (void)executePrompt:(NSString *)prompt callback:(id)callback __attribute__((swift_name("execute(prompt:callback:)"))); +- (id)setResponseFormatResponseFormat:(NSString *)responseFormat __attribute__((swift_name("setResponseFormat(responseFormat:)"))); +- (id)setResultsResults:(int32_t)results __attribute__((swift_name("setResults(results:)"))); +- (id)setSizeSize:(NSString *)size __attribute__((swift_name("setSize(size:)"))); +@end + +__attribute__((swift_name("ListModels"))) +@protocol YChatListModels +@required + +/** + * @note This method converts instances of CancellationException, YChatException 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, YChatException 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__((swift_name("KotlinThrowable"))) +@interface YChatKotlinThrowable : YChatBase +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); +- (YChatKotlinArray *)getStackTrace __attribute__((swift_name("getStackTrace()"))); +- (void)printStackTrace __attribute__((swift_name("printStackTrace()"))); +- (NSString *)description __attribute__((swift_name("description()"))); +@property (readonly) YChatKotlinThrowable * _Nullable cause __attribute__((swift_name("cause"))); +@property (readonly) NSString * _Nullable message __attribute__((swift_name("message"))); +- (NSError *)asError __attribute__((swift_name("asError()"))); +@end + +__attribute__((swift_name("KotlinException"))) +@interface YChatKotlinException : YChatKotlinThrowable +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); +@end + +__attribute__((swift_name("KotlinRuntimeException"))) +@interface YChatKotlinRuntimeException : YChatKotlinException +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); +@end + +__attribute__((swift_name("KotlinIllegalStateException"))) +@interface YChatKotlinIllegalStateException : YChatKotlinRuntimeException +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); +@end + + +/** + * @note annotations + * kotlin.SinceKotlin(version="1.4") +*/ +__attribute__((swift_name("KotlinCancellationException"))) +@interface YChatKotlinCancellationException : YChatKotlinIllegalStateException +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); +@end + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("Ychat_coreYChatException"))) +@interface YChatYchat_coreYChatException : YChatKotlinException +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause statusCode:(YChatInt * _Nullable)statusCode __attribute__((swift_name("init(cause:statusCode:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause statusCode:(YChatInt * _Nullable)statusCode __attribute__((swift_name("init(message:cause:statusCode:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); ++ (instancetype)new __attribute__((unavailable)); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +@property YChatInt * _Nullable statusCode __attribute__((swift_name("statusCode"))); +@end + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("KotlinArray"))) +@interface YChatKotlinArray : YChatBase ++ (instancetype)arrayWithSize:(int32_t)size init:(T _Nullable (^)(YChatInt *))init __attribute__((swift_name("init(size:init:)"))); ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); +- (T _Nullable)getIndex:(int32_t)index __attribute__((swift_name("get(index:)"))); +- (id)iterator __attribute__((swift_name("iterator()"))); +- (void)setIndex:(int32_t)index value:(T _Nullable)value __attribute__((swift_name("set(index:value:)"))); +@property (readonly) int32_t size __attribute__((swift_name("size"))); +@end + +__attribute__((swift_name("KotlinIterator"))) +@protocol YChatKotlinIterator +@required +- (BOOL)hasNext __attribute__((swift_name("hasNext()"))); +- (id _Nullable)next __attribute__((swift_name("next()"))); +@end + +#pragma pop_macro("_Nullable_result") +#pragma clang diagnostic pop +NS_ASSUME_NONNULL_END diff --git a/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/A/Modules/module.modulemap b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/A/Modules/module.modulemap new file mode 100644 index 0000000..0a69a26 --- /dev/null +++ b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/A/Modules/module.modulemap @@ -0,0 +1,8 @@ +framework module YChat { + umbrella header "YChat.h" + + export * + module * { export * } + + use Foundation +} \ No newline at end of file diff --git a/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/A/Resources/Info.plist b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..9268179 --- /dev/null +++ b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleExecutable + YChat + CFBundleIdentifier + co.yml.ychat.YChat + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + YChat + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 1 + + \ No newline at end of file diff --git a/YChat-1.3.0.zip b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/A/YChat old mode 100644 new mode 100755 similarity index 53% rename from YChat-1.3.0.zip rename to YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/A/YChat index 1f75b96..a53a785 Binary files a/YChat-1.3.0.zip and b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/A/YChat differ diff --git a/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/Current/Headers/YChat.h b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/Current/Headers/YChat.h new file mode 100644 index 0000000..5902529 --- /dev/null +++ b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/Current/Headers/YChat.h @@ -0,0 +1,455 @@ +#import +#import +#import +#import +#import +#import +#import + +@class YChatKotlinThrowable, YChatYChatCompanion, YChatAIModelPermission, YChatAIModel, YChatChatMessage, NSData, YChatKotlinArray, YChatKotlinException, YChatKotlinRuntimeException, YChatKotlinIllegalStateException; + +@protocol YChatAudioTranscriptions, YChatAudioTranslations, YChatChatCompletions, YChatCompletion, YChatEdits, YChatImageGenerations, YChatListModels, YChatRetrieveModel, YChatYChat, YChatYChatCallback, YChatKotlinIterator; + +NS_ASSUME_NONNULL_BEGIN +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunknown-warning-option" +#pragma clang diagnostic ignored "-Wincompatible-property-type" +#pragma clang diagnostic ignored "-Wnullability" + +#pragma push_macro("_Nullable_result") +#if !__has_feature(nullability_nullable_result) +#undef _Nullable_result +#define _Nullable_result _Nullable +#endif + +__attribute__((swift_name("KotlinBase"))) +@interface YChatBase : NSObject +- (instancetype)init __attribute__((unavailable)); ++ (instancetype)new __attribute__((unavailable)); ++ (void)initialize __attribute__((objc_requires_super)); +@end + +@interface YChatBase (YChatBaseCopying) +@end + +__attribute__((swift_name("KotlinMutableSet"))) +@interface YChatMutableSet : NSMutableSet +@end + +__attribute__((swift_name("KotlinMutableDictionary"))) +@interface YChatMutableDictionary : NSMutableDictionary +@end + +@interface NSError (NSErrorYChatKotlinException) +@property (readonly) id _Nullable kotlinException; +@end + +__attribute__((swift_name("KotlinNumber"))) +@interface YChatNumber : NSNumber +- (instancetype)initWithChar:(char)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedChar:(unsigned char)value __attribute__((unavailable)); +- (instancetype)initWithShort:(short)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedShort:(unsigned short)value __attribute__((unavailable)); +- (instancetype)initWithInt:(int)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedInt:(unsigned int)value __attribute__((unavailable)); +- (instancetype)initWithLong:(long)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedLong:(unsigned long)value __attribute__((unavailable)); +- (instancetype)initWithLongLong:(long long)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedLongLong:(unsigned long long)value __attribute__((unavailable)); +- (instancetype)initWithFloat:(float)value __attribute__((unavailable)); +- (instancetype)initWithDouble:(double)value __attribute__((unavailable)); +- (instancetype)initWithBool:(BOOL)value __attribute__((unavailable)); +- (instancetype)initWithInteger:(NSInteger)value __attribute__((unavailable)); +- (instancetype)initWithUnsignedInteger:(NSUInteger)value __attribute__((unavailable)); ++ (instancetype)numberWithChar:(char)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedChar:(unsigned char)value __attribute__((unavailable)); ++ (instancetype)numberWithShort:(short)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedShort:(unsigned short)value __attribute__((unavailable)); ++ (instancetype)numberWithInt:(int)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedInt:(unsigned int)value __attribute__((unavailable)); ++ (instancetype)numberWithLong:(long)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedLong:(unsigned long)value __attribute__((unavailable)); ++ (instancetype)numberWithLongLong:(long long)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedLongLong:(unsigned long long)value __attribute__((unavailable)); ++ (instancetype)numberWithFloat:(float)value __attribute__((unavailable)); ++ (instancetype)numberWithDouble:(double)value __attribute__((unavailable)); ++ (instancetype)numberWithBool:(BOOL)value __attribute__((unavailable)); ++ (instancetype)numberWithInteger:(NSInteger)value __attribute__((unavailable)); ++ (instancetype)numberWithUnsignedInteger:(NSUInteger)value __attribute__((unavailable)); +@end + +__attribute__((swift_name("KotlinByte"))) +@interface YChatByte : YChatNumber +- (instancetype)initWithChar:(char)value; ++ (instancetype)numberWithChar:(char)value; +@end + +__attribute__((swift_name("KotlinUByte"))) +@interface YChatUByte : YChatNumber +- (instancetype)initWithUnsignedChar:(unsigned char)value; ++ (instancetype)numberWithUnsignedChar:(unsigned char)value; +@end + +__attribute__((swift_name("KotlinShort"))) +@interface YChatShort : YChatNumber +- (instancetype)initWithShort:(short)value; ++ (instancetype)numberWithShort:(short)value; +@end + +__attribute__((swift_name("KotlinUShort"))) +@interface YChatUShort : YChatNumber +- (instancetype)initWithUnsignedShort:(unsigned short)value; ++ (instancetype)numberWithUnsignedShort:(unsigned short)value; +@end + +__attribute__((swift_name("KotlinInt"))) +@interface YChatInt : YChatNumber +- (instancetype)initWithInt:(int)value; ++ (instancetype)numberWithInt:(int)value; +@end + +__attribute__((swift_name("KotlinUInt"))) +@interface YChatUInt : YChatNumber +- (instancetype)initWithUnsignedInt:(unsigned int)value; ++ (instancetype)numberWithUnsignedInt:(unsigned int)value; +@end + +__attribute__((swift_name("KotlinLong"))) +@interface YChatLong : YChatNumber +- (instancetype)initWithLongLong:(long long)value; ++ (instancetype)numberWithLongLong:(long long)value; +@end + +__attribute__((swift_name("KotlinULong"))) +@interface YChatULong : YChatNumber +- (instancetype)initWithUnsignedLongLong:(unsigned long long)value; ++ (instancetype)numberWithUnsignedLongLong:(unsigned long long)value; +@end + +__attribute__((swift_name("KotlinFloat"))) +@interface YChatFloat : YChatNumber +- (instancetype)initWithFloat:(float)value; ++ (instancetype)numberWithFloat:(float)value; +@end + +__attribute__((swift_name("KotlinDouble"))) +@interface YChatDouble : YChatNumber +- (instancetype)initWithDouble:(double)value; ++ (instancetype)numberWithDouble:(double)value; +@end + +__attribute__((swift_name("KotlinBoolean"))) +@interface YChatBoolean : YChatNumber +- (instancetype)initWithBool:(BOOL)value; ++ (instancetype)numberWithBool:(BOOL)value; +@end + +__attribute__((swift_name("YChat"))) +@protocol YChatYChat +@required +- (id)audioTranscriptions __attribute__((swift_name("audioTranscriptions()"))); +- (id)audioTranslations __attribute__((swift_name("audioTranslations()"))); +- (id)chatCompletions __attribute__((swift_name("chatCompletions()"))); +- (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"))) +@protocol YChatYChatCallback +@required +- (void)onErrorThrowable:(YChatKotlinThrowable *)throwable __attribute__((swift_name("onError(throwable:)"))); +- (void)onSuccessResult:(id _Nullable)result __attribute__((swift_name("onSuccess(result:)"))); +@end + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("YChatCompanion"))) +@interface YChatYChatCompanion : YChatBase ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); ++ (instancetype)companion __attribute__((swift_name("init()"))); +@property (class, readonly, getter=shared) YChatYChatCompanion *shared __attribute__((swift_name("shared"))); + +/** + * @note annotations + * kotlin.jvm.JvmStatic +*/ +- (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 +- (instancetype)initWithRole:(NSString *)role content:(NSString *)content __attribute__((swift_name("init(role:content:)"))) __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"))); +- (YChatChatMessage *)doCopyRole:(NSString *)role content:(NSString *)content __attribute__((swift_name("doCopy(role:content:)"))); +- (BOOL)isEqual:(id _Nullable)other __attribute__((swift_name("isEqual(_:)"))); +- (NSUInteger)hash __attribute__((swift_name("hash()"))); +- (NSString *)description __attribute__((swift_name("description()"))); +@property (readonly) NSString *content __attribute__((swift_name("content"))); +@property (readonly) NSString *role __attribute__((swift_name("role"))); +@end + +__attribute__((swift_name("AudioTranscriptions"))) +@protocol YChatAudioTranscriptions +@required + +/** + * @note This method converts instances of CancellationException, YChatException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executeFilename:(NSString *)filename audioFile:(NSData *)audioFile completionHandler:(void (^)(NSString * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(filename:audioFile:completionHandler:)"))); +- (void)executeFilename:(NSString *)filename audioFile:(NSData *)audioFile callback:(id)callback __attribute__((swift_name("execute(filename:audioFile:callback:)"))); +- (id)setLanguageLanguage:(NSString *)language __attribute__((swift_name("setLanguage(language:)"))); +- (id)setModelModel:(NSString *)model __attribute__((swift_name("setModel(model:)"))); +- (id)setPromptPrompt:(NSString *)prompt __attribute__((swift_name("setPrompt(prompt:)"))); +- (id)setResponseFormatFormat:(NSString *)format __attribute__((swift_name("setResponseFormat(format:)"))); +- (id)setTemperatureTemperature:(double)temperature __attribute__((swift_name("setTemperature(temperature:)"))); +@end + +__attribute__((swift_name("AudioTranslations"))) +@protocol YChatAudioTranslations +@required + +/** + * @note This method converts instances of CancellationException, YChatException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executeFilename:(NSString *)filename audioFile:(NSData *)audioFile completionHandler:(void (^)(NSString * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(filename:audioFile:completionHandler:)"))); +- (void)executeFilename:(NSString *)filename audioFile:(NSData *)audioFile callback:(id)callback __attribute__((swift_name("execute(filename:audioFile:callback:)"))); +- (id)setModelModel:(NSString *)model __attribute__((swift_name("setModel(model:)"))); +- (id)setPromptPrompt:(NSString *)prompt __attribute__((swift_name("setPrompt(prompt:)"))); +- (id)setResponseFormatFormat:(NSString *)format __attribute__((swift_name("setResponseFormat(format:)"))); +- (id)setTemperatureTemperature:(double)temperature __attribute__((swift_name("setTemperature(temperature:)"))); +@end + +__attribute__((swift_name("ChatCompletions"))) +@protocol YChatChatCompletions +@required +- (id)addMessageRole:(NSString *)role content:(NSString *)content __attribute__((swift_name("addMessage(role:content:)"))); + +/** + * @note This method converts instances of CancellationException, YChatException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executeContent:(NSString *)content completionHandler:(void (^)(NSArray * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(content:completionHandler:)"))); +- (void)executeContent:(NSString *)content callback:(id)callback __attribute__((swift_name("execute(content:callback:)"))); +- (id)setMaxResultsResults:(int32_t)results __attribute__((swift_name("setMaxResults(results:)"))); +- (id)setMaxTokensTokens:(int32_t)tokens __attribute__((swift_name("setMaxTokens(tokens:)"))); +- (id)setModelModel:(NSString *)model __attribute__((swift_name("setModel(model:)"))); +- (id)setTemperatureTemperature:(double)temperature __attribute__((swift_name("setTemperature(temperature:)"))); +- (id)setTopPTopP:(double)topP __attribute__((swift_name("setTopP(topP:)"))); +@end + +__attribute__((swift_name("Completion"))) +@protocol YChatCompletion +@required + +/** + * @note This method converts instances of CancellationException, YChatException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executeWithCompletionHandler:(void (^)(NSString * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(completionHandler:)"))); +- (void)executeCallback:(id)callback __attribute__((swift_name("execute(callback:)"))); +- (id)saveHistoryIsSaveHistory:(BOOL)isSaveHistory __attribute__((swift_name("saveHistory(isSaveHistory:)"))); +- (id)setInputInput:(NSString *)input __attribute__((swift_name("setInput(input:)"))); +- (id)setMaxTokensTokens:(int32_t)tokens __attribute__((swift_name("setMaxTokens(tokens:)"))); +- (id)setModelModel:(NSString *)model __attribute__((swift_name("setModel(model:)"))); +- (id)setTemperatureTemperature:(double)temperature __attribute__((swift_name("setTemperature(temperature:)"))); +- (id)setTopPTopP:(double)topP __attribute__((swift_name("setTopP(topP:)"))); +@end + +__attribute__((swift_name("Edits"))) +@protocol YChatEdits +@required + +/** + * @note This method converts instances of CancellationException, YChatException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executeInstruction:(NSString *)instruction completionHandler:(void (^)(NSArray * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(instruction:completionHandler:)"))); +- (void)executeInstruction:(NSString *)instruction callback:(id)callback __attribute__((swift_name("execute(instruction:callback:)"))); +- (id)setInputInput:(NSString *)input __attribute__((swift_name("setInput(input:)"))); +- (id)setModelModel:(NSString *)model __attribute__((swift_name("setModel(model:)"))); +- (id)setResultsResults:(int32_t)results __attribute__((swift_name("setResults(results:)"))); +- (id)setTemperatureTemperature:(double)temperature __attribute__((swift_name("setTemperature(temperature:)"))); +- (id)setTopPTopP:(double)topP __attribute__((swift_name("setTopP(topP:)"))); +@end + +__attribute__((swift_name("ImageGenerations"))) +@protocol YChatImageGenerations +@required + +/** + * @note This method converts instances of CancellationException, YChatException to errors. + * Other uncaught Kotlin exceptions are fatal. +*/ +- (void)executePrompt:(NSString *)prompt completionHandler:(void (^)(NSArray * _Nullable, NSError * _Nullable))completionHandler __attribute__((swift_name("execute(prompt:completionHandler:)"))); +- (void)executePrompt:(NSString *)prompt callback:(id)callback __attribute__((swift_name("execute(prompt:callback:)"))); +- (id)setResponseFormatResponseFormat:(NSString *)responseFormat __attribute__((swift_name("setResponseFormat(responseFormat:)"))); +- (id)setResultsResults:(int32_t)results __attribute__((swift_name("setResults(results:)"))); +- (id)setSizeSize:(NSString *)size __attribute__((swift_name("setSize(size:)"))); +@end + +__attribute__((swift_name("ListModels"))) +@protocol YChatListModels +@required + +/** + * @note This method converts instances of CancellationException, YChatException 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, YChatException 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__((swift_name("KotlinThrowable"))) +@interface YChatKotlinThrowable : YChatBase +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); +- (YChatKotlinArray *)getStackTrace __attribute__((swift_name("getStackTrace()"))); +- (void)printStackTrace __attribute__((swift_name("printStackTrace()"))); +- (NSString *)description __attribute__((swift_name("description()"))); +@property (readonly) YChatKotlinThrowable * _Nullable cause __attribute__((swift_name("cause"))); +@property (readonly) NSString * _Nullable message __attribute__((swift_name("message"))); +- (NSError *)asError __attribute__((swift_name("asError()"))); +@end + +__attribute__((swift_name("KotlinException"))) +@interface YChatKotlinException : YChatKotlinThrowable +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); +@end + +__attribute__((swift_name("KotlinRuntimeException"))) +@interface YChatKotlinRuntimeException : YChatKotlinException +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); +@end + +__attribute__((swift_name("KotlinIllegalStateException"))) +@interface YChatKotlinIllegalStateException : YChatKotlinRuntimeException +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); +@end + + +/** + * @note annotations + * kotlin.SinceKotlin(version="1.4") +*/ +__attribute__((swift_name("KotlinCancellationException"))) +@interface YChatKotlinCancellationException : YChatKotlinIllegalStateException +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)); ++ (instancetype)new __attribute__((availability(swift, unavailable, message="use object initializers instead"))); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)); +@end + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("Ychat_coreYChatException"))) +@interface YChatYchat_coreYChatException : YChatKotlinException +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause statusCode:(YChatInt * _Nullable)statusCode __attribute__((swift_name("init(cause:statusCode:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause statusCode:(YChatInt * _Nullable)statusCode __attribute__((swift_name("init(message:cause:statusCode:)"))) __attribute__((objc_designated_initializer)); +- (instancetype)init __attribute__((swift_name("init()"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); ++ (instancetype)new __attribute__((unavailable)); +- (instancetype)initWithMessage:(NSString * _Nullable)message __attribute__((swift_name("init(message:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithMessage:(NSString * _Nullable)message cause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(message:cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +- (instancetype)initWithCause:(YChatKotlinThrowable * _Nullable)cause __attribute__((swift_name("init(cause:)"))) __attribute__((objc_designated_initializer)) __attribute__((unavailable)); +@property YChatInt * _Nullable statusCode __attribute__((swift_name("statusCode"))); +@end + +__attribute__((objc_subclassing_restricted)) +__attribute__((swift_name("KotlinArray"))) +@interface YChatKotlinArray : YChatBase ++ (instancetype)arrayWithSize:(int32_t)size init:(T _Nullable (^)(YChatInt *))init __attribute__((swift_name("init(size:init:)"))); ++ (instancetype)alloc __attribute__((unavailable)); ++ (instancetype)allocWithZone:(struct _NSZone *)zone __attribute__((unavailable)); +- (T _Nullable)getIndex:(int32_t)index __attribute__((swift_name("get(index:)"))); +- (id)iterator __attribute__((swift_name("iterator()"))); +- (void)setIndex:(int32_t)index value:(T _Nullable)value __attribute__((swift_name("set(index:value:)"))); +@property (readonly) int32_t size __attribute__((swift_name("size"))); +@end + +__attribute__((swift_name("KotlinIterator"))) +@protocol YChatKotlinIterator +@required +- (BOOL)hasNext __attribute__((swift_name("hasNext()"))); +- (id _Nullable)next __attribute__((swift_name("next()"))); +@end + +#pragma pop_macro("_Nullable_result") +#pragma clang diagnostic pop +NS_ASSUME_NONNULL_END diff --git a/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/Current/Modules/module.modulemap b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/Current/Modules/module.modulemap new file mode 100644 index 0000000..0a69a26 --- /dev/null +++ b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/Current/Modules/module.modulemap @@ -0,0 +1,8 @@ +framework module YChat { + umbrella header "YChat.h" + + export * + module * { export * } + + use Foundation +} \ No newline at end of file diff --git a/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/Current/Resources/Info.plist b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/Current/Resources/Info.plist new file mode 100644 index 0000000..9268179 --- /dev/null +++ b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/Current/Resources/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleExecutable + YChat + CFBundleIdentifier + co.yml.ychat.YChat + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + YChat + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 1 + + \ No newline at end of file diff --git a/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/Current/YChat b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/Current/YChat new file mode 100755 index 0000000..011c33a Binary files /dev/null and b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/Versions/Current/YChat differ diff --git a/YChat.xcframework/macos-arm64_x86_64/YChat.framework/YChat b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/YChat new file mode 120000 index 0000000..27b7c0e --- /dev/null +++ b/YChat.xcframework/macos-arm64_x86_64/YChat.framework/YChat @@ -0,0 +1 @@ +/Users/osugikoji/Workspace/ychat-sdk/ychat/build/bin/macosUniversal/releaseFramework/YChat.framework/Versions/A/YChat \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index ee122ba..78416c1 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -1,6 +1,6 @@ object Versions { const val GRADLE_PLUGIN = "7.3.0" - const val SPM_PLUGIN = "2.0.3" + const val SPM_PLUGIN = "2.0.5-arm64" const val DETEKT_PLUGIN = "1.22.0" const val KTLINT_PLUGIN = "11.0.0" const val KOVER_PLUGIN = "0.6.1" @@ -34,6 +34,7 @@ object Dependencies { const val KTOR_LOGGING = "io.ktor:ktor-client-logging:${Versions.KTOR}" const val KTOR_ANDROID = "io.ktor:ktor-client-android:${Versions.KTOR}" const val KTOR_IOS = "io.ktor:ktor-client-ios:${Versions.KTOR}" + const val KTOR_DARWIN = "io.ktor:ktor-client-darwin:${Versions.KTOR}" const val KTOR_OKHTTP = "io.ktor:ktor-client-okhttp:${Versions.KTOR}" } diff --git a/gradle.properties b/gradle.properties index d306bf0..34228a0 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.3.0 +VERSION_NAME=1.4.0 IOS_NAME=YChat # OSS diff --git a/ychat-core/build.gradle.kts b/ychat-core/build.gradle.kts index 8aeed13..6477f0b 100644 --- a/ychat-core/build.gradle.kts +++ b/ychat-core/build.gradle.kts @@ -22,6 +22,8 @@ kotlin { android() jvm() listOf( + macosArm64(), + macosX64(), iosX64(), iosArm64(), iosSimulatorArm64() @@ -66,6 +68,16 @@ kotlin { implementation(Dependencies.Network.KTOR_IOS) } } + val macosArm64Main by getting + val macosX64Main by getting + val macosMain by creating { + dependsOn(commonMain) + macosArm64Main.dependsOn(this) + macosX64Main.dependsOn(this) + dependencies { + implementation(Dependencies.Network.KTOR_DARWIN) + } + } val iosTest by creating { dependsOn(commonTest) } diff --git a/ychat-core/src/macosMain/kotlin/co/yml/ychat/core/model/toByteArray.kt b/ychat-core/src/macosMain/kotlin/co/yml/ychat/core/model/toByteArray.kt new file mode 100644 index 0000000..3044c9a --- /dev/null +++ b/ychat-core/src/macosMain/kotlin/co/yml/ychat/core/model/toByteArray.kt @@ -0,0 +1,16 @@ +package co.yml.ychat.core.model + +import kotlinx.cinterop.addressOf +import kotlinx.cinterop.usePinned +import platform.Foundation.NSData +import platform.posix.memcpy + +public actual typealias FileBytes = NSData + +public actual fun FileBytes.toByteArray(): ByteArray { + return ByteArray(this.length.toInt()).apply { + usePinned { + memcpy(it.addressOf(0), this@toByteArray.bytes, this@toByteArray.length) + } + } +} diff --git a/ychat-core/src/macosMain/kotlin/co/yml/ychat/core/network/factories/HttpEngineFactory.kt b/ychat-core/src/macosMain/kotlin/co/yml/ychat/core/network/factories/HttpEngineFactory.kt new file mode 100644 index 0000000..d48cb96 --- /dev/null +++ b/ychat-core/src/macosMain/kotlin/co/yml/ychat/core/network/factories/HttpEngineFactory.kt @@ -0,0 +1,11 @@ +package co.yml.ychat.core.network.factories + +import io.ktor.client.engine.HttpClientEngine +import io.ktor.client.engine.darwin.Darwin + +public actual object HttpEngineFactory { + + public actual fun getEngine(): HttpClientEngine { + return Darwin.create() + } +} diff --git a/ychat/build.gradle.kts b/ychat/build.gradle.kts index 1a1f8ff..4bf4be1 100644 --- a/ychat/build.gradle.kts +++ b/ychat/build.gradle.kts @@ -1,7 +1,7 @@ plugins { kotlin("multiplatform") kotlin("plugin.serialization").version(Versions.KOTLIN) - id("com.chromaticnoise.multiplatform-swiftpackage").version(Versions.SPM_PLUGIN) + id("io.github.luca992.multiplatform-swiftpackage").version(Versions.SPM_PLUGIN) id("com.vanniktech.maven.publish") id("com.android.library") id("io.gitlab.arturbosch.detekt") @@ -31,6 +31,7 @@ multiplatformSwiftPackage { outputDirectory(File(rootDir, "/")) targetPlatforms { iOS { v("13") } + macOS { v("11") } } } @@ -38,6 +39,8 @@ kotlin { android() jvm() listOf( + macosArm64(), + macosX64(), iosX64(), iosArm64(), iosSimulatorArm64() @@ -85,6 +88,13 @@ kotlin { iosArm64Test.dependsOn(this) iosSimulatorArm64Test.dependsOn(this) } + val macosArm64Main by getting + val macosX64Main by getting + val macosMain by creating { + dependsOn(commonMain) + macosArm64Main.dependsOn(this) + macosX64Main.dependsOn(this) + } val jvmMain by getting val jvmTest by getting { dependencies {