Chainlit / chainlit

Build Conversational AI in minutes ⚡️
https://docs.chainlit.io
Apache License 2.0
6.1k stars 777 forks source link

How to read URL parameters? #774

Open palmentropyc opened 4 months ago

palmentropyc commented 4 months ago

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!

lehic commented 4 months ago

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 :)

puppetm4st3r commented 3 months ago

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

nmstoker commented 1 month ago

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

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