Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

t_agent.py 1.2KB

123456789101112131415161718192021222324252627282930313233343536
  1. #
  2. # Copyright 2025 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. from ragflow_sdk import RAGFlow, Agent
  17. from common import HOST_ADDRESS
  18. import pytest
  19. @pytest.mark.skip(reason="")
  20. def test_list_agents_with_success(get_api_key_fixture):
  21. API_KEY = get_api_key_fixture
  22. rag = RAGFlow(API_KEY, HOST_ADDRESS)
  23. rag.list_agents()
  24. @pytest.mark.skip(reason="")
  25. def test_converse_with_agent_with_success(get_api_key_fixture):
  26. API_KEY = "ragflow-BkOGNhYjIyN2JiODExZWY5MzVhMDI0Mm"
  27. agent_id = "ebfada2eb2bc11ef968a0242ac120006"
  28. rag = RAGFlow(API_KEY, HOST_ADDRESS)
  29. lang = "Chinese"
  30. file = "How is the weather tomorrow?"
  31. Agent.ask(agent_id=agent_id, rag=rag, lang=lang, file=file)