Prompt library updates (#11988)
Restructure prompts & the prompt library. - Prompts are now written in markdown - The prompt manager has a picker and editable prompts - Saving isn't wired up yet - This also removes the "Insert active prompt" button as this concept doesn't exist anymore, and will be replaced with slash commands. I didn't staff flag this, but if you do play around with it expect it to still be pretty rough. Release Notes: - N/A --------- Co-authored-by: Nathan Sobo <1789+nathansobo@users.noreply.github.com> Co-authored-by: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
parent
a73a3ef243
commit
0a848f29e8
14 changed files with 964 additions and 679 deletions
|
@ -41,6 +41,25 @@ pub trait FluentBuilder {
|
|||
})
|
||||
}
|
||||
|
||||
/// Conditionally unwrap and modify self with one closure if the given option is Some, or another if it is None.
|
||||
fn when_some_else<T>(
|
||||
self,
|
||||
option: Option<T>,
|
||||
then: impl FnOnce(Self, T) -> Self,
|
||||
otherwise: impl FnOnce(Self) -> Self,
|
||||
) -> Self
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
self.map(|this| {
|
||||
if let Some(value) = option {
|
||||
then(this, value)
|
||||
} else {
|
||||
otherwise(this)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/// Conditionally modify self with one closure or another
|
||||
fn when_else(
|
||||
self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue