s_chat_dataset.go 938 B

123456789101112131415161718192021222324252627282930313233343536
  1. package schema
  2. // ChatDataset ChatDataset对象
  3. type ChatDataset struct {
  4. RecordID string `json:"record_id"` // 记录id
  5. ChatAssistantId string `json:"chat_assistant_id"` // 聊天助手id
  6. DatasetId string `json:"dataset_id"` // 知识库id
  7. RagDataId string `json:"rag_data_id"` // rag_dataset_id
  8. }
  9. // ChatDatasetQueryParam 查询条件
  10. type ChatDatasetQueryParam struct {
  11. ChatId string
  12. RecordIDs []string
  13. }
  14. // ChatDatasetQueryOptions ChatDataset对象查询可选参数项
  15. type ChatDatasetQueryOptions struct {
  16. PageParam *PaginationParam // 分页参数
  17. }
  18. type ChatDatasets []*ChatDataset
  19. // ChatDatasetQueryResult ChatDataset对象查询结果
  20. type ChatDatasetQueryResult struct {
  21. Data ChatDatasets
  22. PageResult *PaginationResult
  23. }
  24. func (a ChatDatasets) ToDatasetIds() []string {
  25. Ids := make([]string, len(a))
  26. for k, v := range a {
  27. Ids[k] = v.DatasetId
  28. }
  29. return Ids
  30. }