pub struct BasicPrimitiveWorkflow<P> {
pub primitive: P,
pub base_req: CompletionRequest,
pub result_can_be_none: bool,
pub instruct_prompt: InstructPrompt,
}Fields§
§primitive: P§base_req: CompletionRequest§result_can_be_none: bool§instruct_prompt: InstructPromptImplementations§
Source§impl<P: PrimitiveTrait> BasicPrimitiveWorkflow<P>
impl<P: PrimitiveTrait> BasicPrimitiveWorkflow<P>
pub fn new(backend: Arc<LLMBackend>) -> Self
pub async fn return_primitive(&mut self) -> Result<P::PrimitiveResult>
pub async fn return_optional_primitive( &mut self, ) -> Result<Option<P::PrimitiveResult>>
pub async fn return_result(&mut self) -> Result<BasicPrimitiveResult>
pub async fn return_optional_result(&mut self) -> Result<BasicPrimitiveResult>
Trait Implementations§
Source§impl<P: PrimitiveTrait> InstructPromptTrait for BasicPrimitiveWorkflow<P>
impl<P: PrimitiveTrait> InstructPromptTrait for BasicPrimitiveWorkflow<P>
fn instruct_prompt_mut(&mut self) -> &mut InstructPrompt
fn set_instructions<T: AsRef<str>>(&mut self, instructions: T) -> &mut Self
fn instructions(&mut self) -> &mut PromptMessage
fn set_supporting_material<T: AsRef<str>>( &mut self, supporting_material: T, ) -> &mut Self
fn supporting_material(&mut self) -> &mut PromptMessage
Source§impl<P: PrimitiveTrait> RequestConfigTrait for BasicPrimitiveWorkflow<P>
impl<P: PrimitiveTrait> RequestConfigTrait for BasicPrimitiveWorkflow<P>
fn config(&mut self) -> &mut RequestConfig
fn reset_request(&mut self)
Source§fn max_tokens(&mut self, max_tokens: u64) -> &mut Self
fn max_tokens(&mut self, max_tokens: u64) -> &mut Self
Sets the value of RequestConfig::requested_response_tokens.
Source§fn frequency_penalty(&mut self, frequency_penalty: f32) -> &mut Self
fn frequency_penalty(&mut self, frequency_penalty: f32) -> &mut Self
Sets the value of RequestConfig::frequency_penalty.
Source§fn presence_penalty(&mut self, presence_penalty: f32) -> &mut Self
fn presence_penalty(&mut self, presence_penalty: f32) -> &mut Self
Sets the value of RequestConfig::presence_penalty.
Source§fn temperature(&mut self, temperature: f32) -> &mut Self
fn temperature(&mut self, temperature: f32) -> &mut Self
Sets the value of RequestConfig::temperature.
Source§fn top_p(&mut self, top_p: f32) -> &mut Self
fn top_p(&mut self, top_p: f32) -> &mut Self
Sets the value of RequestConfig::top_p.
Source§fn retry_after_fail_n_times(
&mut self,
retry_after_fail_n_times: u8,
) -> &mut Self
fn retry_after_fail_n_times( &mut self, retry_after_fail_n_times: u8, ) -> &mut Self
Sets the value of RequestConfig::retry_after_fail_n_times.
Source§fn increase_limit_on_fail(&mut self, increase_limit_on_fail: bool) -> &mut Self
fn increase_limit_on_fail(&mut self, increase_limit_on_fail: bool) -> &mut Self
Sets the value of RequestConfig::increase_limit_on_fail.
Source§fn cache_prompt(&mut self, cache_prompt: bool) -> &mut Self
fn cache_prompt(&mut self, cache_prompt: bool) -> &mut Self
Sets the value of RequestConfig::cache_prompt.
Auto Trait Implementations§
impl<P> !Freeze for BasicPrimitiveWorkflow<P>
impl<P> !RefUnwindSafe for BasicPrimitiveWorkflow<P>
impl<P> Send for BasicPrimitiveWorkflow<P>where
P: Send,
impl<P> Sync for BasicPrimitiveWorkflow<P>where
P: Sync,
impl<P> Unpin for BasicPrimitiveWorkflow<P>where
P: Unpin,
impl<P> !UnwindSafe for BasicPrimitiveWorkflow<P>
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> 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