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
Adding "session_id" parameter to the payload when using the Python SDK causes an error on DS Langflow.
This works great using a local version of Langflow at version 1.0.19.post2.
Here is both a error trace along with a working trace. I printed out the payload, headers, and response for troubleshooting:
Broken
You: test me
API URL: https://api.langflow.astra.datastax.com/lf/37fb0878-2f37-4245-b1c9-bfb7b47b5036/api/v1/run/zoom_ai_bot
PAYLOAD: {'input_value': 'test me', 'output_type': 'chat', 'input_type': 'chat', 'session_id': 'local_zoom_ai_bot_user'}
HEADERS: {'Authorization': 'Bearer AstraCS:somethigyoushouldnotsee', 'Content-Type': 'application/json'}
JSON RESPONSE: <Response [504]>
Traceback (most recent call last):
File "/Users/david.gilardi/zmail_astradb/venv/lib/python3.11/site-packages/requests/models.py", line 974, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/david.gilardi/.pyenv/versions/3.11.9/lib/python3.11/json/init.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/david.gilardi/.pyenv/versions/3.11.9/lib/python3.11/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/david.gilardi/.pyenv/versions/3.11.9/lib/python3.11/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/david.gilardi/zmail_astradb/datastax/zoom_ai_bot.py", line 160, in
main()
File "/Users/david.gilardi/zmail_astradb/datastax/zoom_ai_bot.py", line 156, in main
response = get_response_from_api(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/david.gilardi/zmail_astradb/datastax/zoom_ai_bot.py", line 128, in get_response_from_api
result = run_flow(
^^^^^^^^^
File "/Users/david.gilardi/zmail_astradb/datastax/zoom_ai_bot.py", line 86, in run_flow
return response.json()
^^^^^^^^^^^^^^^
File "/Users/david.gilardi/zmail_astradb/venv/lib/python3.11/site-packages/requests/models.py", line 978, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
python3 datastax/zoom_ai_bot.py
Welcome to the Zoom AI Bot. Type 'exit' to quit.
Add session_id to payload using the Python SDK when using DS Langflow
Execute code to execute flow
Notice the code below. If I comment out the session_id param below using a local LF instance at 1.0.19.post2 this works. It, however, will break DS Langflow.
If I comment session_id out the code works fine on DS Langflow.
The session_id value is passed along with the payload correctly setting the session_id value for affected components and, thereby, storing the correct user session ID value in our chat_history Astra DB collection.
Who can help?
No response
Operating System
DataStax Langflow
Langflow Version
1.0.19.post1???
Python Version
None
Screenshot
No response
Flow File
No response
The text was updated successfully, but these errors were encountered:
Bug Description
Adding "session_id" parameter to the payload when using the Python SDK causes an error on DS Langflow.
This works great using a local version of Langflow at version 1.0.19.post2.
Here is both a error trace along with a working trace. I printed out the payload, headers, and response for troubleshooting:
Broken
You: test me
API URL: https://api.langflow.astra.datastax.com/lf/37fb0878-2f37-4245-b1c9-bfb7b47b5036/api/v1/run/zoom_ai_bot
PAYLOAD: {'input_value': 'test me', 'output_type': 'chat', 'input_type': 'chat', 'session_id': 'local_zoom_ai_bot_user'}
HEADERS: {'Authorization': 'Bearer AstraCS:somethigyoushouldnotsee', 'Content-Type': 'application/json'}
JSON RESPONSE: <Response [504]>
Traceback (most recent call last):
File "/Users/david.gilardi/zmail_astradb/venv/lib/python3.11/site-packages/requests/models.py", line 974, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/david.gilardi/.pyenv/versions/3.11.9/lib/python3.11/json/init.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/david.gilardi/.pyenv/versions/3.11.9/lib/python3.11/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/david.gilardi/.pyenv/versions/3.11.9/lib/python3.11/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/david.gilardi/zmail_astradb/datastax/zoom_ai_bot.py", line 160, in
main()
File "/Users/david.gilardi/zmail_astradb/datastax/zoom_ai_bot.py", line 156, in main
response = get_response_from_api(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/david.gilardi/zmail_astradb/datastax/zoom_ai_bot.py", line 128, in get_response_from_api
result = run_flow(
^^^^^^^^^
File "/Users/david.gilardi/zmail_astradb/datastax/zoom_ai_bot.py", line 86, in run_flow
return response.json()
^^^^^^^^^^^^^^^
File "/Users/david.gilardi/zmail_astradb/venv/lib/python3.11/site-packages/requests/models.py", line 978, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
python3 datastax/zoom_ai_bot.py
Welcome to the Zoom AI Bot. Type 'exit' to quit.
Working
You: test me
API URL: https://api.langflow.astra.datastax.com/lf/37fb0878-2f37-4245-b1c9-bfb7b47b5036/api/v1/run/zoom_ai_bot
PAYLOAD: {'input_value': 'test me', 'output_type': 'chat', 'input_type': 'chat'}
HEADERS: {'Authorization': 'Bearer AstraCS:somethingyoushouldnotsee', 'Content-Type': 'application/json'}
JSON RESPONSE: <Response [200]>
Bot: I did.
Reproduction
Notice the code below. If I comment out the session_id param below using a local LF instance at 1.0.19.post2 this works. It, however, will break DS Langflow.
If I comment session_id out the code works fine on DS Langflow.
Expected behavior
The session_id value is passed along with the payload correctly setting the session_id value for affected components and, thereby, storing the correct user session ID value in our chat_history Astra DB collection.
Who can help?
No response
Operating System
DataStax Langflow
Langflow Version
1.0.19.post1???
Python Version
None
Screenshot
No response
Flow File
No response
The text was updated successfully, but these errors were encountered: