@unif/react-native-chat-sdk 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -57,7 +57,7 @@ function App() {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
function ChatScreen() {
|
|
60
|
-
const {messages, onRequest,
|
|
60
|
+
const {messages, onRequest, isRequesting, abort} = useChatContext();
|
|
61
61
|
// 使用 messages 渲染列表,onRequest 发送消息...
|
|
62
62
|
}
|
|
63
63
|
```
|
|
@@ -68,7 +68,7 @@ function ChatScreen() {
|
|
|
68
68
|
import {useXChat, useXConversations, useXModel} from '@unif/react-native-chat-sdk';
|
|
69
69
|
|
|
70
70
|
function ChatScreen() {
|
|
71
|
-
const {messages, onRequest, abort,
|
|
71
|
+
const {messages, onRequest, abort, isRequesting} = useXChat({provider});
|
|
72
72
|
const {sessions, switchSession, newSession} = useXConversations({storage: AsyncStorage});
|
|
73
73
|
const {selectedModel, setSelectedModel} = useXModel({models: MODELS});
|
|
74
74
|
}
|
|
@@ -85,7 +85,7 @@ function ChatScreen() {
|
|
|
85
85
|
```typescript
|
|
86
86
|
const {
|
|
87
87
|
messages, // MessageInfo[] — 可渲染消息列表
|
|
88
|
-
|
|
88
|
+
isRequesting, // boolean — 是否请求中
|
|
89
89
|
suggestions, // SuggestionItem[] — 建议提示
|
|
90
90
|
error, // string | null — 错误信息
|
|
91
91
|
onRequest, // (input) => void — 发起请求
|
|
@@ -244,7 +244,7 @@ interface ChatStorage {
|
|
|
244
244
|
|
|
245
245
|
| @unif/react-native-chat-sdk | React Native | React | 状态 |
|
|
246
246
|
|-----------------------------|-------------|-------|------|
|
|
247
|
-
|
|
|
247
|
+
| 1.0.0 | >= 0.71 | >= 18 | ✅ |
|
|
248
248
|
|
|
249
249
|
## 许可证
|
|
250
250
|
|