@ailib-official/ai-protocol 0.8.4 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +10 -2
  2. package/dist/v1/models/deepseek-chat.json +4 -4
  3. package/dist/v1/models/gemini.json +59 -1
  4. package/dist/v1/providers/gemini.json +11 -1
  5. package/dist/v2/contracts/anthropic-messages.contract.json +62 -0
  6. package/dist/v2/contracts/gemini-generate.contract.json +59 -0
  7. package/dist/v2/providers/anthropic.json +42 -10
  8. package/dist/v2/providers/cohere.json +21 -0
  9. package/dist/v2/providers/deepseek.json +121 -47
  10. package/dist/v2/providers/doubao.json +23 -8
  11. package/dist/v2/providers/google.json +39 -0
  12. package/dist/v2/providers/groq.json +223 -0
  13. package/dist/v2/providers/jina.json +15 -0
  14. package/dist/v2/providers/moonshot.json +23 -8
  15. package/dist/v2/providers/nvidia.json +520 -0
  16. package/dist/v2/providers/openai.json +39 -11
  17. package/dist/v2/providers/qwen.json +25 -9
  18. package/dist/v2/providers/zhipu.json +114 -22
  19. package/package.json +12 -3
  20. package/schemas/v1.json +1 -1
  21. package/schemas/v2/availability.json +12 -0
  22. package/schemas/v2/capabilities.json +4 -0
  23. package/schemas/v2/error-codes.yaml +5 -0
  24. package/schemas/v2/metadata-model-entry.json +57 -0
  25. package/schemas/v2/pack.json +145 -0
  26. package/schemas/v2/provider-contract.json +45 -0
  27. package/schemas/v2/provider.json +15 -2
  28. package/schemas/v2/tool-calling.json +61 -0
  29. package/v1/models/deepseek-chat.yaml +4 -4
  30. package/v1/models/gemini.yaml +31 -1
  31. package/v1/providers/gemini.yaml +10 -2
  32. package/v2/contracts/anthropic-messages.contract.yaml +55 -0
  33. package/v2/contracts/gemini-generate.contract.yaml +52 -0
  34. package/v2/packs/examples/README.md +9 -0
  35. package/v2/packs/examples/deepseek-economy-pack.json +43 -0
  36. package/v2/providers/anthropic.yaml +34 -13
  37. package/v2/providers/cohere.yaml +16 -3
  38. package/v2/providers/deepseek.yaml +77 -33
  39. package/v2/providers/doubao.yaml +18 -8
  40. package/v2/providers/google.yaml +32 -4
  41. package/v2/providers/groq.yaml +159 -0
  42. package/v2/providers/jina.yaml +10 -0
  43. package/v2/providers/moonshot.yaml +20 -12
  44. package/v2/providers/nvidia.yaml +405 -0
  45. package/v2/providers/openai.yaml +33 -11
  46. package/v2/providers/qwen.yaml +20 -9
  47. package/v2/providers/zhipu.yaml +70 -23
@@ -1,21 +1,22 @@
1
- # 智谱 GLM-5 V2 正式提供商清单 — SOTA 开源编码模型,OpenAI 兼容 API
1
+ # Zhipu GLM-5.2 V2 Provider Manifest — SOTA 开源编码 + 视觉 Agent 模型
2
2
  # AI-Protocol V2 Provider Manifest
3
- # Provider: Zhipu AI (智谱AI) | Models: GLM-5
4
- # Last Updated: 2026-02-16
3
+ # Provider: Zhipu AI (智谱AI) | Models: GLM-5.2 / GLM-5V-Turbo
4
+ # Last Updated: 2026-06-26 (updated from GLM-5 → 5.2)
5
+ # Source: https://z.ai/blog/glm-5 (2026-02), https://docs.z.ai (2026-06)
5
6
  $schema: "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v2/provider.json"
6
7
 
7
8
  # === Ring 1: Core Skeleton ===
8
9
  id: zhipu
9
10
  protocol_version: "2.0"
10
11
  name: "Zhipu AI"
11
- version: "5.0.0"
12
+ version: "5.2.0"
12
13
  status: stable
13
14
  category: ai_provider
14
- official_url: "https://open.bigmodel.cn/dev/api"
15
- support_contact: "https://open.bigmodel.cn/"
15
+ official_url: "https://docs.z.ai"
16
+ support_contact: "https://z.ai"
16
17
 
17
18
  endpoint:
18
- base_url: "https://open.bigmodel.cn/api/paas/v4"
19
+ base_url: "https://api.z.ai/api/paas/v4"
19
20
  chat: "/chat/completions"
20
21
  auth:
21
22
  type: "bearer"
@@ -27,6 +28,7 @@ error_classification:
27
28
  by_http_status:
28
29
  "400": "invalid_request"
29
30
  "401": "authentication"
31
+ "402": "insufficient_quota"
30
32
  "403": "permission_denied"
31
33
  "404": "not_found"
32
34
  "429": "rate_limited"
@@ -38,6 +40,17 @@ error_classification:
38
40
  "rate_limit_exceeded": "rate_limited"
39
41
  "insufficient_quota": "quota_exhausted"
40
42
 
43
+ availability:
44
+ required: false
45
+ regions:
46
+ - cn
47
+ - global
48
+ check:
49
+ method: GET
50
+ path: "/models"
51
+ expected_status: [200, 401]
52
+ timeout_ms: 5000
53
+
41
54
  # === Ring 2: Capability Mapping ===
