pub enum PromptSource {
Text {
text: String,
},
File {
path: ResourcePath,
optional: bool,
},
Glob {
pattern: ResourcePath,
optional: bool,
},
}Expand description
Authored description of a prompt source — text, a file path, or a glob pattern.
Used by configuration layers to declare prompts before resolution. Convert into
runtime Prompt values with Prompt::from_sources.
Variants§
Implementations§
Source§impl PromptSource
impl PromptSource
pub fn file(path: impl Into<ResourcePath>) -> PromptSource
pub fn glob(pattern: impl Into<ResourcePath>) -> PromptSource
pub fn optional(self) -> PromptSource
pub fn is_optional(&self) -> bool
Trait Implementations§
Source§impl Clone for PromptSource
impl Clone for PromptSource
Source§fn clone(&self) -> PromptSource
fn clone(&self) -> PromptSource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PromptSource
impl Debug for PromptSource
Source§impl<'de> Deserialize<'de> for PromptSource
impl<'de> Deserialize<'de> for PromptSource
Source§fn deserialize<T>(
deserializer: T,
) -> Result<PromptSource, <T as Deserializer<'de>>::Error>where
T: Deserializer<'de>,
fn deserialize<T>(
deserializer: T,
) -> Result<PromptSource, <T as Deserializer<'de>>::Error>where
T: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&str> for PromptSource
impl From<&str> for PromptSource
Source§fn from(value: &str) -> PromptSource
fn from(value: &str) -> PromptSource
Converts to this type from the input type.
Source§impl From<PromptSourceObject> for PromptSource
impl From<PromptSourceObject> for PromptSource
Source§fn from(object: PromptSourceObject) -> PromptSource
fn from(object: PromptSourceObject) -> PromptSource
Converts to this type from the input type.
Source§impl From<String> for PromptSource
impl From<String> for PromptSource
Source§fn from(value: String) -> PromptSource
fn from(value: String) -> PromptSource
Converts to this type from the input type.
Source§impl JsonSchema for PromptSource
impl JsonSchema for PromptSource
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for PromptSource
impl PartialEq for PromptSource
Source§fn eq(&self, other: &PromptSource) -> bool
fn eq(&self, other: &PromptSource) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for PromptSource
impl Serialize for PromptSource
Source§fn serialize<T>(
&self,
serializer: T,
) -> Result<<T as Serializer>::Ok, <T as Serializer>::Error>where
T: Serializer,
fn serialize<T>(
&self,
serializer: T,
) -> Result<<T as Serializer>::Ok, <T as Serializer>::Error>where
T: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for PromptSource
impl StructuralPartialEq for PromptSource
Auto Trait Implementations§
impl Freeze for PromptSource
impl RefUnwindSafe for PromptSource
impl Send for PromptSource
impl Sync for PromptSource
impl Unpin for PromptSource
impl UnsafeUnpin for PromptSource
impl UnwindSafe for PromptSource
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.