pub struct ResponseStreamRequestBuilder { /* private fields */ }Expand description
表示 Responses 流式构建器。
Implementations§
Source§impl ResponseStreamRequestBuilder
impl ResponseStreamRequestBuilder
Sourcepub fn input_text(self, input: impl Into<String>) -> Self
pub fn input_text(self, input: impl Into<String>) -> Self
设置输入文本。
Sourcepub fn input_items(self, items: Vec<ResponseInputItemPayload>) -> Self
pub fn input_items(self, items: Vec<ResponseInputItemPayload>) -> Self
设置输入项数组。
Sourcepub fn input(self, input: impl Into<ResponseInputPayload>) -> Self
pub fn input(self, input: impl Into<ResponseInputPayload>) -> Self
直接设置输入载荷。
Sourcepub fn temperature(self, temperature: f32) -> Self
pub fn temperature(self, temperature: f32) -> Self
设置温度。
Sourcepub fn tool(self, tool: ChatToolDefinition) -> Self
pub fn tool(self, tool: ChatToolDefinition) -> 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
添加请求体字段。
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 选项。
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 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 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 fn response_id(self, response_id: impl Into<String>) -> Self
pub fn response_id(self, response_id: impl Into<String>) -> Self
按响应 ID 继续一个已有的 Responses SSE 流。
Sourcepub fn starting_after(self, sequence_number: u64) -> Self
pub fn starting_after(self, sequence_number: u64) -> Self
当继续已有流时,只消费给定序号之后的事件。
Sourcepub async fn send(self) -> Result<ResponseStream>
pub async fn send(self) -> Result<ResponseStream>
Sourcepub async fn send_events(self) -> Result<ResponseEventStream>
pub async fn send_events(self) -> Result<ResponseEventStream>
Trait Implementations§
Source§impl Clone for ResponseStreamRequestBuilder
impl Clone for ResponseStreamRequestBuilder
Source§fn clone(&self) -> ResponseStreamRequestBuilder
fn clone(&self) -> ResponseStreamRequestBuilder
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 ResponseStreamRequestBuilder
impl !RefUnwindSafe for ResponseStreamRequestBuilder
impl Send for ResponseStreamRequestBuilder
impl Sync for ResponseStreamRequestBuilder
impl Unpin for ResponseStreamRequestBuilder
impl UnsafeUnpin for ResponseStreamRequestBuilder
impl !UnwindSafe for ResponseStreamRequestBuilder
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