ソース情報
- リポジトリ
- ag2ai/resource-hub
- ソースの最終更新活動
- 2026年3月19日 06:20
- 検出された SKILL.md の言語
- 英語
- スター
- 4
- フォーク
- 3
インストール方法
デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。
ソースファイルを確認
インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。
メニュー
デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。
インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
直接コマンドでは確認用 Prompt が省略されます。実行前にソースを確認してください。
npx skills add https://github.com/ag2ai/resource-hub --skill add-api-endpointコマンドは1行のまま表示されます。コピー前に横へスクロールして全体を確認してください。
ローカルで確認しますか?SkillsMP が現在取得できるファイルをダウンロードできます。
REST and WebSocket endpoint patterns, error handling, and Pydantic schema conventions for the backend
Architecture, directory layout, communication protocol, and conventions for the full-stack multi-agent application
Step-by-step guide to add a new agent to the multi-agent team
SOC 職業分類に基づく
SKILL.md を表示中
| name | add-api-endpoint |
| description | Step-by-step guide to add a new REST or WebSocket endpoint to the backend |
| license | Apache-2.0 |
backend/app/schemas.pyclass SummarizeRequest(BaseModel):
"""Request to summarize a conversation."""
conversation_id: str
class SummarizeResponse(BaseModel):
"""Summary of a conversation."""
summary: str
message_count: int
backend/app/main.pyfrom .schemas import SummarizeRequest, SummarizeResponse
@app.post("/api/summarize", response_model=SummarizeResponse)
async def summarize(req: SummarizeRequest) -> SummarizeResponse:
# Call the agent team or implement logic
responses = await run_team(f"Summarize conversation {req.conversation_id}")
return SummarizeResponse(
summary=responses[-1]["content"] if responses else "",
message_count=len(responses),
)
backend/tests/test_api.py@pytest.mark.asyncio
async def test_summarize(client: AsyncClient) -> None:
resp = await client.post("/api/summarize", json={"conversation_id": "abc"})
assert resp.status_code == 200
body = resp.json()
assert "summary" in body
const resp = await fetch("/api/summarize", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ conversation_id: id }),
});
const data = await resp.json();
The Vite proxy forwards /api requests to the backend automatically.
backend/app/main.py@app.websocket("/ws/stream")
async def stream_ws(websocket: WebSocket) -> None:
await websocket.accept()
try:
while True:
data = await websocket.receive_text()
payload = json.loads(data)
# Process and stream responses
await websocket.send_text(
AgentMessage(agent="system", content="...", type="status").model_dump_json()
)
except WebSocketDisconnect:
pass
const ws = new WebSocket(`${protocol}//${window.location.host}/ws/stream`);
ws.onmessage = (event) => {
const msg = JSON.parse(event.data);
// Handle message
};
The Vite proxy handles /ws paths — add the new path to vite.config.ts if using a different prefix.
schemas.pymain.py with response_model (REST) or structured JSON (WS)tests/test_api.py/api/ or /ws/ prefix (proxied by Vite)