chainlit
chainlit copied to clipboard
Add initial prompt (prefill chat input)
trafficstars
Is your feature request related to a problem? Please describe. I'd like to share a link to my Chainlit app having a pre-populated chat input with an initial prompt, e.g. https://bielikchat.pl/?q=Serwus
Describe the solution you'd like
I'd like Chainlit to allow me to pass an initial prompt as a request query, e.g. q={prompt}.
Describe alternatives you've considered Now I need to hack it using a custom JS script like:
const value = 'My prompt';
const input = document.getElementById('chat-input');
Object.getOwnPropertyDescriptor(Object.getPrototypeOf(input), 'value').set.call(input, value);
input.dispatchEvent(new Event('input', {bubbles: true}));