Open pamelafox opened 2 days ago
@pamelafox - The absence of tutorials or documentation at prompty.ai or in their GitHub repo has made it challenging to implement the desired prompt management structure using Prompty at this time.
@jeannotdamoiseaux Agreed, they need additional documentation about the format of the prompt itself (the Jinja2 part, under the YAML). I've passed the feedback onto the Prompty creators.
Purpose
This is an experimental PR to see what it looks like to use Prompty (https://prompty.ai/) to store prompts.
The benefit:
You can see much more of the prompt in one place. You can even theoretically use the VS Code Prompty extension to play with the prompts, and I think that Azure AI Studio will have some support for Prompty files as well now or in the future.
The drawback:
We have to pull messages back out of the rendered prompt, as we then send them to the message builder function to decide how much will fit inside our context window. That's a bit awkward as it involves assuming that [0] is system, [-1] is most recent user message, and [1:-1] are the few shots. I could have also put the chat history in the prompt, but then I couldn't distinguish between few shots and user messages, and I currently treat them differently when truncating conversation history.
Does this introduce a breaking change?
When developers merge from main and run the server, azd up, or azd deploy, will this produce an error? If you're not sure, try it out on an old environment.
Does this require changes to learn.microsoft.com docs?
This repository is referenced by this tutorial which includes deployment, settings and usage instructions. If text or screenshot need to change in the tutorial, check the box below and notify the tutorial author. A Microsoft employee can do this for you if you're an external contributor.
Type of change
Code quality checklist
See CONTRIBUTING.md for more details.
python -m pytest
).python -m pytest --cov
to verify 100% coverage of added linespython -m mypy
to check for type errorsruff
andblack
manually on my code.