You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the Python Agent example, it's throwing a few exceptions.
Here is my python code.
from ragflow_sdk import RAGFlow,Agent
rag_object = RAGFlow(api_key="ragflow-apikey", base_url="http://urlhere:9380")
AGENT_id = "2a6fb1b0a78311ef96d60242asadfsdfafd"
session = Agent.create_session(AGENT_id,rag_object)
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
I get the following error:
Exception has occurred: TypeError
Session.ask() got an unexpected keyword argument 'stream'
File "C:\Users\Coding\Ragflow\testagent.py", line 17, in <module>
for ans in session.ask(question, stream=True):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Session.ask() got an unexpected keyword argument 'stream'
When I remove stream from session.ask (looks like stream isn't defined in the sdk at all) I get this error:
Exception has occurred: Exception
AssertionError('Nothing. Is it over?')
File "C:\Users\Coding\Ragflow\testagent.py", line 17, in <module>
for ans in session.ask(question): #, stream=True):
Exception: AssertionError('Nothing. Is it over?')
Expected behavior
No response
Steps to reproduce
run this code from python.
from ragflow_sdk import RAGFlow,Agent
rag_object = RAGFlow(api_key="ragflow-apikey", base_url="http://urlhere:9380")
AGENT_id = "2a6fb1b0a78311ef96d60242acasfdsf"
session = Agent.create_session(AGENT_id,rag_object)
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
Additional information
No response
The text was updated successfully, but these errors were encountered:
I used the dev image and encountered a similar bug. I built and successfully ran an Agent, but when I tried to invoke it using the HTTP API, it returned {"code":100,"data":null,"message":"AssertionError('Nothing. Is it over?')"}.
Is there an existing issue for the same bug?
Branch name
main
Commit ID
9b2f19f
Other environment information
No response
Actual behavior
When running the Python Agent example, it's throwing a few exceptions.
Here is my python code.
I get the following error:
When I remove stream from session.ask (looks like stream isn't defined in the sdk at all) I get this error:
Expected behavior
No response
Steps to reproduce
Additional information
No response
The text was updated successfully, but these errors were encountered: