chainlit icon indicating copy to clipboard operation
chainlit copied to clipboard

How to read URL parameters?

Open palmentropyc opened this issue 1 year ago • 3 comments

Hi everyone, I'm trying to obtain a URL parameter or find another way to identify a specific chat session in Chainlit, without using authentication.

I'm looking for guidance on how to read URL parameters from within Chainlit, as accessing them directly from the Python backend seems not straightforward. Specifically, I'm unsure how to bridge the gap between the frontend (React or similar) and the Python backend to achieve this.

I.E if I run mydomain.com/?param1=hello, how can I read this from chainlit?

Any advice or pointers on how to approach this within Chainlit?

Thank you!

palmentropyc avatar Feb 27 '24 11:02 palmentropyc

I have the same issue. I have tried various methods but have not found a solution yet. If anyone has a workaround or suggestion, I am open to it :)

lehic avatar Feb 27 '24 12:02 lehic

with a fastapi middleware as interceptor may be it can be done.

puppetm4st3r avatar Mar 15 '24 22:03 puppetm4st3r

In case you haven't seen it, there's a potential solution for this here:

https://github.com/Chainlit/chainlit/issues/144#issuecomment-2071954807

nmstoker avatar May 28 '24 12:05 nmstoker

For posterity, there's a better solution in the same thread here: https://github.com/Chainlit/chainlit/issues/144#issuecomment-2227543547

Hritik14 avatar Mar 17 '25 17:03 Hritik14