azure-search-openai-demo
azure-search-openai-demo copied to clipboard
Edit prompt template
Could you please add a quick example how to replace the prompt template?
look into app/backend/approaches for each approach you have prompt
example for chatreadretrieveread.py
completion = openai.Completion.create( engine=self.chatgpt_deployment, prompt=prompt, temperature=overrides.get("temperature") or 0.7, max_tokens=1024, n=1, stop=["<|im_end|>", "<|im_start|>"])
Thanks @itmilos, yeah already tweaked the chatreadretrieveread.py for my demos and presentations. Makes sense. However, there's this "developer's settings" section, where you can override the prompt template within the application. All my approaches didn't work, so I too went the way like you suggested and edited the code and then re-deployed the application.
@anderl80 here you can take this PR as example https://github.com/Azure-Samples/azure-search-openai-demo/pull/54 and use it to reproduce for other settings
also there is Override prompt template in latest version so you can sync with main on this repo
There was an issue with the UI for overriding the prompt which I just fixed and merged in pr #606 so you can change temporarily there, or change permanently in the approaches files.