|
|
@ -46,8 +46,7 @@ impl Role {
|
|
|
|
r#"Provide only {shell} commands for {os} without any description.
|
|
|
|
r#"Provide only {shell} commands for {os} without any description.
|
|
|
|
Ensure the output is a valid {shell} command. {combine}
|
|
|
|
Ensure the output is a valid {shell} command. {combine}
|
|
|
|
If there is a lack of details, provide most logical solution.
|
|
|
|
If there is a lack of details, provide most logical solution.
|
|
|
|
Provide only plain text without Markdown formatting.
|
|
|
|
Output plain text only, without any markdown formatting."#
|
|
|
|
Do not provide markdown formatting such as ```"#
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
temperature: None,
|
|
|
|
temperature: None,
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -68,17 +67,20 @@ APPLY MARKDOWN formatting when possible."#
|
|
|
|
pub fn for_code() -> Self {
|
|
|
|
pub fn for_code() -> Self {
|
|
|
|
Self {
|
|
|
|
Self {
|
|
|
|
name: Self::CODE.into(),
|
|
|
|
name: Self::CODE.into(),
|
|
|
|
prompt: r#"Provide only code as output without any description.
|
|
|
|
prompt: r#"Provide only code, without comments or explanations.
|
|
|
|
Provide only code in plain text format without Markdown formatting.
|
|
|
|
If there is a lack of details, provide most logical solution, without requesting further clarification."#
|
|
|
|
Do not include symbols such as ``` or ```python.
|
|
|
|
|
|
|
|
If there is a lack of details, provide most logical solution.
|
|
|
|
|
|
|
|
You are not allowed to ask for more details.
|
|
|
|
|
|
|
|
For example if the prompt is "Hello world Python", you should return "print('Hello world')"."#
|
|
|
|
|
|
|
|
.into(),
|
|
|
|
.into(),
|
|
|
|
temperature: None,
|
|
|
|
temperature: None,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn is_system(&self) -> bool {
|
|
|
|
|
|
|
|
matches!(
|
|
|
|
|
|
|
|
self.name.as_str(),
|
|
|
|
|
|
|
|
Self::EXECUTE | Self::DESCRIBE_COMMAND | Self::CODE
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn export(&self) -> Result<String> {
|
|
|
|
pub fn export(&self) -> Result<String> {
|
|
|
|
let output = serde_yaml::to_string(&self)
|
|
|
|
let output = serde_yaml::to_string(&self)
|
|
|
|
.with_context(|| format!("Unable to show info about role {}", &self.name))?;
|
|
|
|
.with_context(|| format!("Unable to show info about role {}", &self.name))?;
|
|
|
|