@ailib-official/ai-protocol 0.8.4
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.
- package/LICENSE +6 -0
- package/README.md +415 -0
- package/dist/index.json +8 -0
- package/dist/v1/models/ai21.json +140 -0
- package/dist/v1/models/baichuan.json +138 -0
- package/dist/v1/models/cerebras.json +147 -0
- package/dist/v1/models/claude.json +114 -0
- package/dist/v1/models/cohere.json +235 -0
- package/dist/v1/models/deepinfra.json +43 -0
- package/dist/v1/models/deepseek-chat.json +55 -0
- package/dist/v1/models/doubao.json +197 -0
- package/dist/v1/models/ernie.json +223 -0
- package/dist/v1/models/fireworks.json +222 -0
- package/dist/v1/models/gemini.json +58 -0
- package/dist/v1/models/gpt.json +166 -0
- package/dist/v1/models/grok.json +138 -0
- package/dist/v1/models/huggingface.json +183 -0
- package/dist/v1/models/hunyuan.json +255 -0
- package/dist/v1/models/jina.json +139 -0
- package/dist/v1/models/lepton.json +188 -0
- package/dist/v1/models/llama.json +143 -0
- package/dist/v1/models/minimax.json +194 -0
- package/dist/v1/models/mistral.json +177 -0
- package/dist/v1/models/moonshot.json +144 -0
- package/dist/v1/models/nvidia.json +212 -0
- package/dist/v1/models/palmyra.json +103 -0
- package/dist/v1/models/perplexity.json +143 -0
- package/dist/v1/models/qwen.json +49 -0
- package/dist/v1/models/replicate.json +206 -0
- package/dist/v1/models/sensenova.json +144 -0
- package/dist/v1/models/siliconflow.json +44 -0
- package/dist/v1/models/spark.json +173 -0
- package/dist/v1/models/stable-diffusion.json +161 -0
- package/dist/v1/models/tiangong.json +169 -0
- package/dist/v1/models/together.json +43 -0
- package/dist/v1/models/yi.json +199 -0
- package/dist/v1/models/zhipu.json +250 -0
- package/dist/v1/providers/ai21.json +215 -0
- package/dist/v1/providers/anthropic.json +253 -0
- package/dist/v1/providers/anyscale.json +115 -0
- package/dist/v1/providers/azure.json +188 -0
- package/dist/v1/providers/baichuan.json +205 -0
- package/dist/v1/providers/baidu.json +205 -0
- package/dist/v1/providers/cerebras.json +216 -0
- package/dist/v1/providers/cohere.json +209 -0
- package/dist/v1/providers/deepinfra.json +196 -0
- package/dist/v1/providers/deepseek.json +221 -0
- package/dist/v1/providers/doubao.json +209 -0
- package/dist/v1/providers/fireworks.json +227 -0
- package/dist/v1/providers/gemini.json +279 -0
- package/dist/v1/providers/groq.json +218 -0
- package/dist/v1/providers/huggingface.json +181 -0
- package/dist/v1/providers/hunyuan.json +198 -0
- package/dist/v1/providers/jina.json +202 -0
- package/dist/v1/providers/lepton.json +221 -0
- package/dist/v1/providers/minimax.json +209 -0
- package/dist/v1/providers/mistral.json +214 -0
- package/dist/v1/providers/moonshot.json +214 -0
- package/dist/v1/providers/nvidia.json +213 -0
- package/dist/v1/providers/openai.json +267 -0
- package/dist/v1/providers/openrouter.json +220 -0
- package/dist/v1/providers/perplexity.json +172 -0
- package/dist/v1/providers/qwen.json +231 -0
- package/dist/v1/providers/replicate.json +192 -0
- package/dist/v1/providers/sensenova.json +185 -0
- package/dist/v1/providers/siliconflow.json +197 -0
- package/dist/v1/providers/spark.json +204 -0
- package/dist/v1/providers/stability.json +221 -0
- package/dist/v1/providers/tiangong.json +207 -0
- package/dist/v1/providers/together.json +196 -0
- package/dist/v1/providers/writer.json +253 -0
- package/dist/v1/providers/xai.json +238 -0
- package/dist/v1/providers/yi.json +205 -0
- package/dist/v1/providers/zhipu.json +208 -0
- package/dist/v1/spec.json +783 -0
- package/dist/v2/providers/anthropic.json +372 -0
- package/dist/v2/providers/cohere.json +109 -0
- package/dist/v2/providers/deepseek.json +272 -0
- package/dist/v2/providers/doubao.json +260 -0
- package/dist/v2/providers/google.json +388 -0
- package/dist/v2/providers/jina.json +71 -0
- package/dist/v2/providers/moonshot.json +284 -0
- package/dist/v2/providers/openai.json +419 -0
- package/dist/v2/providers/qwen.json +274 -0
- package/dist/v2/providers/zhipu.json +257 -0
- package/dist/v2-alpha/providers/anthropic.json +182 -0
- package/dist/v2-alpha/providers/gemini.json +187 -0
- package/dist/v2-alpha/providers/openai.json +215 -0
- package/dist/v2-alpha/spec.json +644 -0
- package/package.json +61 -0
- package/schemas/spec.json +186 -0
- package/schemas/v1.json +1116 -0
- package/schemas/v2/availability.json +66 -0
- package/schemas/v2/capabilities.json +182 -0
- package/schemas/v2/capability-profile.json +174 -0
- package/schemas/v2/computer-use.json +222 -0
- package/schemas/v2/context-policy.json +148 -0
- package/schemas/v2/endpoint.json +2 -0
- package/schemas/v2/error-codes.yaml +225 -0
- package/schemas/v2/errors.json +250 -0
- package/schemas/v2/execution-metadata.json +59 -0
- package/schemas/v2/mcp.json +225 -0
- package/schemas/v2/message-roles.json +10 -0
- package/schemas/v2/multimodal.json +297 -0
- package/schemas/v2/pricing.json +14 -0
- package/schemas/v2/provider-contract.json +317 -0
- package/schemas/v2/provider.json +203 -0
- package/schemas/v2/regions.json +14 -0
- package/v1/models/ai21.yaml +97 -0
- package/v1/models/baichuan.yaml +95 -0
- package/v1/models/cerebras.yaml +99 -0
- package/v1/models/claude.yaml +59 -0
- package/v1/models/cohere.yaml +165 -0
- package/v1/models/deepinfra.yaml +29 -0
- package/v1/models/deepseek-chat.yaml +32 -0
- package/v1/models/doubao.yaml +129 -0
- package/v1/models/ernie.yaml +146 -0
- package/v1/models/fireworks.yaml +145 -0
- package/v1/models/gemini.yaml +32 -0
- package/v1/models/gpt.yaml +90 -0
- package/v1/models/grok.yaml +74 -0
- package/v1/models/huggingface.yaml +110 -0
- package/v1/models/hunyuan.yaml +164 -0
- package/v1/models/jina.yaml +98 -0
- package/v1/models/lepton.yaml +130 -0
- package/v1/models/llama.yaml +91 -0
- package/v1/models/minimax.yaml +132 -0
- package/v1/models/mistral.yaml +100 -0
- package/v1/models/moonshot.yaml +97 -0
- package/v1/models/nvidia.yaml +118 -0
- package/v1/models/palmyra.yaml +59 -0
- package/v1/models/perplexity.yaml +97 -0
- package/v1/models/qwen.yaml +27 -0
- package/v1/models/replicate.yaml +136 -0
- package/v1/models/sensenova.yaml +97 -0
- package/v1/models/siliconflow.yaml +29 -0
- package/v1/models/spark.yaml +114 -0
- package/v1/models/stable-diffusion.yaml +113 -0
- package/v1/models/tiangong.yaml +114 -0
- package/v1/models/together.yaml +29 -0
- package/v1/models/yi.yaml +132 -0
- package/v1/models/zhipu.yaml +163 -0
- package/v1/providers/ai21.yaml +176 -0
- package/v1/providers/anthropic.yaml +209 -0
- package/v1/providers/anyscale.yaml +106 -0
- package/v1/providers/azure.yaml +155 -0
- package/v1/providers/baichuan.yaml +168 -0
- package/v1/providers/baidu.yaml +173 -0
- package/v1/providers/cerebras.yaml +178 -0
- package/v1/providers/cohere.yaml +175 -0
- package/v1/providers/deepinfra.yaml +156 -0
- package/v1/providers/deepseek.yaml +189 -0
- package/v1/providers/doubao.yaml +172 -0
- package/v1/providers/fireworks.yaml +187 -0
- package/v1/providers/gemini.yaml +229 -0
- package/v1/providers/groq.yaml +181 -0
- package/v1/providers/huggingface.yaml +157 -0
- package/v1/providers/hunyuan.yaml +162 -0
- package/v1/providers/jina.yaml +171 -0
- package/v1/providers/lepton.yaml +183 -0
- package/v1/providers/minimax.yaml +172 -0
- package/v1/providers/mistral.yaml +186 -0
- package/v1/providers/moonshot.yaml +176 -0
- package/v1/providers/nvidia.yaml +172 -0
- package/v1/providers/openai.yaml +224 -0
- package/v1/providers/openrouter.yaml +181 -0
- package/v1/providers/perplexity.yaml +144 -0
- package/v1/providers/qwen.yaml +192 -0
- package/v1/providers/replicate.yaml +159 -0
- package/v1/providers/sensenova.yaml +153 -0
- package/v1/providers/siliconflow.yaml +156 -0
- package/v1/providers/spark.yaml +167 -0
- package/v1/providers/stability.yaml +185 -0
- package/v1/providers/tiangong.yaml +170 -0
- package/v1/providers/together.yaml +156 -0
- package/v1/providers/writer.yaml +212 -0
- package/v1/providers/xai.yaml +206 -0
- package/v1/providers/yi.yaml +168 -0
- package/v1/providers/zhipu.yaml +171 -0
- package/v1/spec.yaml +637 -0
- package/v2/providers/anthropic.yaml +244 -0
- package/v2/providers/cohere.yaml +75 -0
- package/v2/providers/deepseek.yaml +176 -0
- package/v2/providers/doubao.yaml +169 -0
- package/v2/providers/google.yaml +245 -0
- package/v2/providers/jina.yaml +55 -0
- package/v2/providers/moonshot.yaml +186 -0
- package/v2/providers/openai.yaml +266 -0
- package/v2/providers/qwen.yaml +174 -0
- package/v2/providers/zhipu.yaml +176 -0
- package/v2-alpha/providers/anthropic.yaml +134 -0
- package/v2-alpha/providers/gemini.yaml +144 -0
- package/v2-alpha/providers/openai.yaml +154 -0
- package/v2-alpha/spec.yaml +512 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v2/execution-metadata.json",
|
|
4
|
+
"title": "AI-Protocol V2 ExecutionMetadata",
|
|
5
|
+
"description": "Metadata returned by the execution layer (E) for consumption by the contact/policy layer (P). Cross-runtime JSON shape for ExecutionResult.metadata.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"provider_id",
|
|
9
|
+
"model_id",
|
|
10
|
+
"execution_latency_ms",
|
|
11
|
+
"translation_latency_ms",
|
|
12
|
+
"micro_retry_count"
|
|
13
|
+
],
|
|
14
|
+
"properties": {
|
|
15
|
+
"provider_id": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Provider manifest id"
|
|
18
|
+
},
|
|
19
|
+
"model_id": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "Resolved model id for this call"
|
|
22
|
+
},
|
|
23
|
+
"execution_latency_ms": {
|
|
24
|
+
"type": "integer",
|
|
25
|
+
"minimum": 0,
|
|
26
|
+
"description": "End-to-end execution time for the provider call"
|
|
27
|
+
},
|
|
28
|
+
"translation_latency_ms": {
|
|
29
|
+
"type": "integer",
|
|
30
|
+
"minimum": 0,
|
|
31
|
+
"description": "Time spent in protocol translation (manifest-driven mapping)"
|
|
32
|
+
},
|
|
33
|
+
"micro_retry_count": {
|
|
34
|
+
"type": "integer",
|
|
35
|
+
"minimum": 0,
|
|
36
|
+
"maximum": 255,
|
|
37
|
+
"description": "Bounded transport-level retries inside E (1–2 max); not policy retries"
|
|
38
|
+
},
|
|
39
|
+
"error_code": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"pattern": "^E[0-9]{4}$",
|
|
42
|
+
"description": "Optional AI-Protocol V2 standard code when the call failed in E"
|
|
43
|
+
},
|
|
44
|
+
"usage": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"description": "Optional token usage (all subfields optional for partial responses)",
|
|
47
|
+
"additionalProperties": false,
|
|
48
|
+
"properties": {
|
|
49
|
+
"prompt_tokens": { "type": "integer", "minimum": 0 },
|
|
50
|
+
"completion_tokens": { "type": "integer", "minimum": 0 },
|
|
51
|
+
"total_tokens": { "type": "integer", "minimum": 0 },
|
|
52
|
+
"reasoning_tokens": { "type": "integer", "minimum": 0 },
|
|
53
|
+
"cache_read_tokens": { "type": "integer", "minimum": 0 },
|
|
54
|
+
"cache_creation_tokens": { "type": "integer", "minimum": 0 }
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"additionalProperties": false
|
|
59
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v2/mcp.json",
|
|
4
|
+
"title": "AI-Protocol V2 MCP Integration",
|
|
5
|
+
"description": "Model Context Protocol (MCP) integration configuration for V2 provider manifests. Defines how providers connect to external MCP servers (client mode) or expose capabilities as MCP servers (server mode). Based on MCP specification 2025-11-25. Validated against OpenAI, Anthropic, and Google implementations.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"client": {
|
|
9
|
+
"type": "object",
|
|
10
|
+
"description": "MCP client configuration —connecting to external MCP servers",
|
|
11
|
+
"properties": {
|
|
12
|
+
"supported": {
|
|
13
|
+
"type": "boolean",
|
|
14
|
+
"default": false,
|
|
15
|
+
"description": "Whether the provider API natively supports connecting to MCP servers"
|
|
16
|
+
},
|
|
17
|
+
"protocol_version": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
|
|
20
|
+
"description": "MCP specification version supported (date format, e.g. '2025-11-25')"
|
|
21
|
+
},
|
|
22
|
+
"transports": {
|
|
23
|
+
"type": "array",
|
|
24
|
+
"items": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"enum": ["stdio", "sse", "streamable_http"]
|
|
27
|
+
},
|
|
28
|
+
"minItems": 1,
|
|
29
|
+
"uniqueItems": true,
|
|
30
|
+
"description": "Supported MCP transport mechanisms"
|
|
31
|
+
},
|
|
32
|
+
"auth_methods": {
|
|
33
|
+
"type": "array",
|
|
34
|
+
"items": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"enum": ["none", "bearer", "oauth2", "api_key"]
|
|
37
|
+
},
|
|
38
|
+
"uniqueItems": true,
|
|
39
|
+
"description": "Supported authentication methods for MCP server connections"
|
|
40
|
+
},
|
|
41
|
+
"capabilities": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"description": "Which MCP server capabilities can be consumed",
|
|
44
|
+
"properties": {
|
|
45
|
+
"tools": {
|
|
46
|
+
"type": "boolean",
|
|
47
|
+
"default": true,
|
|
48
|
+
"description": "Can invoke tools exposed by MCP servers"
|
|
49
|
+
},
|
|
50
|
+
"resources": {
|
|
51
|
+
"type": "boolean",
|
|
52
|
+
"default": false,
|
|
53
|
+
"description": "Can read resources provided by MCP servers"
|
|
54
|
+
},
|
|
55
|
+
"prompts": {
|
|
56
|
+
"type": "boolean",
|
|
57
|
+
"default": false,
|
|
58
|
+
"description": "Can use prompt templates from MCP servers"
|
|
59
|
+
},
|
|
60
|
+
"sampling": {
|
|
61
|
+
"type": "boolean",
|
|
62
|
+
"default": false,
|
|
63
|
+
"description": "Supports server-initiated LLM sampling requests"
|
|
64
|
+
},
|
|
65
|
+
"elicitation": {
|
|
66
|
+
"type": "boolean",
|
|
67
|
+
"default": false,
|
|
68
|
+
"description": "Supports server-initiated user information requests"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"additionalProperties": false
|
|
72
|
+
},
|
|
73
|
+
"tool_filtering": {
|
|
74
|
+
"type": "object",
|
|
75
|
+
"description": "Configuration for filtering available MCP tools",
|
|
76
|
+
"properties": {
|
|
77
|
+
"allowed_tools": {
|
|
78
|
+
"type": "boolean",
|
|
79
|
+
"default": true,
|
|
80
|
+
"description": "Supports allowlist filtering of MCP server tools"
|
|
81
|
+
},
|
|
82
|
+
"denied_tools": {
|
|
83
|
+
"type": "boolean",
|
|
84
|
+
"default": false,
|
|
85
|
+
"description": "Supports denylist filtering of MCP server tools"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"additionalProperties": false
|
|
89
|
+
},
|
|
90
|
+
"approval_modes": {
|
|
91
|
+
"type": "array",
|
|
92
|
+
"items": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"enum": ["never", "always", "auto"]
|
|
95
|
+
},
|
|
96
|
+
"uniqueItems": true,
|
|
97
|
+
"description": "Tool execution approval modes (never=auto-approve, always=require confirmation, auto=provider decides)"
|
|
98
|
+
},
|
|
99
|
+
"max_servers": {
|
|
100
|
+
"type": "integer",
|
|
101
|
+
"minimum": 1,
|
|
102
|
+
"description": "Maximum number of concurrent MCP server connections"
|
|
103
|
+
},
|
|
104
|
+
"timeout_ms": {
|
|
105
|
+
"type": "integer",
|
|
106
|
+
"minimum": 1000,
|
|
107
|
+
"default": 30000,
|
|
108
|
+
"description": "Default timeout for MCP server operations in milliseconds"
|
|
109
|
+
},
|
|
110
|
+
"error_handling": {
|
|
111
|
+
"type": "object",
|
|
112
|
+
"description": "Error handling behavior for MCP operations",
|
|
113
|
+
"properties": {
|
|
114
|
+
"on_server_unavailable": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"enum": ["error", "skip", "fallback"],
|
|
117
|
+
"default": "error",
|
|
118
|
+
"description": "Behavior when an MCP server is unreachable"
|
|
119
|
+
},
|
|
120
|
+
"on_tool_error": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"enum": ["propagate", "wrap", "retry"],
|
|
123
|
+
"default": "propagate",
|
|
124
|
+
"description": "How MCP tool execution errors are handled"
|
|
125
|
+
},
|
|
126
|
+
"retry_policy": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"properties": {
|
|
129
|
+
"max_retries": { "type": "integer", "minimum": 0, "default": 2 },
|
|
130
|
+
"backoff_ms": { "type": "integer", "minimum": 100, "default": 1000 }
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"additionalProperties": false
|
|
135
|
+
},
|
|
136
|
+
"provider_mapping": {
|
|
137
|
+
"type": "object",
|
|
138
|
+
"description": "Provider-specific MCP integration details",
|
|
139
|
+
"properties": {
|
|
140
|
+
"tool_type": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"description": "Provider's tool type identifier for MCP (e.g. 'mcp' for OpenAI)"
|
|
143
|
+
},
|
|
144
|
+
"beta_header": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"description": "Required beta header (e.g. 'mcp-client-2025-11-20' for Anthropic)"
|
|
147
|
+
},
|
|
148
|
+
"api_endpoint": {
|
|
149
|
+
"type": "string",
|
|
150
|
+
"description": "Specific API endpoint supporting MCP (e.g. '/v1/responses' for OpenAI)"
|
|
151
|
+
},
|
|
152
|
+
"config_method": {
|
|
153
|
+
"type": "string",
|
|
154
|
+
"enum": ["tool_parameter", "settings_json", "cli_flag", "sdk_config"],
|
|
155
|
+
"description": "How MCP servers are configured in the provider API"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"additionalProperties": true
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"if": { "properties": { "supported": { "const": true } } },
|
|
162
|
+
"then": { "required": ["transports"] },
|
|
163
|
+
"additionalProperties": false
|
|
164
|
+
},
|
|
165
|
+
"server": {
|
|
166
|
+
"type": "object",
|
|
167
|
+
"description": "MCP server configuration —exposing provider capabilities as MCP server",
|
|
168
|
+
"properties": {
|
|
169
|
+
"supported": {
|
|
170
|
+
"type": "boolean",
|
|
171
|
+
"default": false,
|
|
172
|
+
"description": "Whether the provider can act as an MCP server"
|
|
173
|
+
},
|
|
174
|
+
"transports": {
|
|
175
|
+
"type": "array",
|
|
176
|
+
"items": {
|
|
177
|
+
"type": "string",
|
|
178
|
+
"enum": ["stdio", "sse", "streamable_http"]
|
|
179
|
+
},
|
|
180
|
+
"uniqueItems": true
|
|
181
|
+
},
|
|
182
|
+
"exposed_capabilities": {
|
|
183
|
+
"type": "array",
|
|
184
|
+
"items": {
|
|
185
|
+
"type": "string",
|
|
186
|
+
"enum": ["tools", "resources", "prompts"]
|
|
187
|
+
},
|
|
188
|
+
"uniqueItems": true,
|
|
189
|
+
"description": "Which MCP server capabilities are exposed"
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
"if": { "properties": { "supported": { "const": true } } },
|
|
193
|
+
"then": { "required": ["transports", "exposed_capabilities"] },
|
|
194
|
+
"additionalProperties": false
|
|
195
|
+
},
|
|
196
|
+
"official_servers": {
|
|
197
|
+
"type": "array",
|
|
198
|
+
"description": "List of official MCP servers maintained by the provider",
|
|
199
|
+
"items": {
|
|
200
|
+
"type": "object",
|
|
201
|
+
"required": ["name"],
|
|
202
|
+
"properties": {
|
|
203
|
+
"name": {
|
|
204
|
+
"type": "string",
|
|
205
|
+
"description": "Server name"
|
|
206
|
+
},
|
|
207
|
+
"uri": {
|
|
208
|
+
"type": "string",
|
|
209
|
+
"description": "Server URI or package identifier"
|
|
210
|
+
},
|
|
211
|
+
"transport": {
|
|
212
|
+
"type": "string",
|
|
213
|
+
"enum": ["stdio", "sse", "streamable_http"]
|
|
214
|
+
},
|
|
215
|
+
"description": {
|
|
216
|
+
"type": "string"
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"additionalProperties": false
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"additionalProperties": false
|
|
224
|
+
}
|
|
225
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v2/message-roles.json",
|
|
4
|
+
"title": "AI-Protocol Standard Message Roles",
|
|
5
|
+
"description": "Canonical message roles for chat. Runtimes use these when building messages and mapping to provider-specific formats. Supports all major LLMs (OpenAI, Anthropic, Gemini, etc.).",
|
|
6
|
+
"type": "string",
|
|
7
|
+
"enum": ["system", "user", "assistant", "tool"],
|
|
8
|
+
"examples": ["system", "user", "assistant", "tool"]
|
|
9
|
+
}
|
|
10
|
+
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v2/multimodal.json",
|
|
4
|
+
"title": "AI-Protocol V2 Multimodal Capabilities",
|
|
5
|
+
"description": "Extended multimodal capability configuration for V2 provider manifests. Covers input and output modalities including vision, audio, video, image generation, and speech synthesis. Supports omni-modal models with simultaneous multi-modal I/O. Validated against Google Gemini (audio+video), OpenAI (audio+TTS), Anthropic (vision), Qwen (omni_mode).",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"input": {
|
|
9
|
+
"type": "object",
|
|
10
|
+
"description": "Input modality configurations",
|
|
11
|
+
"properties": {
|
|
12
|
+
"vision": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"description": "Image/vision input capabilities",
|
|
15
|
+
"properties": {
|
|
16
|
+
"supported": { "type": "boolean", "default": false },
|
|
17
|
+
"formats": {
|
|
18
|
+
"type": "array",
|
|
19
|
+
"items": { "type": "string", "enum": ["jpeg", "png", "gif", "webp", "bmp", "tiff", "svg", "ico"] },
|
|
20
|
+
"minItems": 1,
|
|
21
|
+
"uniqueItems": true,
|
|
22
|
+
"description": "Supported image formats"
|
|
23
|
+
},
|
|
24
|
+
"max_images_per_request": {
|
|
25
|
+
"type": "integer",
|
|
26
|
+
"minimum": 1,
|
|
27
|
+
"description": "Maximum number of images in a single request"
|
|
28
|
+
},
|
|
29
|
+
"max_resolution": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"pattern": "^\\d+x\\d+$",
|
|
32
|
+
"description": "Maximum image resolution (e.g. '4096x4096')"
|
|
33
|
+
},
|
|
34
|
+
"max_file_size": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"pattern": "^\\d+(\\.\\d+)?\\s*(KB|MB|GB)$",
|
|
37
|
+
"description": "Maximum file size per image (e.g. '20MB')"
|
|
38
|
+
},
|
|
39
|
+
"encoding_methods": {
|
|
40
|
+
"type": "array",
|
|
41
|
+
"items": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"enum": ["base64_inline", "url", "file_uri"]
|
|
44
|
+
},
|
|
45
|
+
"minItems": 1,
|
|
46
|
+
"uniqueItems": true,
|
|
47
|
+
"description": "Supported image encoding methods"
|
|
48
|
+
},
|
|
49
|
+
"document_understanding": {
|
|
50
|
+
"type": "boolean",
|
|
51
|
+
"default": false,
|
|
52
|
+
"description": "Supports PDF, table, chart, diagram understanding"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"if": { "properties": { "supported": { "const": true } } },
|
|
56
|
+
"then": { "required": ["formats", "encoding_methods"] },
|
|
57
|
+
"additionalProperties": false
|
|
58
|
+
},
|
|
59
|
+
"audio": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"description": "Audio input capabilities",
|
|
62
|
+
"properties": {
|
|
63
|
+
"supported": { "type": "boolean", "default": false },
|
|
64
|
+
"formats": {
|
|
65
|
+
"type": "array",
|
|
66
|
+
"items": { "type": "string", "enum": ["mp3", "wav", "flac", "ogg", "aac", "m4a", "opus", "wma"] },
|
|
67
|
+
"minItems": 1,
|
|
68
|
+
"uniqueItems": true,
|
|
69
|
+
"description": "Supported audio formats"
|
|
70
|
+
},
|
|
71
|
+
"max_duration": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"description": "Maximum audio duration (e.g. '8h', '30m')"
|
|
74
|
+
},
|
|
75
|
+
"max_file_size": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"description": "Maximum file size (e.g. '2GB')"
|
|
78
|
+
},
|
|
79
|
+
"real_time_streaming": {
|
|
80
|
+
"type": "boolean",
|
|
81
|
+
"default": false,
|
|
82
|
+
"description": "Supports real-time audio streaming input"
|
|
83
|
+
},
|
|
84
|
+
"speech_recognition": {
|
|
85
|
+
"type": "boolean",
|
|
86
|
+
"default": false,
|
|
87
|
+
"description": "Can transcribe spoken audio to text"
|
|
88
|
+
},
|
|
89
|
+
"encoding_methods": {
|
|
90
|
+
"type": "array",
|
|
91
|
+
"items": { "type": "string", "enum": ["base64_inline", "url", "file_uri"] },
|
|
92
|
+
"uniqueItems": true,
|
|
93
|
+
"description": "Supported audio encoding methods"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"if": { "properties": { "supported": { "const": true } } },
|
|
97
|
+
"then": { "required": ["formats"] },
|
|
98
|
+
"additionalProperties": false
|
|
99
|
+
},
|
|
100
|
+
"video": {
|
|
101
|
+
"type": "object",
|
|
102
|
+
"description": "Video input capabilities",
|
|
103
|
+
"properties": {
|
|
104
|
+
"supported": { "type": "boolean", "default": false },
|
|
105
|
+
"formats": {
|
|
106
|
+
"type": "array",
|
|
107
|
+
"items": { "type": "string", "enum": ["mp4", "mov", "avi", "flv", "wmv", "webm", "mkv"] },
|
|
108
|
+
"minItems": 1,
|
|
109
|
+
"uniqueItems": true,
|
|
110
|
+
"description": "Supported video formats"
|
|
111
|
+
},
|
|
112
|
+
"max_duration": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"description": "Maximum video duration (e.g. '1h')"
|
|
115
|
+
},
|
|
116
|
+
"max_file_size": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"description": "Maximum file size"
|
|
119
|
+
},
|
|
120
|
+
"frame_extraction": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"enum": ["automatic", "manual", "keyframe"],
|
|
123
|
+
"description": "How frames are extracted from video for analysis"
|
|
124
|
+
},
|
|
125
|
+
"audio_track": {
|
|
126
|
+
"type": "boolean",
|
|
127
|
+
"default": false,
|
|
128
|
+
"description": "Whether audio track in video is also processed"
|
|
129
|
+
},
|
|
130
|
+
"temporal_reasoning": {
|
|
131
|
+
"type": "boolean",
|
|
132
|
+
"default": false,
|
|
133
|
+
"description": "Can reason about temporal events and sequences in video"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"if": { "properties": { "supported": { "const": true } } },
|
|
137
|
+
"then": { "required": ["formats"] },
|
|
138
|
+
"additionalProperties": false
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"additionalProperties": false
|
|
142
|
+
},
|
|
143
|
+
"output": {
|
|
144
|
+
"type": "object",
|
|
145
|
+
"description": "Output modality configurations",
|
|
146
|
+
"properties": {
|
|
147
|
+
"text": {
|
|
148
|
+
"type": "boolean",
|
|
149
|
+
"default": true,
|
|
150
|
+
"description": "Standard text output (always true for LLMs)"
|
|
151
|
+
},
|
|
152
|
+
"audio": {
|
|
153
|
+
"type": "object",
|
|
154
|
+
"description": "Audio/speech output capabilities",
|
|
155
|
+
"properties": {
|
|
156
|
+
"supported": { "type": "boolean", "default": false },
|
|
157
|
+
"formats": {
|
|
158
|
+
"type": "array",
|
|
159
|
+
"items": { "type": "string", "enum": ["wav", "mp3", "opus", "pcm", "flac", "aac"] },
|
|
160
|
+
"minItems": 1,
|
|
161
|
+
"uniqueItems": true,
|
|
162
|
+
"description": "Output audio formats"
|
|
163
|
+
},
|
|
164
|
+
"real_time_tts": {
|
|
165
|
+
"type": "boolean",
|
|
166
|
+
"default": false,
|
|
167
|
+
"description": "Supports real-time text-to-speech streaming"
|
|
168
|
+
},
|
|
169
|
+
"natural_voice": {
|
|
170
|
+
"type": "boolean",
|
|
171
|
+
"default": false,
|
|
172
|
+
"description": "Generates natural-sounding speech (vs robotic TTS)"
|
|
173
|
+
},
|
|
174
|
+
"voice_selection": {
|
|
175
|
+
"type": "boolean",
|
|
176
|
+
"default": false,
|
|
177
|
+
"description": "Supports selecting different voice profiles"
|
|
178
|
+
},
|
|
179
|
+
"sample_rates": {
|
|
180
|
+
"type": "array",
|
|
181
|
+
"items": { "type": "integer" },
|
|
182
|
+
"description": "Supported audio sample rates in Hz (e.g. [16000, 24000, 44100])"
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"if": { "properties": { "supported": { "const": true } } },
|
|
186
|
+
"then": { "required": ["formats"] },
|
|
187
|
+
"additionalProperties": false
|
|
188
|
+
},
|
|
189
|
+
"image": {
|
|
190
|
+
"type": "object",
|
|
191
|
+
"description": "Image generation capabilities",
|
|
192
|
+
"properties": {
|
|
193
|
+
"supported": { "type": "boolean", "default": false },
|
|
194
|
+
"formats": {
|
|
195
|
+
"type": "array",
|
|
196
|
+
"items": { "type": "string", "enum": ["png", "jpeg", "webp", "svg"] },
|
|
197
|
+
"minItems": 1,
|
|
198
|
+
"uniqueItems": true,
|
|
199
|
+
"description": "Output image formats"
|
|
200
|
+
},
|
|
201
|
+
"max_resolution": {
|
|
202
|
+
"type": "string",
|
|
203
|
+
"pattern": "^\\d+x\\d+$",
|
|
204
|
+
"description": "Maximum output image resolution"
|
|
205
|
+
},
|
|
206
|
+
"styles": {
|
|
207
|
+
"type": "array",
|
|
208
|
+
"items": { "type": "string" },
|
|
209
|
+
"description": "Supported generation styles"
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"if": { "properties": { "supported": { "const": true } } },
|
|
213
|
+
"then": { "required": ["formats"] },
|
|
214
|
+
"additionalProperties": false
|
|
215
|
+
},
|
|
216
|
+
"video": {
|
|
217
|
+
"type": "object",
|
|
218
|
+
"description": "Video generation capabilities",
|
|
219
|
+
"properties": {
|
|
220
|
+
"supported": { "type": "boolean", "default": false },
|
|
221
|
+
"formats": {
|
|
222
|
+
"type": "array",
|
|
223
|
+
"items": { "type": "string", "enum": ["mp4", "webm", "mov", "gif"] },
|
|
224
|
+
"minItems": 1,
|
|
225
|
+
"uniqueItems": true,
|
|
226
|
+
"description": "Output video formats"
|
|
227
|
+
},
|
|
228
|
+
"max_duration": {
|
|
229
|
+
"type": "string",
|
|
230
|
+
"description": "Maximum output video duration (e.g. '10s', '60s')"
|
|
231
|
+
},
|
|
232
|
+
"max_resolution": {
|
|
233
|
+
"type": "string",
|
|
234
|
+
"pattern": "^\\d+x\\d+$",
|
|
235
|
+
"description": "Maximum output video resolution"
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"if": { "properties": { "supported": { "const": true } } },
|
|
239
|
+
"then": { "required": ["formats"] },
|
|
240
|
+
"additionalProperties": false
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"additionalProperties": false
|
|
244
|
+
},
|
|
245
|
+
"omni_mode": {
|
|
246
|
+
"type": "object",
|
|
247
|
+
"description": "Omni-modal configuration for simultaneous multi-modal I/O (e.g. Qwen2.5-Omni)",
|
|
248
|
+
"properties": {
|
|
249
|
+
"supported": {
|
|
250
|
+
"type": "boolean",
|
|
251
|
+
"default": false,
|
|
252
|
+
"description": "Whether the model supports simultaneous multi-modal input and output"
|
|
253
|
+
},
|
|
254
|
+
"real_time_voice_chat": {
|
|
255
|
+
"type": "boolean",
|
|
256
|
+
"default": false,
|
|
257
|
+
"description": "Supports real-time voice conversation (audio in 鈫?speech out)"
|
|
258
|
+
},
|
|
259
|
+
"streaming_multimodal": {
|
|
260
|
+
"type": "boolean",
|
|
261
|
+
"default": false,
|
|
262
|
+
"description": "Supports streaming of multiple output modalities simultaneously"
|
|
263
|
+
},
|
|
264
|
+
"input_modalities": {
|
|
265
|
+
"type": "array",
|
|
266
|
+
"items": { "type": "string", "enum": ["text", "image", "audio", "video"] },
|
|
267
|
+
"uniqueItems": true,
|
|
268
|
+
"description": "Simultaneous input modalities supported in omni mode"
|
|
269
|
+
},
|
|
270
|
+
"output_modalities": {
|
|
271
|
+
"type": "array",
|
|
272
|
+
"items": { "type": "string", "enum": ["text", "audio", "image"] },
|
|
273
|
+
"uniqueItems": true,
|
|
274
|
+
"description": "Simultaneous output modalities supported in omni mode"
|
|
275
|
+
},
|
|
276
|
+
"chunk_processing": {
|
|
277
|
+
"type": "object",
|
|
278
|
+
"description": "Block-wise processing configuration for real-time streaming",
|
|
279
|
+
"properties": {
|
|
280
|
+
"enabled": { "type": "boolean", "default": false },
|
|
281
|
+
"chunk_duration_ms": {
|
|
282
|
+
"type": "integer",
|
|
283
|
+
"minimum": 10,
|
|
284
|
+
"description": "Processing chunk duration in milliseconds"
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
"additionalProperties": false
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
"if": { "properties": { "supported": { "const": true } } },
|
|
291
|
+
"then": { "required": ["input_modalities", "output_modalities"] },
|
|
292
|
+
"additionalProperties": false
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
"additionalProperties": false
|
|
296
|
+
}
|
|
297
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v2/pricing.json",
|
|
4
|
+
"title": "Provider Pricing",
|
|
5
|
+
"description": "Optional pricing metadata for cost estimation (per 1k tokens)",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"input_per_1k_tokens": { "type": "number", "minimum": 0 },
|
|
9
|
+
"output_per_1k_tokens": { "type": "number", "minimum": 0 },
|
|
10
|
+
"currency": { "type": "string", "default": "USD" },
|
|
11
|
+
"last_updated": { "type": "string", "format": "date" }
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|