算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
design-a2a-agent-card【设计与创意】Design an A2A Agent Card (.well-known/agent.json) manifest describing agent capabilities, skills, authentication requirements, and supported content types. Use when building an agent that must be discoverable by other A2A-compliant agents, exposing capabilities for multi-agent orchestration, migrating an existing agent to the A2A protocol, defining t…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
建合標之 A2A Agent Card,以告代理之身分、技能、認證需求與能力,供他代理發現。
none、oauth2、oidc、api-key)text/plain 之受支援內容類型(如 image/png、application/json)1.1. 擇代理身分欄位:
{
"name": "data-analysis-agent",
"description": "Performs statistical analysis, data visualization, and report generation on tabular datasets.",
"url": "https://agent.example.com",
"provider": {
"organization": "Example Corp",
"url": "https://example.com"
},
"version": "1.0.0"
}
1.2. 書清晰、可執行之述,答:
1.3. 設代理卡將供應於 /.well-known/agent.json 之標準 URL。
預期: 完整之身分區塊,含名、述、URL、提供者、版本。
失敗時: 若代理服多領域,慮其宜為一代理具多技能,抑或多代理具聚焦範圍。A2A 偏好聚焦代理具明界。
2.1. 定代理可行之每一技能:
{
"skills": [
{
"id": "analyze-dataset",
"name": "Analyze Dataset",
"description": "Run descriptive statistics, correlation analysis, or hypothesis tests on a CSV dataset.",
"tags": ["statistics", "data-analysis", "csv"],
"examples": [
"Analyze the correlation between columns A and B in my dataset",
"Run a t-test comparing group 1 and group 2"
],
"inputModes": ["text/plain", "application/json"],
"outputModes": ["text/plain", "application/json", "image/png"]
},
{
"id": "generate-chart",
"name": "Generate Chart",
"description": "Create bar, line, scatter, or histogram charts from tabular data.",
"tags": ["visualization", "charts"],
"examples": [
"Create a scatter plot of height vs weight",
"Generate a histogram of the age column"
],
"inputModes": ["text/plain", "application/json"],
"outputModes": ["image/png", "image/svg+xml"]
}
]
}
2.2. 為每技能提供:
2.3. 確保技能邊界明確且不重疊。每任務應精確對映至一技能。
預期: 技能陣列,每條目具 id、name、description、tags、examples、I/O 模式。
失敗時: 若技能重疊顯著,合之為單一較廣技能具更多例。若技能過廣,分之為聚焦之子技能。
3.1. 依部署情境定認證方案:
無認證(本地/可信網路):
{
"authentication": {
"schemes": []
}
}
OAuth 2.0(生產建議):
{
"authentication": {
"schemes": ["oauth2"],
"credentials": {
"oauth2": {
"authorizationUrl": "https://auth.example.com/authorize",
"tokenUrl": "https://auth.example.com/token",
"scopes": {
"agent:invoke": "Invoke agent skills",
"agent:read": "Read task status"
}
}
}
}
}
API Key(簡易共享密鑰):
{
"authentication": {
"schemes": ["apiKey"],
"credentials": {
"apiKey": {
"headerName": "X-API-Key"
}
}
}
}
3.2. 為部署環境擇最小可行之認證:
noneapiKeyoauth2 或 oidc3.3. 於 Agent Card 之 provider 區或外部文檔載令牌/金鑰供應過程。
預期: 認證區塊合部署安全需求。
失敗時: 若 OAuth 2.0 基礎架構不可用,始以 API key 認證並計劃遷移。勿以 none 認證部署公開代理。
4.1. 宣告代理支援何等協定功能:
{
"capabilities": {
"streaming": true,
"pushNotifications": false,
"stateTransitionHistory": true
}
}
4.2. 依實作就緒度設每能力旗標:
tasks/sendSubscribe 支援 SSE 串流則 true。為長任務啟用即時進度更新。true。需代理存並回調 webhook URL。true。有益於稽核軌跡。4.3. 僅於實作全然支援時設能力為 true。廣告不支援之能力破壞互通。
預期: 能力物件具布林旗標合實際實作。
失敗時: 若不確能力將實作,設之為 false。能力可於未來版本加。移除能力為破壞性變。
5.1. 組裝完整 Agent Card:
{
"name": "data-analysis-agent",
"description": "Performs statistical analysis and visualization on tabular datasets.",
"url": "https://agent.example.com",
"version": "1.0.0",
"provider": {
"organization": "Example Corp",
"url": "https://example.com"
},
"authentication": {
"schemes": ["oauth2"],
"credentials": { ... }
},
"capabilities": {
"streaming": true,
"pushNotifications": false,
"stateTransitionHistory": true
},
"skills": [ ... ],
"defaultInputModes": ["text/plain"],
"defaultOutputModes": ["text/plain"]
}
5.2. 驗 Agent Card:
/.well-known/agent.json 供應該卡5.3. 發布 Agent Card:
https://<agent-url>/.well-known/agent.json 供應Content-Type: application/json5.4. 以取卡試發現:
curl -s https://agent.example.com/.well-known/agent.json | python3 -m json.tool
預期: 於 well-known URL 供應之有效 JSON Agent Card,任何 A2A 客戶端皆可解析。
失敗時: 若 JSON 驗證失敗,用 JSON 檢查器識語法錯。若 URL 不可達,查 DNS、SSL 憑證與 web 伺服器配置。若需 CORS,加 Access-Control-Allow-Origin 標頭。
/.well-known/agent.json 以正確 Content-Type 供應streaming: true 或 pushNotifications: true 致用該等功能時客戶端失敗。宜保守。defaultInputModes 與 defaultOutputModes,客戶端可能不知送何等內容類型。implement-a2a-server - 實作 Agent Card 背後之伺服器test-a2a-interop - 驗證 Agent Card 合規與互通build-custom-mcp-server - MCP 伺服器作 A2A 之替/補configure-mcp-server - MCP 配置模式,適用於 A2A 設定