Struct llmvm_core_lib::prompts::ReadyPrompt
source · pub struct ReadyPrompt {
pub system_prompt: Option<String>,
pub main_prompt: String,
}
Expand description
A prompt that is ready to use for text generation. May contain an optional prompt for the system role.
Fields§
§system_prompt: Option<String>
A system role prompt. For chat generation requests, this will be appended
to the thread_messages
of the backend generation request. For non-chat
generation requests, the system prompt will be prepended to the main prompt.
main_prompt: String
The main prompt. For chat generation requests, this prompt should use the user role.
Implementations§
source§impl ReadyPrompt
impl ReadyPrompt
sourcepub async fn from_stored_template(
template_id: &str,
parameters: &Value,
is_chat_model: bool
) -> Result<Self>
pub async fn from_stored_template( template_id: &str, parameters: &Value, is_chat_model: bool ) -> Result<Self>
Loads a Handlebars prompt template from the current project or user home directory, and generates a full prompt using the given template parameters.
sourcepub fn from_custom_template(
template: &str,
parameters: &Value,
is_chat_model: bool
) -> Result<Self>
pub fn from_custom_template( template: &str, parameters: &Value, is_chat_model: bool ) -> Result<Self>
Generates a full prompt using a Handlebars template and parameters.
sourcepub fn from_custom_prompt(main_prompt: String) -> Self
pub fn from_custom_prompt(main_prompt: String) -> Self
Creates a ReadyPrompt
from a completed prompt.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for ReadyPrompt
impl Send for ReadyPrompt
impl Sync for ReadyPrompt
impl Unpin for ReadyPrompt
impl UnwindSafe for ReadyPrompt
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more