rag.js 875 B

12345678910111213141516171819202122232425262728
  1. /** @typedef {'DOCUMENT'|'STRUCTURED_DATA'|'GRAPH'} RagSourceType */
  2. /** @typedef {'pending'|'running'|'success'|'failed'} RagStepStatus */
  3. /**
  4. * @typedef {Object} RagEvidence
  5. * @property {string=} id
  6. * @property {RagSourceType} sourceType
  7. * @property {string=} evidenceType
  8. * @property {string=} title
  9. * @property {string=} content
  10. * @property {number=} score
  11. * @property {string=} sourceName
  12. * @property {Object=} sourceRef
  13. * @property {Object=} payload
  14. * @property {Object=} metadata
  15. */
  16. /**
  17. * @typedef {Object} RagStep
  18. * @property {'document'|'structured'|'graph'|'kb'|'fusion'} key
  19. * @property {string} title
  20. * @property {string} description
  21. * @property {RagStepStatus} status
  22. * @property {string=} time
  23. * @property {string=} error
  24. */
  25. export const RAG_SOURCE = Object.freeze({ DOCUMENT: 'DOCUMENT', STRUCTURED: 'STRUCTURED_DATA', GRAPH: 'GRAPH' })