page-hangzhou.component.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <ion-content>
  2. <ion-segment [value]="tab" (ionChange)="tabChange($event)">
  3. <ion-segment-button value="vector">
  4. <ion-label>向量提取</ion-label>
  5. </ion-segment-button>
  6. <ion-segment-button value="retrive">
  7. <ion-label>记忆召回</ion-label>
  8. </ion-segment-button>
  9. <ion-segment-button value="story">
  10. <ion-label>知识问答</ion-label>
  11. </ion-segment-button>
  12. </ion-segment>
  13. @if(tab=="vector"){
  14. <ion-list>
  15. @for(file of fileList;track file.title){
  16. <ion-item>
  17. <ion-label>标题:{{file?.title}}</ion-label>
  18. <ion-button (click)="preview(file)">预览</ion-button>
  19. <ion-button (click)="loader(file)">加载</ion-button>
  20. </ion-item>
  21. @if(storyMap[file?.url]){
  22. <ion-item>
  23. 加载:正文{{storyMap[file?.url]?.content?.length}}字符
  24. <ion-button (click)="splitter(storyMap[file?.url])">分割</ion-button>
  25. </ion-item>
  26. }
  27. @if(storyMap[file?.url]?.docList?.length){
  28. <div style="display: flex;flex-direction: column;">
  29. <ion-button (click)="embedings(storyMap[file?.url])">嵌入</ion-button>
  30. 分割:文本块{{storyMap[file?.url]?.docList?.length}}个
  31. @for(doc of storyMap[file?.url]?.docList;track doc){
  32. <p>行{{doc.metadata?.loc?.lines?.from}}至行{{doc.metadata?.loc?.lines?.to}}</p>
  33. <p>{{doc.pageContent}}</p>
  34. }
  35. </div>
  36. }
  37. }
  38. </ion-list>
  39. }
  40. @if(tab=="retrive"){
  41. <ion-list>
  42. <ion-item>
  43. <ion-textarea [value]="userInput" (ionChange)="inputChange($event)" label="用户输入" placeholder="请输入您的问题"></ion-textarea>
  44. </ion-item>
  45. <ion-item>
  46. <ion-button (click)="retriveFrontEnd()">前端检索</ion-button>
  47. <ion-button (click)="retriveBackEnd()">后端检索</ion-button>
  48. </ion-item>
  49. @if(searchDocList?.length){
  50. @for(doc of searchDocList;track doc){
  51. <ion-item>
  52. 相似度:{{doc.similarity}} 内容:{{doc.pageContent}}
  53. </ion-item>
  54. }
  55. }
  56. </ion-list>
  57. }
  58. @if(tab=="story"){
  59. }
  60. </ion-content>