liuhua
liuhua
commited on
Commit
·
a27d105
1
Parent(s):
1061738
Fix a bug in agent api (#3551)
Browse files### What problem does this PR solve?
Fix a bug in agent api
#3539
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
Co-authored-by: liuhua <[email protected]>
sdk/python/ragflow_sdk/modules/agent.py
CHANGED
@@ -51,7 +51,7 @@ class Agent(Base):
|
|
51 |
|
52 |
@staticmethod
|
53 |
def create_session(id,rag) -> Session:
|
54 |
-
res = requests.post(f"
|
55 |
res = res.json()
|
56 |
if res.get("code") == 0:
|
57 |
return Session(rag,res.get("data"))
|
|
|
51 |
|
52 |
@staticmethod
|
53 |
def create_session(id,rag) -> Session:
|
54 |
+
res = requests.post(f"{rag.api_url}/agents/{id}/sessions",headers={"Authorization": f"Bearer {rag.user_key}"},json={})
|
55 |
res = res.json()
|
56 |
if res.get("code") == 0:
|
57 |
return Session(rag,res.get("data"))
|