Are there any way to provide Few-shot prompt in Prompty?
I want to express Few-shot prompting in prompty file. I think it can be achieved if I could write like the following Prompty format, but it seems that the 'assistant' role is not supported in Prompty. Are there any way to provide few-shot in Prompty file or any schedule that implement assistant role in Prompty?
---
metadata omitted
sample:
question: What is Prompty?
---
system:
You are an AI assistant.
user:
[Few-shot user question]
assistant:
[Few-shot AI answer]
user:
{{question}}
I see this working properly on the VS extension, and inspecting the python code, it seems it should work as well.
What is not working is the "highlight" in the VS extension for the role assistant, but it still works.
@injeniero Thank you for your great information. As you said, I assumed it was not supported because the assistant role was not highlighted in VS Code. But it was indeed accomplished. I hope this fact reflect to VS code extension (Highlight feature) and sample code in document of Prompty :)
system:
You are an AI assistant supporting a user named "{{userName}}".
user:
Hello
assistant:
Hi
user:
{{question}}
prompt = prompty.load("./basic.prompty")
print(prompty.prepare(prompt, {"userName": "John", "question":"What's up?"}))
[
{'role': 'system', 'content': 'You are an AI assistant supporting a user named "John".'},
{'role': 'user', 'content': 'Hello'},
{'role': 'assistant', 'content': 'Hi'},
{'role': 'user', 'content': "What's up?"}
]
VS code view (only assistant role has not highlighted)
Looks like an extension issue. Will tag this as an extension bug.