41 lines
797 B
Objective-C
41 lines
797 B
Objective-C
//
|
|
// KBAiChatView.h
|
|
// keyBoard
|
|
//
|
|
// Created by Mac on 2026/1/15.
|
|
//
|
|
|
|
#import <UIKit/UIKit.h>
|
|
#import "KBAiChatMessage.h"
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
/// 聊天视图
|
|
/// 显示用户消息和 AI 回复的气泡列表
|
|
@interface KBAiChatView : UIView
|
|
|
|
/// 添加用户消息
|
|
/// @param text 消息文本
|
|
- (void)addUserMessage:(NSString *)text;
|
|
|
|
/// 添加 AI 消息
|
|
/// @param text 消息文本
|
|
- (void)addAssistantMessage:(NSString *)text;
|
|
|
|
/// 更新最后一条 AI 消息(用于打字机效果)
|
|
/// @param text 当前可见文本
|
|
- (void)updateLastAssistantMessage:(NSString *)text;
|
|
|
|
/// 标记最后一条 AI 消息完成
|
|
- (void)markLastAssistantMessageComplete;
|
|
|
|
/// 清空所有消息
|
|
- (void)clearMessages;
|
|
|
|
/// 滚动到底部
|
|
- (void)scrollToBottom;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|