api-reference: document the 8 AI SRE knowledge endpoints - #257
Merged
Conversation
Add OpenAPI operations for the app_key-callable knowledge pack and
knowledge file APIs under a new "AI SRE/Knowledge" tag:
- POST /safari/knowledge/pack/list, /get, /pack/ensure, /pack/update, /pack/delete
- POST /safari/knowledge/file/list, /file/get, /file/put
Each operation carries request/response schemas lifted from the
handlers, per-account rate limits from the gateway registry, a
Restrictions/Usage body, and real response examples captured from the
dev API. The 8 operations are merged into both safari.openapi.{en,zh}.json
and the consolidated openapi.{en,zh}.json (33 -> 41 AI SRE operations,
327 -> 335 total), the docs.json AI SRE nav gains a "Knowledge"/"知识"
subgroup, and both api-catalog pages get the matching table section.
Document POST /safari/knowledge/file/delete (knowledge-file-write-delete)
as the ninth knowledge operation, completing the app_key-callable
knowledge surface:
- FileDeleteRequest {pack_id, rel_path, force} -> FileDeleteResponse
{warnings}, lifted from the handler.
- Restrictions: write-tier rate limits (20/s, 300/min per account),
Knowledge Manage permission, audit-logged.
- Usage bullets cover idempotent deletes, the ReferenceExist/force
behavior for still-referenced files, and the pack_id default.
- Response example is a real dev-API capture (temp file created via
file/put, then deleted by the captured call).
docs.json gains the nav entry in both language subgroups; the catalogs
gain the table row and counts move to 42 AI SRE / 336 total.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds OpenAPI documentation for the eight
app_key-callable AI SRE knowledge APIs, under a new AI SRE/Knowledge tag (zh:AI SRE/知识):/safari/knowledge/pack/list/safari/knowledge/get/safari/knowledge/pack/ensure/safari/knowledge/pack/update/safari/knowledge/pack/delete/safari/knowledge/file/list/safari/knowledge/file/getcontent_b64)/safari/knowledge/file/putThe legacy
/safari/knowledge/save-from-sessionroute is notapp_key-callable and is intentionally not documented.Details
KnowledgePackItem,KnowledgeFileItem,KnowledgeWarning+ per-operation request/response schemas); epoch-millisecond fields are described as Unix timestamps in milliseconds so SDK generators map them correctly.safari.openapi.{en,zh}.json(33 → 41 paths) and the consolidatedopenapi.{en,zh}.json(327 → 335 paths); EN/ZH files are structurally identical (same operationIds, schema keys, examples).docs.json: newKnowledge/知识subgroup (iconbook) in the AI SRE group of both language navs with all 8POST /safari/knowledge/...entries.{en,zh}/openapi/api-catalog.mdx: new### Knowledge/### 知识table with 8 rows; AI SRE count 33 → 41, total 327 → 335.Validation
python3 json.loadon all four spec files +docs.json— OK.mint broken-links— no broken links found.