pub struct ResponsesResource { /* private fields */ }Expand description
EN: Responses API resource. 中文:Responses API 资源。
Implementations§
Source§impl ResponsesResource
impl ResponsesResource
Sourcepub async fn create(
&self,
request: CreateResponseRequest,
) -> Result<Response, LingerError>
pub async fn create( &self, request: CreateResponseRequest, ) -> Result<Response, LingerError>
EN: Creates a response with POST /v1/responses.
中文:使用 POST /v1/responses 创建响应。
Sourcepub async fn retrieve(&self, response_id: &str) -> Result<Response, LingerError>
pub async fn retrieve(&self, response_id: &str) -> Result<Response, LingerError>
EN: Retrieves a response with GET /v1/responses/{response_id}.
中文:使用 GET /v1/responses/{response_id} 获取响应。
Sourcepub async fn cancel(&self, response_id: &str) -> Result<Response, LingerError>
pub async fn cancel(&self, response_id: &str) -> Result<Response, LingerError>
EN: Cancels an in-progress response with POST /v1/responses/{response_id}/cancel.
中文:使用 POST /v1/responses/{response_id}/cancel 取消进行中的响应。
Sourcepub async fn delete(
&self,
response_id: &str,
) -> Result<ResponseDeletion, LingerError>
pub async fn delete( &self, response_id: &str, ) -> Result<ResponseDeletion, LingerError>
EN: Deletes a response with DELETE /v1/responses/{response_id}.
中文:使用 DELETE /v1/responses/{response_id} 删除响应。
Sourcepub async fn list_input_items(
&self,
response_id: &str,
) -> Result<ResponseInputItemsPage, LingerError>
pub async fn list_input_items( &self, response_id: &str, ) -> Result<ResponseInputItemsPage, LingerError>
EN: Lists input items with GET /v1/responses/{response_id}/input_items.
中文:使用 GET /v1/responses/{response_id}/input_items 列出输入项。
Sourcepub async fn count_input_tokens(
&self,
request: CreateResponseInputTokensRequest,
) -> Result<ResponseInputTokens, LingerError>
pub async fn count_input_tokens( &self, request: CreateResponseInputTokensRequest, ) -> Result<ResponseInputTokens, LingerError>
EN: Counts input tokens with POST /v1/responses/input_tokens.
中文:使用 POST /v1/responses/input_tokens 统计输入 token。
Sourcepub async fn compact(
&self,
request: CompactResponseRequest,
) -> Result<ResponseCompaction, LingerError>
pub async fn compact( &self, request: CompactResponseRequest, ) -> Result<ResponseCompaction, LingerError>
EN: Compacts response context with POST /v1/responses/compact.
中文:使用 POST /v1/responses/compact 压缩响应上下文。
Sourcepub async fn create_stream(
&self,
request: CreateResponseRequest,
) -> Result<ResponseStream, LingerError>
pub async fn create_stream( &self, request: CreateResponseRequest, ) -> Result<ResponseStream, LingerError>
EN: Creates a streaming response with POST /v1/responses.
中文:使用 POST /v1/responses 创建流式响应。
Trait Implementations§
Source§impl Clone for ResponsesResource
impl Clone for ResponsesResource
Source§fn clone(&self) -> ResponsesResource
fn clone(&self) -> ResponsesResource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more