yt-chat-components 0.9.6 → 0.9.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-chat-components",
3
- "version": "0.9.6",
3
+ "version": "0.9.7",
4
4
  "main": "build/static/js/bundle.min.js",
5
5
  "module": "build/static/js/bundle.min.js",
6
6
  "types": "build/static/js/index.d.ts",
@@ -160,7 +160,7 @@ export default function ChatWindow({
160
160
  } else if (event == 'token') {
161
161
  setNowAIContent((prevState) => prevState + data['chunk']);
162
162
  if (lastMessage.current) lastMessage.current.scrollIntoView({ behavior: 'smooth' });
163
- } else if (event == 'end') {
163
+ } else if (false && event == 'end') {// 移除end事件的响应
164
164
  const res = {
165
165
  data: data['result'],
166
166
  };
@@ -355,7 +355,7 @@ export class ToolDialog extends React.Component {
355
355
  // 单独组件情况
356
356
  if(isRefreshWords){
357
357
  this.getFlowInfo().then(currentFlow=>{
358
- const dropDownList = this.getDropDownList(currentFlow.welcome_words);
358
+ const dropDownList = this.getDropDownList(currentFlow.welcome_words||[]);
359
359
  this.setState({ dropDownList, currentFlow })
360
360
  })
361
361
  }
@@ -365,7 +365,7 @@ export class ToolDialog extends React.Component {
365
365
  }else{
366
366
  const currentScene = sceneData||this.state.sceneInfo;
367
367
  const currentFlow = currentScene.flows[0];
368
- const dropDownList = this.getDropDownList(currentFlow.welcome_words);
368
+ const dropDownList = this.getDropDownList(currentFlow.welcome_words||[]);
369
369
  if(!isEmpty(sceneData)){
370
370
  this.setState({ currentFlow, dropDownList })
371
371
  }else if(isEmpty(this.state.sceneInfo)){
@@ -400,7 +400,7 @@ export class ToolDialog extends React.Component {
400
400
  return;
401
401
  }
402
402
  this.setState({ sessionId: uuidv4() });
403
- this.setState({ dropDownList: this.getDropDownList(this.state.currentFlow.welcome_words) })
403
+ this.setState({ dropDownList: this.getDropDownList(this.state.currentFlow.welcome_words||[]) })
404
404
  }
405
405
 
406
406
  updateSessionId = (sessionId) => {
@@ -411,7 +411,7 @@ export class ToolDialog extends React.Component {
411
411
  if(isEmpty(welcome_words)){
412
412
  return defaultList;
413
413
  }
414
- return welcome_words.map((question,index)=>(
414
+ return welcome_words.slice(0,3).map((question,index)=>(
415
415
  {
416
416
  backgroundImg:defaultList[index].backgroundImg,
417
417
  title:question,