// // AiVM.h // keyBoard // // Created by Mac on 2026/1/22. // #import NS_ASSUME_NONNULL_BEGIN @interface KBAiSyncData : NSObject @property(nonatomic, copy, nullable) NSString *aiResponse; @property(nonatomic, copy, nullable) NSString *audioBase64; @property(nonatomic, strong, nullable) NSData *audioData; @end @interface KBAiSyncResponse : NSObject @property(nonatomic, assign) NSInteger code; @property(nonatomic, strong, nullable) KBAiSyncData *data; @end typedef void (^AiVMSyncCompletion)(KBAiSyncResponse *_Nullable response, NSError *_Nullable error); @interface KBAiMessageData : NSObject @property(nonatomic, copy, nullable) NSString *content; @property(nonatomic, copy, nullable) NSString *text; @property(nonatomic, copy, nullable) NSString *message; @end @interface KBAiMessageResponse : NSObject @property(nonatomic, assign) NSInteger code; @property(nonatomic, strong, nullable) KBAiMessageData *data; @end typedef void (^AiVMMessageCompletion)(KBAiMessageResponse *_Nullable response, NSError *_Nullable error); typedef void (^AiVMElevenLabsCompletion)(NSData *_Nullable audioData, NSError *_Nullable error); @interface AiVM : NSObject - (void)syncChatWithTranscript:(NSString *)transcript completion:(AiVMSyncCompletion)completion; - (void)requestChatMessageWithContent:(NSString *)content completion:(AiVMMessageCompletion)completion; - (void)requestElevenLabsSpeechWithText:(NSString *)text voiceId:(NSString *)voiceId apiKey:(NSString *)apiKey outputFormat:(nullable NSString *)outputFormat modelId:(nullable NSString *)modelId completion:(AiVMElevenLabsCompletion)completion; @end NS_ASSUME_NONNULL_END