Query skill files¶
Lists static file metadata imported with skill packs. This interface only queries the skills in the current workspace and will not fall back to system skills.
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/skills/{skill_id}/files
Before you call¶
First query the skill list or import the skill package] to obtain the skill ID. Prepare the personal access token, target workspace ID, and skill ID that have access to the target workspace.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.$SKILL_ID: Skill ID.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/skills/$SKILL_ID/files" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
The current workspace ID. |
|
string |
Yes |
Skill ID. |
Successful response¶
Returns 200 on success.
{
"code": 0,
"data": {
"items": [
{
"file_path": "references/guide.md",
"file_kind": "reference",
"media_type": "text/markdown",
"sha256": "abc123",
"size_bytes": 1024
}
],
"total": 1
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
array |
Skill package static file metadata. |
|
string |
The relative path of the file in the skill package. |
|
string |
File category. |
|
string |
File media type. |
|
string |
SHA-256 digest of the file contents. |
|
integer |
File size (bytes). |
|
integer |
Number of files. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Error response¶
{
"code": 3,
"message": "<错误信息>",
"details": {
"reason": "SKILL_PACKAGE_FILE_NOT_FOUND"
}
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The path parameter is invalid. |
Check workspace and skill IDs. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current identity does not have permission to read the skill file. |
Check workspace authorization. |
|
|
The skill does not exist, or there is no readable file for the skill. |
Check the skill ID; verify that the skill is imported from a skill pack and contains static files. |
|
|
Skill pack storage is unavailable. |
Try again later. |
Follow-up operations¶
After saving the target file identification, you can Download skill file; when you need overall skill information, Query skill details.