Query available resources for agent construction¶
Read the resource collection in the current workspace that can be used to build the agent.
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/agent-builder/resources
Preparation before calling¶
Prepare a personal access token and target workspace ID that has 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 through theX-Workspace-IDHeader and also asworkspace_idin the path.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/agent-builder/resources" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
Workspace ID. |
Successful response¶
Returns 200 on success. Use this response as resources in the candidate request and do not construct the resource reference yourself.
{
"code": 0,
"data": {
"models": [
{
"name": "<MODEL_NAME>",
"model_config_ref": "mc_01"
}
],
"tools": [
{
"name": "<TOOL_NAME>"
}
],
"skills": [
{
"name": "<SKILL_NAME>"
}
],
"knowledge_bases": [
{
"name": "<KNOWLEDGE_BASE_NAME>"
}
]
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
array |
The models, tools, skills and knowledge base that can be used to build in the current workspace. |
|
array |
The models, tools, skills and knowledge base that can be used to build in the current workspace. |
|
array |
The models, tools, skills and knowledge base that can be used to build in the current workspace. |
|
array |
The models, tools, skills and knowledge base that can be used to build in the current workspace. |
|
string |
The name used by the candidate configuration to reference the resource. |
|
string |
The model configuration, model name, and display name that the model item can return. |
|
string |
The model configuration, model name, and display name that the model item can return. |
|
string |
The model configuration, model name, and display name that the model item can return. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Error response¶
{
"code": 5,
"message": "<错误信息>"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current identity does not have permission to build an agent. |
Check workspace authorization. |
|
|
The list of available resources exceeds the size allowed by the interface. |
Narrow down the resource scope and try again. |
|
|
Failed to read resource list. |
Try again later; contact support if it continues to fail. |
|
|
The authoring resource service or licensing dependency is unavailable. |
Try again later. |
Follow-up operations¶
Use the resource list Generate agent candidate solutions.