RtcAigcMessage class

RTC AIGC消息模型

Constructors

RtcAigcMessage({required String id, required MessageType type, String text = '', String? senderId, bool isUser = false, bool isInterrupted = false, int? timestamp, String? functionName, Map<String, dynamic>? functionArguments, String? status, bool isFinal = false})
构造函数
RtcAigcMessage.ai({required String id, required String text, String? senderId, int? timestamp})
用于创建AI消息的工厂方法
factory
RtcAigcMessage.error({required String id, required String text, int? timestamp})
用于创建错误消息的工厂方法
factory
RtcAigcMessage.fromJson(Map<String, dynamic> json)
从JSON创建实例
factory
RtcAigcMessage.functionCall({required String id, required String name, required Map<String, dynamic> arguments, required int timestamp, String? senderId})
用于创建功能调用消息的工厂方法
factory
RtcAigcMessage.functionReturn({required String id, required String callId, required dynamic result, bool isUser = false, int? timestamp})
用于创建功能返回消息的工厂方法
factory
RtcAigcMessage.status({required String id, required String status, required int timestamp, String? senderId})
用于创建状态消息的工厂方法
factory
RtcAigcMessage.system({required String id, required String text, int? timestamp})
用于创建系统消息的工厂方法
factory
RtcAigcMessage.text({required String id, required String text, required bool isUser, int? timestamp, String? senderId, bool isInterrupted = false, bool isFinal = false})
用于创建文本消息的工厂方法
factory
RtcAigcMessage.user({required String id, required String text, String? senderId, int? timestamp})
用于创建用户消息的工厂方法
factory

Properties

functionArguments Map<String, dynamic>?
函数调用参数 (如果是函数调用)
final
functionName String?
函数调用名称 (如果是函数调用)
final
hashCode int
The hash code for this object.
no setterinherited
id String
消息ID
final
isFinal bool
对于字幕,是否是最终字幕
final
isInterrupted bool
是否被中断
final
isUser bool
是否为用户消息
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
senderId String?
发送者ID
final
status String?
状态信息 (如果是状态消息)
final
text String
消息内容
final
timestamp int?
消息时间戳
getter/setter pair
type MessageType
消息类型
final

Methods

copyWith({String? id, MessageType? type, String? text, String? senderId, bool? isUser, bool? isInterrupted, int? timestamp, String? functionName, Map<String, dynamic>? functionArguments, String? status, bool? isFinal}) RtcAigcMessage
复制并修改某些属性
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
转换为JSON
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited