pub struct Slot {
pub name: String,
pub prompt: String,
pub kind: SlotKind,
pub constraints: Option<SlotConstraints>,
pub required: bool,
pub default: Option<String>,
pub temperature: Option<f32>,
}Expand description
Represents a slot in a template where code can be injected.
Fields§
§name: StringUnique identifier for this slot.
prompt: StringThe prompt or instruction for AI to generate code.
kind: SlotKindType of slot (determines generation behavior).
constraints: Option<SlotConstraints>Optional constraints on generated code.
required: boolWhether this slot is required.
default: Option<String>Default value if AI generation fails.
temperature: Option<f32>Specific temperature override for this slot (0.0 - 2.0).
Implementations§
Source§impl Slot
impl Slot
Sourcepub fn with_temperature(self, temp: f32) -> Self
pub fn with_temperature(self, temp: f32) -> Self
Set a specific temperature for this slot.
Sourcepub fn with_constraints(self, constraints: SlotConstraints) -> Self
pub fn with_constraints(self, constraints: SlotConstraints) -> Self
Set constraints on the generated code.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Slot
impl<'de> Deserialize<'de> for Slot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Slot
impl RefUnwindSafe for Slot
impl Send for Slot
impl Sync for Slot
impl Unpin for Slot
impl UnwindSafe for Slot
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more