Load the agent package¶
Verify and load the .moiagent agent package into the target workspace.
POST https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/agent-packages/load
Before you call¶
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.$PACKAGE_FILE: Local.moiagentagent package path, uploaded in binary request body.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/agent-packages/load" -H "X-API-Key: $AI_STUDIO_API_KEY" -H "X-Workspace-ID: $WORKSPACE_ID" -H 'Content-Type: application/octet-stream' --data-binary "@$PACKAGE_FILE"
Successful response¶
Returns 201, load plan, and loaded agent version on success.
{
"code": 0,
"data": {
"plan": {
"workspace_id": "ws_01",
"agent_id": "agent_01",
"agent_version": "1.0.0",
"source_digest": "sha256:...",
"status": "validated"
},
"version": {
"agent_id": "agent_01",
"version": "1.0.0",
"status": "runnable"
}
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
object |
Agent package loading plan. |
|
string |
Target workspace ID. |
|
string |
Agent ID. |
|
string |
The agent version declared in the package. |
|
string |
Summary of package contents. |
|
object |
List of resource files in the package. |
|
string |
Load plan status. |
|
array |
Diagnostic information; does not return when no diagnosis is generated. |
|
object |
The loaded agent version. |
|
string |
The agent ID to which the loaded version belongs. |
|
string |
The loaded version identifier. |
|
string |
A summary of the version’s package contents. |
|
string |
Minimum MOI version required by the package. |
|
object |
Package list. |
|
string |
Loaded version status. |
|
array |
Version diagnostic information; does not return when no diagnosis is generated. |
|
string |
The user ID who loaded this version. |
|
string |
Loading time. |
Error response¶
{"code":2,"message":"invalid agent package"}