@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,4 +1,5 @@
1
1
  # Doubao V2 provider manifest — P0 multimodal generative coverage
2
+ # Last Updated: 2026-06-26 (add tool_calling)
2
3
  $schema: "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v2/provider.json"
3
4
 
4
5
  id: doubao
@@ -29,6 +30,16 @@ error_classification:
29
30
  "500": "server_error"
30
31
  "503": "overloaded"
31
32
 
33
+ availability:
34
+ required: false
35
+ regions:
36
+ - cn
37
+ check:
38
+ method: GET
39
+ path: "/models"
40
+ expected_status: [200, 401]
41
+ timeout_ms: 3000
42
+
32
43
  capabilities:
33
44
  required:
34
45
  - text
@@ -50,6 +61,13 @@ capabilities:
50
61
  system_messages: true
51
62
  image_generation: true
52
63
 
64
+ tool_calling:
65
+ native:
66
+ supported: true
67
+ reliability: "full"
68
+ parallel: true
69
+ streaming: true
70
+
53
71
  capability_profile:
54
72
  phase: "ios_v1"
55
73
  inputs:
@@ -65,14 +83,6 @@ parameters:
65
83
  top_p: { type: float, range: [0.0, 1.0] }
66
84
  stream: { type: boolean }
67
85
 
68
- parameter_mappings:
69
- temperature: "temperature"
70
- max_tokens: "max_tokens"
71
- stream: "stream"
72
- top_p: "top_p"
73
- tools: "tools"
74
- tool_choice: "tool_choice"
75
-
76
86
  streaming:
77
87
  decoder:
78
88
  format: "sse"
@@ -1,7 +1,6 @@
1
- # Google Gemini V2 正式提供商清单全模态支持(音频/视频/CU),合并 v2-alpha 与深度调研数据
2
- # AI-Protocol V2 Provider Manifest
3
- # Provider: Google | Models: Gemini 3 Pro / Flash
4
- # Last Updated: 2026-02-16
1
+ # Google Gemini V2 Provider Manifest 全模态(音频/视频/CU
2
+ # Provider: Google | Models: Gemini 3 Pro / Flash / 3.1 Flash
3
+ # Last Updated: 2026-06-26 (add tool_calling)
5
4
  $schema: "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v2/provider.json"
6
5
 
7
6
  # === Ring 1: Core Skeleton ===
@@ -42,6 +41,16 @@ error_classification:
42
41
  "UNAVAILABLE": "overloaded"
43
42
  "DEADLINE_EXCEEDED": "timeout"
44
43
 
44
+ availability:
45
+ required: false
46
+ regions:
47
+ - global
48
+ check:
49
+ method: GET
50
+ path: "/models"
51
+ expected_status: [200, 401]
52
+ timeout_ms: 3000
53
+
45
54
  # === Ring 2: Capability Mapping ===
46
55
  capabilities:
47
56
  required:
@@ -65,6 +74,13 @@ capabilities:
65
74
  streaming_usage: false
66
75
  system_messages: true
67
76
 
77
+ tool_calling:
78
+ native:
79
+ supported: true
80
+ reliability: "full"
81
+ parallel: true
82
+ streaming: true
83
+
68
84
  capability_profile:
69
85
  phase: "ios_v1"
70
86
  inputs:
@@ -236,6 +252,18 @@ metadata:
236
252
  max_output_tokens: 64000
237
253
  status: public_preview
238
254
  pricing: { input_per_1m: 0.15, output_per_1m: 0.60 }
255
+ gemini-2.5-flash-lite:
256
+ context_window: 1048576
257
+ max_output_tokens: 65536
258
+ gemini-2.5-flash:
259
+ context_window: 1048576
260
+ max_output_tokens: 65536
261
+ gemini-2.5-pro:
262
+ context_window: 2097152
263
+ max_output_tokens: 65536
264
+ gemini-3.1-flash-lite-preview:
265
+ context_window: 1048576
266
+ max_output_tokens: 65536
239
267
  context_caching:
240
268
  supported: true
241
269
  pricing: "$0.20-0.40 per 1M tokens/hour"
@@ -0,0 +1,159 @@
1
+ # Groq V2 provider — OpenAI-compatible fast inference
2
+ # Last Updated: 2026-06-26 (add tool_calling)
3
+ $schema: "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v2/provider.json"
4
+
5
+ id: groq
6
+ protocol_version: "2.0"
7
+ name: "Groq"
8
+ version: "1.0.0"
9
+ status: stable
10
+ category: ai_provider
11
+ official_url: "https://console.groq.com/docs"
12
+ support_contact: "https://support.groq.com"
13
+
14
+ endpoint:
15
+ base_url: "https://api.groq.com/openai/v1"
16
+ chat: "/chat/completions"
17
+ auth:
18
+ type: "bearer"
19
+ header: "Authorization"
20
+ prefix: "Bearer"
21
+ token_env: "GROQ_API_KEY"
22
+
23
+ error_classification:
24
+ by_http_status:
25
+ "400": "invalid_request"
26
+ "401": "authentication"
27
+ "403": "permission_denied"
28
+ "404": "not_found"
29
+ "429": "rate_limited"
30
+ "500": "server_error"
31
+ "503": "overloaded"
32
+ by_error_code:
33
+ "context_length_exceeded": "request_too_large"
34
+ "model_not_found": "not_found"
35
+ "rate_limit_exceeded": "rate_limited"
36
+
37
+ availability:
38
+ required: false
39
+ regions:
40
+ - global
41
+ check:
42
+ method: GET
43
+ path: "/models"
44
+ expected_status: [200, 401]
45
+ timeout_ms: 3000
46
+
47
+ capabilities:
48
+ required:
49
+ - text
50
+ - streaming
51
+ - tools
52
+ optional:
53
+ - parallel_tools
54
+ - agentic
55
+ feature_flags:
56
+ parallel_tool_calls: true
57
+ streaming_usage: true
58
+ system_messages: true
59
+
60
+ tool_calling:
61
+ native:
62
+ supported: true
63
+ reliability: "full"
64
+ parallel: true
65
+
66
+ parameters:
67
+ temperature: { type: float, range: [0.0, 2.0], default: 1.0 }
68
+ max_tokens: { type: integer, min: 1, max: 8192 }
69
+ top_p: { type: float, range: [0.0, 1.0] }
70
+ stream: { type: boolean }
71
+
72
+ streaming:
73
+ decoder:
74
+ format: "sse"
75
+ strategy: "openai_chat"
76
+ done_signal: "[DONE]"
77
+ prefix: "data: "
78
+ content_path: "$.choices[0].delta.content"
79
+ tool_call_path: "$.choices[0].delta.tool_calls"
80
+ usage_path: "$.usage"
81
+ event_map:
82
+ - match: "exists($.choices[*].delta.content)"
83
+ emit: "PartialContentDelta"
84
+ fields:
85
+ content: "$.choices[*].delta.content"
86
+ - match: "exists($.choices[*].delta.tool_calls)"
87
+ emit: "PartialToolCall"
88
+ fields:
89
+ tool_calls: "$.choices[*].delta.tool_calls"
90
+ - match: "exists($.usage)"
91
+ emit: "Metadata"
92
+ fields:
93
+ usage: "$.usage"
94
+ - match: "$.choices[*].finish_reason != null"
95
+ emit: "StreamEnd"
96
+ fields:
97
+ finish_reason: "$.choices[*].finish_reason"
98
+ stop_condition: "$.choices[0].finish_reason != null"
99
+
100
+ multimodal:
101
+ input:
102
+ vision:
103
+ supported: false
104
+ audio:
105
+ supported: false
106
+ video:
107
+ supported: false
108
+ output:
109
+ text: true
110
+ audio:
111
+ supported: false
112
+ image:
113
+ supported: false
114
+
115
+ api_families: ["chat_completions"]
116
+ default_api_family: "chat_completions"
117
+
118
+ endpoints:
119
+ chat:
120
+ path: "/chat/completions"
121
+ method: "POST"
122
+ adapter: "openai"
123
+
124
+ services:
125
+ list_models:
126
+ path: "/models"
127
+ method: "GET"
128
+ response_binding: "data"
129
+
130
+ retry_policy:
131
+ strategy: "exponential_backoff"
132
+ max_retries: 3
133
+ min_delay_ms: 1000
134
+ max_delay_ms: 30000
135
+ jitter: "full"
136
+ retry_on_http_status: [429, 500, 502, 503]
137
+
138
+ termination:
139
+ source_field: "finish_reason"
140
+ mapping:
141
+ stop: "end_turn"
142
+ length: "max_tokens"
143
+ tool_calls: "tool_use"
144
+
145
+ metadata:
146
+ api_compatibility: openai
147
+ models:
148
+ llama-3.1-8b-instant:
149
+ context_window: 128000
150
+ max_output_tokens: 8192
151
+ verification:
152
+ status: verified
153
+ source: official_documentation
154
+ verified_at: "2026-05-29"
155
+ notes: "https://console.groq.com/docs/models"
156
+ sdk:
157
+ note: "OpenAI-compatible — use openai SDK with base_url override"
158
+ python: openai
159
+ typescript: openai
@@ -32,6 +32,16 @@ error_classification:
32
32
  "429": "rate_limited"
