NatureChatCore class
Nature Expert 聊天(透传原生 SmartDeviceCore 的 NatureChat 能力)。
- 鉴权自动:复用 App 现有登录会话(SmartDeviceCore.login 后 token 已存),无需单独登录。
- 鉴权失败(iot 拦截)是 HTTP 200 + result<0:init 用 NatureChatInitResponse.isIotIntercepted 判断,message 走 onError;并会触发原生标准 token 过期机制,与其它接口一致。
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
initChat(
NatureChatInitRequest request, {required OnSuccess< NatureChatInitResponse> onSuccess, required OnError onError}) → void -
初始化会话:回显 canAsk / initialQuestions / birdMembershipType / isSharedSession。
务必用
data.isIotIntercepted()判断是否被 iot 拦截(拦截时不要当成功)。 -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sendMessage(
NatureChatMessageRequest request, {required NatureChatStreamCallback callback}) → void - 发消息(SSE 流式)。回调:onContent(多次)/ onSuggestions / onDone / onError。 sessionId + content 必填。
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited