Make slash commands defined in extensions return SlashCommandOutput
(#13237)
This PR extends the interface for slash commands defined in extensions to have them return `SlashCommandOutput`. This allows for slash commands to return multiple output sections for a single piece of generated text. Note that we don't allow specifying the icon to display in the placeholder, as we don't want to commit to that in our API at the moment. Release Notes: - N/A
This commit is contained in:
parent
ca18549e02
commit
ad4e52842c
8 changed files with 73 additions and 38 deletions
|
@ -1,4 +1,6 @@
|
|||
interface slash-command {
|
||||
use common.{range};
|
||||
|
||||
/// A slash command for use in the Assistant.
|
||||
record slash-command {
|
||||
/// The name of the slash command.
|
||||
|
@ -10,4 +12,20 @@ interface slash-command {
|
|||
/// Whether this slash command requires an argument.
|
||||
requires-argument: bool,
|
||||
}
|
||||
|
||||
/// The output of a slash command.
|
||||
record slash-command-output {
|
||||
/// The text produced by the slash command.
|
||||
text: string,
|
||||
/// The list of sections to show in the slash command placeholder.
|
||||
sections: list<slash-command-output-section>,
|
||||
}
|
||||
|
||||
/// A section in the slash command output.
|
||||
record slash-command-output-section {
|
||||
/// The range this section occupies.
|
||||
range: range,
|
||||
/// The label to display in the placeholder for this section.
|
||||
label: string,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue