pub struct ZhipuClient { /* private fields */ }Implementations§
Source§impl ZhipuClient
impl ZhipuClient
pub async fn create_knowledge_base( &self, request: &KnowledgeCreateRequest, ) -> Result<KnowledgeCreateResponse>
pub async fn knowledge_bases( &self, page: u32, size: u32, ) -> Result<KnowledgeListResponse>
pub async fn knowledge_base(&self, id: &str) -> Result<KnowledgeDetailResponse>
pub async fn update_knowledge_base( &self, id: &str, request: &KnowledgeUpdateRequest, ) -> Result<RagOperationResponse>
pub async fn delete_knowledge_base( &self, id: &str, ) -> Result<RagOperationResponse>
pub async fn knowledge_capacity(&self) -> Result<KnowledgeCapacityResponse>
pub async fn retrieve_knowledge( &self, request: &KnowledgeRetrieveRequest, ) -> Result<KnowledgeRetrieveResponse>
pub async fn knowledge_documents( &self, query: &DocumentListQuery, ) -> Result<KnowledgeDocumentListResponse>
pub async fn upload_knowledge_document( &self, knowledge_id: &str, request: RagDocumentUpload, ) -> Result<DocumentUploadResponse>
pub async fn upload_knowledge_urls( &self, request: &UrlDocumentUploadRequest, ) -> Result<UrlDocumentUploadResponse>
pub async fn knowledge_document( &self, id: &str, ) -> Result<KnowledgeDocumentResponse>
pub async fn delete_knowledge_document( &self, id: &str, ) -> Result<RagOperationResponse>
pub async fn knowledge_document_images( &self, id: &str, ) -> Result<DocumentImagesResponse>
pub async fn reembed_knowledge_document( &self, id: &str, request: &ReEmbeddingRequest, ) -> Result<RagOperationResponse>
Source§impl ZhipuClient
impl ZhipuClient
pub fn new(api_key: impl Into<String>) -> Result<Self>
pub fn from_config(config: ZhipuConfig) -> Result<Self>
pub fn base_url(&self) -> &str
pub fn agent_base_url(&self) -> &str
pub async fn chat_completion( &self, request: &ChatCompletionRequest, ) -> Result<ChatCompletionResponse>
pub async fn chat_completion_stream( &self, request: &ChatCompletionRequest, ) -> Result<ChatStream>
pub async fn chat_tool_stream( &self, request: &ChatCompletionRequest, ) -> Result<ToolStream>
pub async fn typed_chat_completion<M: ChatModel>( &self, request: &TypedChatRequest<M, Ready>, ) -> Result<ChatCompletionResponse>
pub async fn typed_chat_completion_stream<M: ChatModel>( &self, request: &TypedChatRequest<M, Ready>, ) -> Result<ChatStream>
pub async fn typed_chat_tool_stream<M: SupportsToolStream>( &self, request: &TypedChatRequest<M, Ready>, ) -> Result<ToolStream>
pub async fn glm_4_voice( &self, request: &Glm4VoiceRequest, ) -> Result<ChatCompletionResponse>
pub async fn official_agent( &self, request: &OfficialAgentRequest, ) -> Result<OfficialAgentResponse>
pub async fn official_agent_stream( &self, request: &OfficialAgentRequest, ) -> Result<OfficialAgentStream>
pub async fn official_agent_async_result( &self, request: &AgentAsyncResultRequest, ) -> Result<AgentAsyncResultResponse>
pub async fn official_agent_conversation( &self, request: &AgentConversationRequest, ) -> Result<AgentConversationResponse>
pub async fn retrieval_agent_stream( &self, request: &RetrievalAgentRequest, session_id: Option<&str>, ) -> Result<RetrievalAgentStream>
pub async fn async_chat( &self, request: &ChatCompletionRequest, ) -> Result<AsyncTaskResponse>
pub async fn async_result(&self, id: &str) -> Result<AsyncTaskResult>
pub async fn embedding( &self, request: &EmbeddingRequest, ) -> Result<EmbeddingResponse>
pub async fn rerank(&self, request: &RerankRequest) -> Result<RerankResponse>
pub async fn tokenizer( &self, request: &TokenizerRequest, ) -> Result<TokenizerResponse>
pub async fn create_image( &self, request: &ImageGenerationRequest, ) -> Result<ImageGenerationResponse>
pub async fn create_image_async( &self, request: &ImageGenerationRequest, ) -> Result<AsyncTaskResponse>
pub async fn create_video( &self, request: &VideoGenerationRequest, ) -> Result<AsyncTaskResponse>
pub async fn transcribe( &self, request: TranscriptionRequest, ) -> Result<TranscriptionResponse>
pub async fn speech(&self, request: &SpeechRequest) -> Result<Vec<u8>>
pub async fn clone_voice(&self, request: &Value) -> Result<Value>
pub async fn voices(&self) -> Result<Value>
pub async fn delete_voice(&self, request: &Value) -> Result<Value>
pub async fn web_search(&self, request: &Value) -> Result<Value>
pub async fn read_web_page(&self, request: &Value) -> Result<Value>
pub async fn moderate(&self, request: &Value) -> Result<Value>
pub async fn parse_layout(&self, request: &Value) -> Result<Value>
pub async fn upload_file( &self, request: FileUploadRequest, ) -> Result<FileObject>
pub async fn files( &self, purpose: Option<&str>, limit: Option<u32>, ) -> Result<FileList>
pub async fn delete_file(&self, file_id: &str) -> Result<DeleteResponse>
pub async fn file_content(&self, file_id: &str) -> Result<Vec<u8>>
pub async fn create_file_parse_task(&self, request: &Value) -> Result<Value>
pub async fn file_parse_result( &self, task_id: &str, format_type: &str, ) -> Result<Value>
pub async fn parse_file_sync(&self, request: &Value) -> Result<Value>
pub async fn ocr(&self, request: &Value) -> Result<Value>
pub async fn create_batch( &self, request: &BatchCreateRequest, ) -> Result<BatchObject>
pub async fn batches( &self, limit: Option<u32>, after: Option<&str>, ) -> Result<BatchList>
pub async fn batch(&self, batch_id: &str) -> Result<BatchObject>
pub async fn cancel_batch(&self, batch_id: &str) -> Result<BatchObject>
pub async fn assistant(&self, request: &Value) -> Result<Value>
pub async fn assistants(&self, request: &Value) -> Result<Value>
pub async fn assistant_conversations(&self, request: &Value) -> Result<Value>
pub async fn request_json<T, R>( &self, method: Method, path: &str, body: Option<&T>, ) -> Result<R>
Trait Implementations§
Source§impl ChatProvider for ZhipuClient
impl ChatProvider for ZhipuClient
fn name(&self) -> &str
fn capabilities(&self) -> ProviderCapabilities
fn complete<'life0, 'async_trait>(
&'life0 self,
request: ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatCompletionResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream<'life0, 'async_trait>(
&'life0 self,
request: ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl Clone for ZhipuClient
impl Clone for ZhipuClient
Source§fn clone(&self) -> ZhipuClient
fn clone(&self) -> ZhipuClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 !RefUnwindSafe for ZhipuClient
impl !UnwindSafe for ZhipuClient
impl Freeze for ZhipuClient
impl Send for ZhipuClient
impl Sync for ZhipuClient
impl Unpin for ZhipuClient
impl UnsafeUnpin for ZhipuClient
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