Query resource binding¶
Read the agent’s effective tools, skills, knowledge base and channel bindings, and return the parsed model and running provider information.
GET https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/agents/{agent_id}/bindings
Preparation before calling¶
First query the agent list to obtain the agent ID. Prepare the personal access token, target workspace ID, and agent 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 through theX-Workspace-IDHeader and asworkspace_idin the path.$AGENT_ID: The agent ID to query, asagent_idin the path.
Request example¶
curl "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/agents/$AGENT_ID/bindings" \
-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 |
The agent ID to be queried. |
Query parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
Workspace where the agent definition belongs. Use |
Successful response¶
Returns 200 on success. warnings means that some binding references failed to resolve, but does not mean that the entire read request failed. When there are no warnings, the field may be omitted and should be treated as an empty list.
{
"code": 0,
"data": {
"workspace_id": "ws_01",
"agent_workspace_id": "ws_01",
"agent_id": "agent_01",
"agent_version": 2,
"runtime": {
"provider": "matrixone",
"profile": "default"
},
"model": {
"model_config_ref": "mc_01"
},
"tools": [],
"skills": [],
"knowledge_bases": [],
"channel_bindings": [],
"warnings": []
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
ID of the workspace where the call is made. |
|
string |
The workspace ID to which the agent definition belongs. |
|
string |
Agent ID and resource version. |
|
integer |
Agent ID and resource version. |
|
object |
The parsed running target and model configuration. |
|
object |
The parsed running target and model configuration. |
|
object |
The parsed running provider configuration. |
|
array |
Various parsed resource bindings. Each item can include the resource ID, belonging workspace, category, status, and configuration. |
|
array |
Various parsed resource bindings. Each item can include the resource ID, belonging workspace, category, status, and configuration. |
|
array |
Various parsed resource bindings. Each item can include the resource ID, belonging workspace, category, status, and configuration. |
|
array |
Channel capability range and channel instance IDs available within this range. |
|
array of string |
Unresolved resource reference descriptions; returned only when warnings exist. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Error response¶
{
"code": 3,
"message": "<错误信息>"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
Invalid path parameter or |
Check path and query parameters. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current caller does not have permission to read the agent. |
Check the agent authorization in the workspace. |
|
|
The agent or its running provider configuration does not exist. |
Check the agent ID, belonging workspace and run target. |
|
|
The agent resource service or its authorized dependencies are temporarily unavailable. |
Try again later. |
Follow-up operations¶
When the binding range needs to be adjusted, Update resource binding; when the model needs to be changed, Update model binding.