mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Add sdk for list agents and sessions (#3848)
### What problem does this PR solve? Add sdk for list agents and sessions ### Type of change - [x] New Feature (non-breaking change which adds functionality) Co-authored-by: liuhua <10215101452@stu.ecun.edu.cn>
This commit is contained in:
9
sdk/python/test/test_sdk_api/t_agent.py
Normal file
9
sdk/python/test/test_sdk_api/t_agent.py
Normal file
@ -0,0 +1,9 @@
|
||||
from ragflow_sdk import RAGFlow,Agent
|
||||
from common import HOST_ADDRESS
|
||||
import pytest
|
||||
|
||||
@pytest.mark.skip(reason="")
|
||||
def test_list_agents_with_success(get_api_key_fixture):
|
||||
API_KEY=get_api_key_fixture
|
||||
rag = RAGFlow(API_KEY,HOST_ADDRESS)
|
||||
rag.list_agents()
|
||||
@ -51,4 +51,5 @@ def test_delete_datasets_with_success(get_api_key_fixture):
|
||||
def test_list_datasets_with_success(get_api_key_fixture):
|
||||
API_KEY = get_api_key_fixture
|
||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||
rag.create_dataset("test_list_datasets")
|
||||
rag.list_datasets()
|
||||
|
||||
@ -107,4 +107,11 @@ def test_create_agent_conversation_with_success(get_api_key_fixture):
|
||||
API_KEY = "ragflow-BkOGNhYjIyN2JiODExZWY5MzVhMDI0Mm"
|
||||
rag = RAGFlow(API_KEY,HOST_ADDRESS)
|
||||
session = Agent.create_session("2e45b5209c1011efa3e90242ac120006", rag)
|
||||
session.ask("What is this job")
|
||||
session.ask("What is this job")
|
||||
|
||||
@pytest.mark.skip(reason="")
|
||||
def test_list_agent_sessions_with_success(get_api_key_fixture):
|
||||
API_KEY = "ragflow-BkOGNhYjIyN2JiODExZWY5MzVhMDI0Mm"
|
||||
agent_id = "2710f2269b4611ef8fdf0242ac120006"
|
||||
rag = RAGFlow(API_KEY,HOST_ADDRESS)
|
||||
Agent.list_sessions(agent_id,rag)
|
||||
|
||||
Reference in New Issue
Block a user