1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
//! # Model Module
//!
//! Contains all data models, request/response types, and API abstractions for
//! the Zhipu AI API. This module provides type-safe representations of API
//! entities with comprehensive support for various AI capabilities.
//!
//! # Module Organization
//!
//! ## Chat & Conversation
//!
//! - [`chat`] — Synchronous chat completion
//! - [`async_chat`] — Asynchronous (queued) chat completion
//! - [`async_chat_get`] — Retrieve async chat results
//! - [`chat_message_types`] — Message types for text, vision, and voice modes
//! - [`chat_base_request`] — Shared request body (`ChatBody`)
//! - [`chat_base_response`] — Shared response structures
//! - [`chat_stream_response`] — Streaming response deserialization
//!
//! ## Multimodal AI
//!
//! - [`gen_image`] — Image generation
//! - [`gen_video_async`] — Async video generation
//! - [`audio_to_text`] — Speech recognition (ASR)
//! - [`text_to_audio`] — Text-to-speech synthesis (TTS)
//! - [`ocr`] — Optical character recognition
//!
//! ## Text Analysis
//!
//! - [`text_embedded`] — Text embeddings
//! - [`text_rerank`] — Re-ranking
//! - [`text_tokenizer`] — Tokenization
//! - [`moderation`] — Content moderation / safety analysis
//!
//! ## Voice Management
//!
//! - [`voice_clone`] — Voice cloning
//! - [`voice_list`] — Voice listing
//! - [`voice_delete`] — Voice deletion
//!
//! ## Infrastructure
//!
//! - [`chat_models`] — Model type definitions and capability markers
//! - [`tools`] — Tool/function definitions, `ThinkingType`, web-search tools
//! - [`traits`] — Core traits (`Chat`, `AsyncChat`, `ChatRequestModel`,
//! `ChatToolSupport`, `Bounded`, `ModelName`, etc.)
//! - [`model_validate`] — Request validation helpers
//! - [`sse_parser`] — SSE protocol parser
//!
//! # Key Design Patterns
//!
//! - **Marker traits** — [`Chat`](traits::Chat),
//! [`AsyncChat`](traits::AsyncChat), [`ThinkEnable`](traits::ThinkEnable)
//! etc. encode model capabilities at compile time
//! - **Type-state pattern** — [`StreamOn`](traits::StreamOn) /
//! [`StreamOff`](traits::StreamOff) enforce streaming vs. non-streaming at
//! the type level
//! - **Bounded pairing** — the [`Bounded`](traits::Bounded) trait ties model
//! types to compatible message types, preventing invalid combinations at
//! compile time
//!
//! # Usage
//!
//! ```
//! use zai_rs::model::*;
//!
//! let model = GLM4_5_flash {};
//! let messages = TextMessage::user("Hello, how can you help me?");
//! let request = ChatCompletion::new(model, messages);
//! ```
/// Asynchronous (queued) chat completion — submit a chat task and poll later.
/// Retrieve the result of an asynchronous chat task.
/// Speech-to-text (ASR) — transcribe audio into text.
/// Synchronous chat completion (text / vision / voice).
/// Shared chat request body ([`chat_base_request::ChatBody`]).
/// Shared chat response structures ([`chat_base_response`]).
/// Message types for text, vision, and voice chat modes.
/// Model type definitions and capability marker traits.
/// Streaming chat response deserialization.
/// Text-to-image generation.
/// Asynchronous text-to-video generation.
/// Request validation helpers.
/// Content moderation / safety analysis.
/// Optical character recognition (OCR).
/// Server-Sent Events (SSE) protocol parser.
/// Text embeddings.
/// Text re-ranking.
/// Text-to-speech synthesis (TTS).
/// Tokenization / token counting.
/// Tool/function definitions, `ThinkingType`, web-search tools.
/// Core traits (`Chat`, `AsyncChat`, `Bounded`, `ModelName`, …).
/// Voice cloning.
/// Voice deletion.
/// Voice listing.
use crateserde_helpers;
// Selective re-exports avoid collisions among the many private `data` modules.
pub use AsyncChatCompletion;
pub use ;
pub use ChatCompletion;
pub use TaskStatus;
pub use *;
pub use *;
pub use ChatStreamResponse;
pub use *;
pub use Moderation;
pub use *;