-
-
Notifications
You must be signed in to change notification settings - Fork 558
feat: update useXChat & XRequest & fix useXAgent's RequestFn onSuccess type #725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: WB01676250 <[email protected]>
chore: sync feature to main branch
* docs(conversations): fix typo of group-sort demo * test(conversations): update demo snap
* refactor: Update ActionButton.tsx * test: add test case for disabled action button
* refactor: memo mergedContent * refactor: memo avatarNode * refactor: remove useDisplayData * refactor: memo bubble list item * refactor: add _key for MemoBubbleListItem --------- Co-authored-by: afc163 <[email protected]> Co-authored-by: Mickey <[email protected]>
* chore: sync .dumi files from ant-design * fix use hooks * fix link * fix lint * fix lint * fix code block button * fix code block button * update * update * update * Update components/bubble/index.en-US.md * update * useState => useRef * load lottie-web async
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Bundle ReportBundle size has no change ✅ |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feature #725 +/- ##
===========================================
+ Coverage 92.33% 92.37% +0.04%
===========================================
Files 66 66
Lines 1487 1495 +8
Branches 400 404 +4
===========================================
+ Hits 1373 1381 +8
Misses 114 114 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
request: async ({ message }, { onSuccess, onError }) => { | ||
await sleep(); | ||
|
||
mockSuccess = !mockSuccess; | ||
|
||
if (mockSuccess) { | ||
onSuccess(`Mock success return. You said: ${message}`); | ||
onSuccess([`Mock success return. You said: ${message}`]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这是 break change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是之前类型写错了,x-request 的onSuccess本身就要返回数组的,结果mock的request全部没写对,导致接入真实模型有很多bug,但是数据处理层面已经做了兼容了,即使没有返回数组这样写也不会影响运行,demo还是按照准确的数据进行返回。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
中文版模板 / Chinese template
🤔 This is a ...
useXAgent requestFn类型与XRequest 不一致,onSuccess如果是流需要返回数组,同时useXChat 在流的真实场景直接将onSuccess返回的数组set进了message,导致useXChat不可用。
🔗 Related Issues
前置PR:
#711
前置PR相关ISSUES:
#536
#436
#705
#690
#248
本次PR相关ISSUES:
#690