Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

dialog_service.py 1.2KB

1234567891011121314151617181920212223242526272829303132333435
  1. #
  2. # Copyright 2019 The RAG Flow 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. import peewee
  17. from werkzeug.security import generate_password_hash, check_password_hash
  18. from web_server.db.db_models import DB, UserTenant
  19. from web_server.db.db_models import Dialog, Conversation, DialogKb
  20. from web_server.db.services.common_service import CommonService
  21. from web_server.utils import get_uuid, get_format_time
  22. from web_server.db.db_utils import StatusEnum
  23. class DialogService(CommonService):
  24. model = Dialog
  25. class ConversationService(CommonService):
  26. model = Conversation
  27. class DialogKbService(CommonService):
  28. model = DialogKb