is there a way to generate responses through code?
Is your feature request related to a problem? Please describe. First of all Happy CNY 😀 I would like to use this tool to generate responses for a list of prompts. The prompts all have the same structure, and they are basically asking the LLM to perform classification. Through the webUI, this cannot be automated (at least not easily).
Describe the solution you'd like I was wondering if there are APIs already in the repo that allow for this. I see that the webUI uses streamlit's cache_resource to maintain states? I'm not too familiar with streamlit. If not, then I need to implement myself; I wanted to make sure before I do so.
Hi there!
The web UI does not currently support custom prompts. If you want to use the workflow directly, it might meet your needs. For example, the VanillaRAG class allows you to pass in a prompt parameter during initialization and querying. You can find the relevant code here:
https://github.com/OpenBMB/UltraRAG/blob/bb833e493a851d5d102213620ea466c17daa9ca5/ultrarag/workflow/ultraragflow/simple_flow.py#L18
https://github.com/OpenBMB/UltraRAG/blob/bb833e493a851d5d102213620ea466c17daa9ca5/ultrarag/workflow/ultraragflow/simple_flow.py#L61
Best regards!
@gdw439 got it, thank you for your response!
You can also use the "Evaluation" module of the WebUI. You need to construct prompts into the corresponding format {"id": 0, "query": "xxx", "answer": "xxx", "prediction": "xxxyyy", "instruction":"this is optional key"}