pub struct Completion {
pub model: String,
pub prompt: Message,
pub preamble: Option<String>,
pub history: Vec<Message>,
pub tools: Vec<ToolDefinition>,
pub tool_choice: Option<ToolChoice>,
pub max_tokens: Option<u64>,
pub additional_params: Option<Value>,
}Fields§
§model: String§prompt: Message§preamble: Option<String>§history: Vec<Message>§tools: Vec<ToolDefinition>§tool_choice: Option<ToolChoice>§max_tokens: Option<u64>§additional_params: Option<Value>Implementations§
Source§impl Completion
impl Completion
pub fn preamble(self, preamble: impl Into<String>) -> Self
pub fn tools(self, tools: Vec<ToolDefinition>) -> Self
pub fn history(self, history: Vec<Message>) -> Self
pub fn max_tokens(self, max_tokens: u64) -> Self
pub fn additional_params(self, additional_params: Value) -> Self
Trait Implementations§
Source§impl Clone for Completion
impl Clone for Completion
Source§impl Debug for Completion
impl Debug for Completion
Source§impl<'de> Deserialize<'de> for Completion
impl<'de> Deserialize<'de> for Completion
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
Source§impl From<Completion> for CompletionRequest
impl From<Completion> for CompletionRequest
Source§fn from(value: Completion) -> Self
fn from(value: Completion) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Forget for Completion
impl Freeze for Completionwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<UserContent>: Freeze,
PhantomData<AssistantContent>: Freeze,
&'static str: Freeze,
String: Freeze,
PhantomData<Message>: Freeze,
PhantomData<ToolDefinition>: Freeze,
PhantomData<ToolName>: Freeze,
PhantomData<Value>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<Bucket<String, Value>>: Freeze,
impl Move for Completion
impl RefUnwindSafe for Completionwhere
String: RefUnwindSafe,
impl Send for Completion
impl Sync for Completion
impl Unpin for Completion
impl UnsafeUnpin for Completionwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<UserContent>: UnsafeUnpin,
PhantomData<AssistantContent>: UnsafeUnpin,
&'static str: UnsafeUnpin,
String: UnsafeUnpin,
PhantomData<Message>: UnsafeUnpin,
PhantomData<ToolDefinition>: UnsafeUnpin,
PhantomData<ToolName>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Bucket<String, Value>>: UnsafeUnpin,
impl UnwindSafe for Completionwhere
RawVecInner: UnwindSafe,
NonNull<u8>: UnwindSafe,
&'static str: UnwindSafe,
String: UnwindSafe,
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> IntoToolOutput for Twhere
T: Serialize + 'static,
impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
Source§fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
Convert this value without routing structured data through a string.