Skip to main content

CreateAssistantRequest

Struct CreateAssistantRequest 

Source
pub struct CreateAssistantRequest {
    pub model: String,
    pub name: Option<String>,
    pub description: Option<String>,
    pub instructions: Option<String>,
    pub tools: Option<Vec<AssistantTools>>,
    pub tool_resources: Option<CreateAssistantToolResources>,
    pub metadata: Option<HashMap<String, String>>,
    pub temperature: Option<f32>,
    pub top_p: Option<f32>,
    pub response_format: Option<AssistantsApiResponseFormatOption>,
}
๐Ÿ‘ŽDeprecated: Assistants API is deprecated and will be removed in August 2026. Use the Responses API.
Available on crate feature assistant-types only.

Fieldsยง

ยงmodel: String
๐Ÿ‘ŽDeprecated: Assistants API is deprecated and will be removed in August 2026. Use the Responses API.

ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.

ยงname: Option<String>
๐Ÿ‘ŽDeprecated: Assistants API is deprecated and will be removed in August 2026. Use the Responses API.

The name of the assistant. The maximum length is 256 characters.

ยงdescription: Option<String>
๐Ÿ‘ŽDeprecated: Assistants API is deprecated and will be removed in August 2026. Use the Responses API.

The description of the assistant. The maximum length is 512 characters.

ยงinstructions: Option<String>
๐Ÿ‘ŽDeprecated: Assistants API is deprecated and will be removed in August 2026. Use the Responses API.

The system instructions that the assistant uses. The maximum length is 256,000 characters.

ยงtools: Option<Vec<AssistantTools>>
๐Ÿ‘ŽDeprecated: Assistants API is deprecated and will be removed in August 2026. Use the Responses API.

A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types code_interpreter, file_search, or function.

ยงtool_resources: Option<CreateAssistantToolResources>
๐Ÿ‘ŽDeprecated: Assistants API is deprecated and will be removed in August 2026. Use the Responses API.

A set of resources that are used by the assistantโ€™s tools. The resources are specific to the type of tool. For example, the code_interpreter tool requires a list of file IDs, while the file_search tool requires a list of vector store IDs.

ยงmetadata: Option<HashMap<String, String>>
๐Ÿ‘ŽDeprecated: Assistants API is deprecated and will be removed in August 2026. Use the Responses API.

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.

ยงtemperature: Option<f32>
๐Ÿ‘ŽDeprecated: Assistants API is deprecated and will be removed in August 2026. Use the Responses API.

What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

ยงtop_p: Option<f32>
๐Ÿ‘ŽDeprecated: Assistants API is deprecated and will be removed in August 2026. Use the Responses API.

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

We generally recommend altering this or temperature but not both.

ยงresponse_format: Option<AssistantsApiResponseFormatOption>
๐Ÿ‘ŽDeprecated: Assistants API is deprecated and will be removed in August 2026. Use the Responses API.

Trait Implementationsยง

Sourceยง

impl Clone for CreateAssistantRequest

Sourceยง

fn clone(&self) -> CreateAssistantRequest

Returns a duplicate of the value. Read more
1.0.0 ยท Sourceยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Sourceยง

impl Debug for CreateAssistantRequest

Sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Sourceยง

impl Default for CreateAssistantRequest

Sourceยง

fn default() -> CreateAssistantRequest

Returns the โ€œdefault valueโ€ for a type. Read more
Sourceยง

impl<'de> Deserialize<'de> for CreateAssistantRequest

Sourceยง

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 PartialEq for CreateAssistantRequest

Sourceยง

fn eq(&self, other: &CreateAssistantRequest) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 ยท Sourceยง

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Sourceยง

impl Serialize for CreateAssistantRequest

Sourceยง

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Sourceยง

impl StructuralPartialEq for CreateAssistantRequest

Auto Trait Implementationsยง

Blanket Implementationsยง

Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Sourceยง

impl<T> CloneToUninit for T
where T: Clone,

Sourceยง

unsafe fn clone_to_uninit(&self, dest: *mut u8)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T> Instrument for T

Sourceยง

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Sourceยง

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<T> PolicyExt for T
where T: ?Sized,

Sourceยง

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Sourceยง

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Sourceยง

impl<T> Same for T

Sourceยง

type Output = T

Should always be Self
Sourceยง

impl<T> ToOwned for T
where T: Clone,

Sourceยง

type Owned = T

The resulting type after obtaining ownership.
Sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Sourceยง

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Sourceยง

fn vzip(self) -> V

Sourceยง

impl<T> WithSubscriber for T

Sourceยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Sourceยง

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Sourceยง

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Sourceยง

impl<T> ErasedDestructor for T
where T: 'static,

Sourceยง

impl<T> MaybeSendSync for T