langchain-ai / langchain-aws-template

Build Generative AI applications with Langchain on AWS
Other
172 stars 49 forks source link

Fix streamlit code so that dictionary lookup for 'session_id' and 're… #4

Closed gitmj closed 1 year ago

gitmj commented 1 year ago

…sponse' keys works.

gitmj commented 1 year ago

Streamlit app was not working without these changes so I debugged it and fixed the problem. Hopefully, this will help someone else trying out the streamlit app to verify the API calls.

3coins commented 1 year ago

@gitmj In python, there is no difference in the 2 treatments. For example, look at this code:

>>> a = {"b": {"c": "d"}}
>>> a["b"]["c"]
'd'
>>> (a["b"])["c"]
'd'
>>> 

Not sure, if the error you saw was because of this. What's the Python version you are using?

gitmj commented 1 year ago

python --version

Python 3.9.16

You are right.

Context: Streamlit app was throwing an error saying 'session_id' key not found as well as 'response' key was not found when I was debugging the API and endpoint was NOT responding (openai key error) because this dictionary is coming back as reply from the API. I thought this was the reason but I tested it again now and it does not make any difference so ignore the pull request.

On Wed, Mar 29, 2023 at 5:40 PM Piyush Jain @.***> wrote:

@gitmj https://github.com/gitmj In python, there is no difference in the 2 treatments. For example, look at this code:

a = {"b": {"c": "d"}}>>> a["b"]["c"]'d'>>> (a["b"])["c"]'d'>>>

Not sure, if the error you saw was because of this. What's the Python version you are using?

— Reply to this email directly, view it on GitHub https://github.com/3coins/langchain-aws-template/pull/4#issuecomment-1489524150, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADHAS5ZI7XEAWJXISSIAGYTW6TI7BANCNFSM6AAAAAAWMQBPAQ . You are receiving this because you were mentioned.Message ID: @.***>