33
33
  "500": "server_error"
34
34
 
35
+ availability:
36
+ required: false
37
+ regions:
38
+ - global
39
+ check:
40
+ method: GET
41
+ path: "/v1/models"
42
+ expected_status: [200, 401]
43
+ timeout_ms: 3000
44
+
35
45
  # === Ring 2: Capability Mapping ===
36
46
  capabilities:
37
47
  required:
@@ -1,7 +1,6 @@
1
- # Moonshot Kimi V2 正式提供商清单 — Agent Swarm 先驱,OpenAI 兼容 API
2
- # AI-Protocol V2 Provider Manifest
3
- # Provider: Moonshot AI | Models: Kimi K2.5 / K2-Thinking
4
- # Last Updated: 2026-02-16
1
+ # Moonshot Kimi V2 Provider Manifest — Agent Swarm 先驱
2
+ # Provider: Moonshot AI | Models: Kimi K2.6 / K2.5 / K2-Thinking
3
+ # Last Updated: 2026-06-26 (add tool_calling)
5
4
  $schema: "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v2/provider.json"
6
5
 
7
6
  # === Ring 1: Core Skeleton ===
@@ -38,6 +37,16 @@ error_classification:
38
37
  "rate_limit_exceeded": "rate_limited"
39
38
  "insufficient_quota": "quota_exhausted"
40
39
 
40
+ availability:
41
+ required: false
42
+ regions:
43
+ - cn
44
+ check:
45
+ method: GET
46
+ path: "/models"
47
+ expected_status: [200, 401]
48
+ timeout_ms: 3000
49
+
41
50
  # === Ring 2: Capability Mapping ===
42
51
  capabilities:
43
52
  required:
@@ -57,6 +66,13 @@ capabilities:
57
66
  streaming_usage: true
58
67
  system_messages: true
59
68
 
69
+ tool_calling:
70
+ native:
71
+ supported: true
72
+ reliability: "full"
73
+ parallel: true
74
+ streaming: true
75
+
60
76
  capability_profile:
61
77
  phase: "ios_v1"
62
78
  inputs:
@@ -72,14 +88,6 @@ parameters:
72
88
  top_p: { type: float, range: [0.0, 1.0] }
73
89
  stream: { type: boolean }
74
90
 
75
- parameter_mappings:
76
- temperature: "temperature"
77
- max_tokens: "max_tokens"
78
- stream: "stream"
79
- top_p: "top_p"
80
- tools: "tools"
81
- tool_choice: "tool_choice"
82
-
83
91
  streaming:
84
92
  decoder:
85
93
  format: "sse"