Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

dataset_example.sh 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #
  2. # Copyright 2024 The InfiniFlow Authors. All Rights Reserved.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. # Create a dataset
  17. echo -e "\n-- Create a dataset"
  18. curl --request POST \
  19. --url http://localhost:9380/api/v1/datasets \
  20. --header 'Content-Type: application/json' \
  21. --header 'Authorization: Bearer ragflow-IzZmY1MGVhYTBhMjExZWZiYTdjMDI0Mm' \
  22. --data '{
  23. "name": "test"
  24. }'
  25. # Update the dataset
  26. echo -e "\n-- Update the dataset"
  27. curl --request PUT \
  28. --url http://localhost:9380/api/v1/datasets/2e898768a0bc11efb46a0242ac120006 \
  29. --header 'Content-Type: application/json' \
  30. --header 'Authorization: Bearer ragflow-IzZmY1MGVhYTBhMjExZWZiYTdjMDI0Mm' \
  31. --data '
  32. {
  33. "name": "updated_dataset"
  34. }'
  35. # List datasets
  36. echo -e "\n-- List datasets"
  37. curl --request GET \
  38. --url http://127.0.0.1:9380/api/v1/datasets \
  39. --header 'Authorization: Bearer ragflow-IzZmY1MGVhYTBhMjExZWZiYTdjMDI0Mm'
  40. # Delete datasets
  41. echo -e "\n-- Delete datasets"
  42. curl --request DELETE \
  43. --url http://localhost:9380/api/v1/datasets \
  44. --header 'Content-Type: application/json' \
  45. --header 'Authorization: Bearer ragflow-IzZmY1MGVhYTBhMjExZWZiYTdjMDI0Mm' \
  46. --data '{
  47. "ids": ["301298b8a0bc11efa0440242ac120006"]
  48. }'