1
This commit is contained in:
@@ -51,6 +51,7 @@ typedef void (^AiVMAudioURLCompletion)(NSString *_Nullable audioURL,
|
||||
completion:(AiVMSyncCompletion)completion;
|
||||
|
||||
- (void)requestChatMessageWithContent:(NSString *)content
|
||||
companionId:(NSInteger)companionId
|
||||
completion:(AiVMMessageCompletion)completion;
|
||||
|
||||
/// 根据 audioId 获取音频 URL
|
||||
|
||||
@@ -95,6 +95,7 @@ autoShowBusinessError:NO
|
||||
}
|
||||
|
||||
- (void)requestChatMessageWithContent:(NSString *)content
|
||||
companionId:(NSInteger)companionId
|
||||
completion:(AiVMMessageCompletion)completion {
|
||||
if (content.length == 0) {
|
||||
NSError *error = [NSError
|
||||
@@ -111,9 +112,12 @@ autoShowBusinessError:NO
|
||||
[content stringByAddingPercentEncodingWithAllowedCharacters:
|
||||
[NSCharacterSet URLQueryAllowedCharacterSet]];
|
||||
NSString *path = [NSString
|
||||
stringWithFormat:@"%@?content=%@", API_AI_CHAT_MESSAGE,
|
||||
encodedContent ?: @""];
|
||||
NSDictionary *params = @{ @"content" : content ?: @"" };
|
||||
stringWithFormat:@"%@?content=%@&companionId=%ld", API_AI_CHAT_MESSAGE,
|
||||
encodedContent ?: @"", (long)companionId];
|
||||
NSDictionary *params = @{
|
||||
@"content" : content ?: @"",
|
||||
@"companionId" : @(companionId)
|
||||
};
|
||||
[[KBNetworkManager shared]
|
||||
POST:path
|
||||
jsonBody:params
|
||||
|
||||
Reference in New Issue
Block a user