chainlit icon indicating copy to clipboard operation
chainlit copied to clipboard

Make full Request object available in chat

Open dokterbob opened this issue 1 year ago • 20 comments
trafficstars

Is your feature request related to a problem? This would address, in one go: https://github.com/Chainlit/chainlit/issues/393 https://github.com/Chainlit/chainlit/issues/144 https://github.com/Chainlit/chainlit/issues/964 https://github.com/Chainlit/chainlit/pull/1002 https://github.com/Chainlit/chainlit/issues/1103 https://github.com/Chainlit/chainlit/issues/1140

It might also work towards solving: https://github.com/Chainlit/chainlit/pull/1056

  • It should allow devs to put whatever request data they need in user_session.
  • It allows using query parameters, cookies and arbitrary HTTP headers.
  • We might be able to deprecate things like languages and other headers copied in verbatim.

Describe the solution you'd like Accept request : [starlette.requests.Request](https://www.starlette.io/requests/) as an optional parameter to on_chat_start().

Describe alternatives you've considered See issues/PR above. The proposed solution is more generic, requires less maintenance (e.g. no specific support for various use cases required).

Open question: are there any reasons (security or otherwise) not to do this?

dokterbob avatar Aug 14 '24 12:08 dokterbob