Refact: Tenant api (#14288)

### What problem does this PR solve?

Refact: Tenant api

### Type of change

- [x] Refactoring
This commit is contained in:
Magicbook1108
2026-04-22 20:00:32 +08:00
committed by GitHub
parent 1434f8ade8
commit d1c62fc19d
5 changed files with 96 additions and 56 deletions

17
sdk/python/test.py Normal file
View File

@@ -0,0 +1,17 @@
from .ragflow_sdk import RAGFlow
rag_object = RAGFlow(api_key="ragflow-FDfRECsXDRagsKPxb_EfZdDPcmngavSgYEzbU_Blgq4", base_url="http://localhost:9222")
assistant = rag_object.get_agent("b0bc46e43dfc11f1b4ff84ba59bc54d9")
session = assistant.create_session()
print("\n==================== Miss R =====================\n")
print("Hello. What can I do for you?")
while True:
question = input("\n==================== User =====================\n> ")
print("\n==================== Miss R =====================\n")
cont = ""
for ans in session.ask(question, stream=True):
print(ans.content[len(cont):], end='', flush=True)
cont = ans.content