pub struct GenerationParameters {
pub model: Option<String>,
pub prompt_template_id: Option<String>,
pub custom_prompt_template: Option<String>,
pub max_tokens: Option<u64>,
pub model_parameters: Option<Map<String, Value>>,
pub prompt_parameters: Option<Value>,
}
Expand description
Parameters used for generation via core service.
Can be saved in a preset and/or directly provided within the GenerationRequest
.
Fields§
§model: Option<String>
The id of the language model.
The format of the id is <backend name>/<model provider name>/<model name>
.
prompt_template_id: Option<String>
An optional id for a saved prompt template to use.
custom_prompt_template: Option<String>
Optional text for a custom prompt template. If this is defined
while prompt_template_id
is defined, then prompt_template_id
is ignored.
max_tokens: Option<u64>
Maximum amount of tokens to generate.
model_parameters: Option<Map<String, Value>>
Optional parameters for the model itself. i.e. temperature
, top_p
, etc.
prompt_parameters: Option<Value>
Parameters for the prompt template.
Trait Implementations§
Source§impl Clone for GenerationParameters
impl Clone for GenerationParameters
Source§fn clone(&self) -> GenerationParameters
fn clone(&self) -> GenerationParameters
Returns a copy of the value. Read more
1.0.0 · 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 GenerationParameters
impl Debug for GenerationParameters
Source§impl Default for GenerationParameters
impl Default for GenerationParameters
Source§fn default() -> GenerationParameters
fn default() -> GenerationParameters
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for GenerationParameters
impl<'de> Deserialize<'de> for GenerationParameters
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 GenerationParameters
impl RefUnwindSafe for GenerationParameters
impl Send for GenerationParameters
impl Sync for GenerationParameters
impl Unpin for GenerationParameters
impl UnwindSafe for GenerationParameters
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