pub struct AssistantStreamRequestBuilder { /* private fields */ }Expand description
表示 Assistants/Beta Threads 流式请求构建器。
Implementations§
Source§impl AssistantStreamRequestBuilder
impl AssistantStreamRequestBuilder
Sourcepub fn body_value(self, body: impl Into<JsonPayload>) -> Self
pub fn body_value(self, body: impl Into<JsonPayload>) -> Self
设置整个请求体为一个 serde_json::Value。
Sourcepub fn extra_header(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn extra_header( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
添加一个额外请求头。
Sourcepub fn remove_header(self, key: impl Into<String>) -> Self
pub fn remove_header(self, key: impl Into<String>) -> Self
删除一个默认请求头。
Sourcepub fn extra_query(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn extra_query( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
添加一个额外查询参数。
Sourcepub fn extra_body(
self,
key: impl Into<String>,
value: impl Into<JsonPayload>,
) -> Self
pub fn extra_body( self, key: impl Into<String>, value: impl Into<JsonPayload>, ) -> Self
在 JSON 根对象中追加字段。
Sourcepub fn provider_option(
self,
key: impl Into<String>,
value: impl Into<JsonPayload>,
) -> Self
pub fn provider_option( self, key: impl Into<String>, value: impl Into<JsonPayload>, ) -> Self
在 provider 对应的 provider_options 下追加字段。
Sourcepub fn max_retries(self, max_retries: u32) -> Self
pub fn max_retries(self, max_retries: u32) -> Self
覆盖最大重试次数。
Sourcepub fn cancellation_token(self, token: CancellationToken) -> Self
pub fn cancellation_token(self, token: CancellationToken) -> Self
设置取消令牌。
Sourcepub async fn send(self) -> Result<AssistantStream>
pub async fn send(self) -> Result<AssistantStream>
Sourcepub async fn send_events(self) -> Result<AssistantEventStream>
pub async fn send_events(self) -> Result<AssistantEventStream>
Trait Implementations§
Source§impl Clone for AssistantStreamRequestBuilder
impl Clone for AssistantStreamRequestBuilder
Source§fn clone(&self) -> AssistantStreamRequestBuilder
fn clone(&self) -> AssistantStreamRequestBuilder
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 AssistantStreamRequestBuilder
impl !RefUnwindSafe for AssistantStreamRequestBuilder
impl Send for AssistantStreamRequestBuilder
impl Sync for AssistantStreamRequestBuilder
impl Unpin for AssistantStreamRequestBuilder
impl UnsafeUnpin for AssistantStreamRequestBuilder
impl !UnwindSafe for AssistantStreamRequestBuilder
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