Adds userId to each query

#11
by samayg - opened

Uses https://www.gradio.app/guides/state-in-blocks to create a state for userID(by default "gradio" for people using the huggingface interface)
Changes the machine learning model's prediction function to "getResponse" from "user"(to remove any ambiguity)
Now passes in the userId state in input and output to msg-submit and btn-click functions. This will allow us to manipulate this value in the "getResponse" function as needed(currently it does nothing)
I went with this approach as it seemed cleaner than using a delimiter and then passing the userId along with the query:

  • This also prevents issues where the delimiter is present in the userId or the query itself
str-platformAI changed pull request status to merged

Sign up or log in to comment