pub struct SampleRequest {Show 13 fields
pub prompts: Vec<String>,
pub model: String,
pub n: Option<i32>,
pub max_tokens: Option<i32>,
pub seed: Option<i32>,
pub stop: Vec<String>,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub frequency_penalty: Option<f32>,
pub presence_penalty: Option<f32>,
pub logprobs: bool,
pub top_logprobs: Option<i32>,
pub user: Option<String>,
}Expand description
Request for text sampling
Fields§
§prompts: Vec<String>Text prompts to sample from
model: StringModel name
n: Option<i32>Number of completions (1-128)
max_tokens: Option<i32>Maximum tokens to generate
seed: Option<i32>Random seed for determinism
stop: Vec<String>Stop sequences
temperature: Option<f32>Temperature (0-2)
top_p: Option<f32>Top-p sampling
frequency_penalty: Option<f32>Frequency penalty (-2 to 2)
presence_penalty: Option<f32>Presence penalty (-2 to 2)
logprobs: boolReturn log probabilities
top_logprobs: Option<i32>Number of top logprobs (0-8)
user: Option<String>User identifier
Implementations§
Source§impl SampleRequest
impl SampleRequest
Sourcepub fn add_prompt(self, prompt: impl Into<String>) -> Self
pub fn add_prompt(self, prompt: impl Into<String>) -> Self
Add a prompt
Sourcepub fn with_max_tokens(self, max_tokens: i32) -> Self
pub fn with_max_tokens(self, max_tokens: i32) -> Self
Set max tokens
Sourcepub fn with_temperature(self, temperature: f32) -> Self
pub fn with_temperature(self, temperature: f32) -> Self
Set temperature
Trait Implementations§
Source§impl Clone for SampleRequest
impl Clone for SampleRequest
Source§fn clone(&self) -> SampleRequest
fn clone(&self) -> SampleRequest
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for SampleRequest
impl RefUnwindSafe for SampleRequest
impl Send for SampleRequest
impl Sync for SampleRequest
impl Unpin for SampleRequest
impl UnwindSafe for SampleRequest
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request