ScottLogic / prompt-injection

Application which investigates defensive measures against prompt injection attacks on an LLM, with a focus on the exposure of external tools.
MIT License
13 stars 9 forks source link

Streamline network call for user avatar #826

Open pmarsh-scottlogic opened 5 months ago

pmarsh-scottlogic commented 5 months ago

If sending a message causes the use avatar to appear in the chat for the first time (even since resetting), we see a new network call to get the avatar assets/UserAvatar-b2331cdf.svg.

🔧 Could stop this? Cache it in the frontend somewhere? Presumably it's already being cached somehow because it doesn't get loaded for subsequent chat messages.

To replicate, open up the network tab in devtools. Send a message in a level. Observe the network call. Reset the level so that all messages are cleared. Send another message. Observe the new network call. Change to a different level that has a clear chat history. Send a message. Observe a further network call. All seems a bit wasteful to me.