chainlit icon indicating copy to clipboard operation
chainlit copied to clipboard

Add initial prompt (prefill chat input)

Open niutech opened this issue 3 weeks ago • 2 comments
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}));

niutech avatar Oct 29 '25 21:10 niutech