quivr
quivr copied to clipboard
[Prompt Customization] AAUser, I can set my brain's prompt
The user with Edit rights on the brain can edit the prompt.
Have a base level prompt ; 'This is the user's prompt, take that into consideration' Inject the input user's prompt.
Next:
Have two types of prompts: 'QuestionPromopt' -> How to proceede about getting the question 'AnswerPrompt' -> How you answer the question (in which style)
Ability to share prompts
can i work on it
Sure @shivvamm,I was planning on starting this in 2 weeks but it would be great to have your contribution. The idea is to have in the frontend, a prompt text area where the user can enter his own personal prompt instead of the one that is currently injected in the backend. A custom prompt should be attached to a brain Entity. You will need to update the brains table too. Feel free to ping me if you want to discuss the tech strategy before starting working on it.
Yes aure i want to know about the details to approach this
Hi @gozineb , thank you for including me in this project. I'm excited to contribute! Before I start working on it, I would appreciate a follow-up discussion to clarify a few details and understand the tech strategy better. Could you please provide more information on how the frontend and backend are currently structured? Additionally, it would be helpful to know what technologies and frameworks are being used. This will allow me to plan my approach accordingly. Once I have a better understanding, I'll be ready to start working on implementing the feature. Please let me know how and when we can schedule a discussion. Thank you!
Hi @shivvamm, thanks for your interesting in the project:
- Backend: fastapi + python + supabase (SQL)
- [] Custom prompts should be stored in the brain table: you would need to update the tables.sql and add a migration to include this new column
- [] add an endpoint to add/update the custom prompt in the brain : Post on /brain -> see 'router' and 'api' folder in backend
- [] add tests
- [] add the custom prompt when the question is asked: question_generator in QABaseBrainPicking and _construct_prompt in OpenAIFunctionsBrainPicking
- Fronted: next + react in typescript
- [] Add an area where prompt can be customized in front -> You could do that in the settings for now for example
- [] Use the activeBrain to call endpoint to update prompt
- [] Add tests to your new components.
You can look take a look at how to contribute in the docs. We haven't fully detailed the backend and frontend architectures as it is still an on going work. Will get to that ASAP.
Don't hesitate to dive into the codebase & put your technical strategy here (even with your gray areas) and I will take the time to review it before you start :)
sure @gozineb :)
想用中文回答问题,如何设置prompt模板?
Hi.
Just wanted to respond in order to show my support for this feature. I'm looking forward to this!
Hi @shivvamm. have you started working on this ? If not, will be starting on this next week !
Hey @gozineb I was going to start I was just thinking we have to separate the prompt make it a global entity and then edit it
@gozineb I'll push the changes till tomorrow
Hi @shivvamm, @mamadoudicko will start working on this today. Have you been able to push your PR ?
Hi @shivvamm, @mamadoudicko will start working on this today. Have you been able to push your PR ?
Not yet you can work on it I'm still figuring out but thanks for giving me a chance
Hi, I think it has been added to main branch. I tried it, but seems like it doesn't work well. Can I increase weightage to this prompt? If I use system prompt standalone to openAI API, it works differently.
Hi @kunalgoyal9, feel free to creatre an issue with the proposed change ! Thank you for your interest 😀 I will be closing this one as it is done.
Thanks to all who worked on this. Much appreciated.