42
55
  capabilities:
43
56
  required:
@@ -45,6 +58,7 @@ capabilities:
45
58
  - streaming
46
59
  - tools
47
60
  optional:
61
+ - vision
48
62
  - parallel_tools
49
63
  - agentic
50
64
  - reasoning
@@ -52,9 +66,19 @@ capabilities:
52
66
  feature_flags:
53
67
  structured_output: true
54
68
  parallel_tool_calls: true
69
+ extended_thinking: true
55
70
  streaming_usage: true
56
71
  system_messages: true
57
72
 
73
+ tool_calling:
74
+ native:
75
+ supported: true
76
+ reliability: "full"
77
+ parallel: true
78
+ streaming: true
79
+ notes: "Well-evaluated on MCP-Atlas 500-task benchmark; reliable native tool calling"
80
+ text_fallback: null
81
+
58
82
  capability_profile:
59
83
  phase: "ios_v1"
60
84
  inputs:
@@ -62,21 +86,14 @@ capability_profile:
62
86
  outcomes:
63
87
  types: ["text_completion", "structured_json", "tool_call_sequence"]
64
88
  systems:
65
- requires: ["mcp", "search"]
89
+ requires: ["mcp"]
66
90
 
67
91
  parameters:
68
- temperature: { type: float, range: [0.0, 2.0], default: 1.0 }
92
+ temperature: { type: float, range: [0.0, 1.0], default: 0.7 }
69
93
  max_tokens: { type: integer, min: 1, max: 128000 }
70
94
  top_p: { type: float, range: [0.0, 1.0] }
71
95
  stream: { type: boolean }
72
-
73
- parameter_mappings:
74
- temperature: "temperature"
75
- max_tokens: "max_tokens"
76
- stream: "stream"
77
- top_p: "top_p"
78
- tools: "tools"
79
- tool_choice: "tool_choice"
96
+ reasoning_effort: { type: string, enum: ["high", "max"], default: "max" }
80
97
 
81
98
  streaming:
82
99
  decoder:
@@ -92,6 +109,10 @@ streaming:
92
109
  emit: "PartialContentDelta"
93
110
  fields:
94
111
  content: "$.choices[*].delta.content"
112
+ - match: "exists($.choices[*].delta.reasoning_content)"
113
+ emit: "ThinkingDelta"
114
+ fields:
115
+ thinking: "$.choices[*].delta.reasoning_content"
95
116
  - match: "exists($.choices[*].delta.tool_calls)"
96
117
  emit: "PartialToolCall"
97
118
  fields:
@@ -109,11 +130,15 @@ streaming:
109
130
  multimodal:
110
131
  input:
111
132
  vision:
112
- supported: false
133
+ supported: true
134
+ formats: ["jpeg", "png", "webp"]
135
+ encoding_methods: ["base64_inline", "url"]
136
+ document_understanding: true
113
137
  audio:
114
138
  supported: false
115
139
  video:
116
- supported: false
140
+ supported: true
141
+ formats: ["mp4", "mov", "avi"]
117
142
  output:
118
143
  text: true
119
144
  audio:
@@ -155,11 +180,32 @@ metadata:
155
180
  api_compatibility: openai
156
181
  open_source:
157
182
  license: MIT
158
- hugging_face: "https://huggingface.co/zhipuai/glm-5"
183
+ hugging_face: "https://huggingface.co/zai-org/GLM-5.2"
159
184
  agentic_engineering:
160
185
  supported: true
161
- capabilities: [long_horizon_planning, multi_step_workflows, autonomous_debugging]
186
+ capabilities: [long_horizon_planning, multi_step_workflows, autonomous_debugging, computer_use]
162
187
  models:
188
+ glm-5.2:
189
+ context_window: 1048576
190
+ max_output_tokens: 128000
191
+ release_date: "2026-05-01"
192
+ architecture: { type: moe, total: "744B", active: "40B" }
193
+ thinking: "dual_mode"
194
+ reasoning_effort: ["high", "max"]
195
+ glm-5v-turbo:
196
+ context_window: 200000
197
+ max_output_tokens: 64000
198
+ release_date: "2026-04-01"
199
+ architecture: { type: moe, total: "744B", active: "40B" }
200
+ vision: true
201
+ computer_use: true
202
+ mcp_support: true
203
+ glm-5.1:
204
+ context_window: 200000
205
+ max_output_tokens: 128000
206
+ release_date: "2026-03-01"
207
+ architecture: { type: moe, total: "744B", active: "40B" }
208
+ status: "deprecated"
163
209
  glm-5:
164
210
  context_window: 200000
165
211
  max_output_tokens: 128000
@@ -168,8 +214,9 @@ metadata:
168
214
  pricing: { input_per_1m: 1.00, output_per_1m: 3.20 }
169
215
  regional:
170
216
  primary: china
171
- alternative_base: "https://api.z.ai/v1"
172
- international_partners: [aimlapi]
217
+ international_base: "https://api.z.ai/api/paas/v4"
218
+ legacy_base: "https://open.bigmodel.cn/api/paas/v4"
219
+ international_partners: [aimlapi, openrouter]
173
220
  sdk:
174
221
  note: "OpenAI-compatible — use openai SDK with base_url override"
175
222
  python: openai