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>,
pub model: Option<String>,
pub max_tokens: Option<u32>,
}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).
model: Option<String>Specific model override for this slot (e.g., “gpt-4o”).
max_tokens: Option<u32>Maximum tokens to generate for this slot.
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_model(self, model: impl Into<String>) -> Self
pub fn with_model(self, model: impl Into<String>) -> Self
Set model override for this slot.
Sourcepub fn with_max_tokens(self, max_tokens: u32) -> Self
pub fn with_max_tokens(self, max_tokens: u32) -> Self
Set maximum tokens 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
impl Eq for Slot
impl StructuralPartialEq for Slot
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<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.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