61 lines
1.9 KiB
Objective-C
61 lines
1.9 KiB
Objective-C
//
|
|
// AiVM.h
|
|
// keyBoard
|
|
//
|
|
// Created by Mac on 2026/1/22.
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
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;
|
|
@property(nonatomic, copy, nullable) NSString *aiResponse;
|
|
@property(nonatomic, copy, nullable) NSString *audioId;
|
|
@property(nonatomic, assign) NSInteger llmDuration;
|
|
@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 (^AiVMAudioURLCompletion)(NSString *_Nullable audioURL,
|
|
NSError *_Nullable error);
|
|
|
|
@interface AiVM : NSObject
|
|
|
|
- (void)syncChatWithTranscript:(NSString *)transcript
|
|
completion:(AiVMSyncCompletion)completion;
|
|
|
|
- (void)requestChatMessageWithContent:(NSString *)content
|
|
completion:(AiVMMessageCompletion)completion;
|
|
|
|
/// 根据 audioId 获取音频 URL
|
|
- (void)requestAudioWithAudioId:(NSString *)audioId
|
|
completion:(AiVMAudioURLCompletion)completion;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|