Inject stuff in @BrowserCallable methods?

Hi all,
I’m playing around with @secure-leopard s demo on Spring Boot, Hilla, React and langchain4j. Great fun! Started back in Antwerpen/devoxx, thanks for the t-shirt!
Now I somehow need to get an id for a client to use as memoryId when accessing the langchain4j memory module. I’m brand new to Hilla, is it possible to inject something like a sessionid, http-request or something like that as method argument in an Endpoint annotaded class? Br, Svante

You’ll want to use something besides session id, as a user may want to have multiple chats during a single session. Since Hilla apps run in the browser, you can do something like generate a UUID on the client and pass it to the server along with the request, as I did here java-ai-playground/src/main/java/com/example/application/client/ at 8d8b510d120b68839b98f252f8a0445a2a34486d · marcushellberg/java-ai-playground · GitHub

The implementation I have there is a bit lazy as I only generate a single id for the view java-ai-playground/frontend/App.tsx at 8d8b510d120b68839b98f252f8a0445a2a34486d · marcushellberg/java-ai-playground · GitHub

Would be better to have a way to reset the chat and id

Oj! Impressiv response time @secure-leopard , thanks! Multiple tabs, of course, didn’t think of that. I will try your uuid-approach!