Query the current agent configuration¶
Read the configuration view of the specified agent version in the current system.
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/agent-builder/agents/{agent_id}/versions/{version}/current-agent
Preparation before calling¶
First confirm the agent candidate, use load_version in the response as version, do not infer based on the candidate version. Prepare a personal access token with access to the target workspace, target workspace ID, agent ID, and version ID.
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.$AGENT_ID: Agent ID, asagent_idin the path.$VERSION: The version identifier to query, asversionin the path; useload_versionin the confirmation candidate response.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/agent-builder/agents/$AGENT_ID/versions/$VERSION/current-agent" \
-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. |
|
string |
Yes |
Agent ID. |
|
string |
Yes |
Version identifier. |
Query parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
The workspace to which the agent version belongs. If not provided, the current workspace is used; only the current workspace or the system workspace can be specified. |
Successful response¶
Returns 200 on success. Use load_version as version in the confirmed candidate response and do not infer from the candidate version.
{
"code": 0,
"data": {
"agent_id": "agent_01",
"name": "产品助手",
"description": "回答产品问题。",
"model_name": "<MODEL_NAME>",
"model_config_ref": "mc_01",
"tool_names": [],
"skill_names": [],
"knowledge_base_names": [],
"channel_bindings": [],
"agent_md": "<AGENT_MARKDOWN>",
"change_reason": "<CHANGE_REASON>"
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
Agent ID, name and description. |
|
string |
Agent ID, name and description. |
|
string |
Agent ID, name and description. |
|
string |
Model name and model configuration reference. |
|
string |
Model name and model configuration reference. |
|
string[] |
Tool, skill, and knowledge base names in the candidate configuration. |
|
string[] |
Tool, skill, and knowledge base names in the candidate configuration. |
|
string[] |
Tool, skill, and knowledge base names in the candidate configuration. |
|
array |
Channel binding configuration. |
|
string |
Editable agent description content and reason for change. |
|
string |
Editable agent description content and reason for change. |
[] 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 |
|---|---|---|---|
|
|
The path or |
Check version, workspace scope and package contents. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current caller does not have permission to modify the agent. |
Check workspace and agent authorizations. |
|
|
Agent version does not exist. |
Use |
|
|
Current version of editable configuration projection fails. |
Check package contents; contact support if it continues to fail. |
|
|
Smart package projection or licensing services are temporarily unavailable. |
Try again later. |
Follow-up operations¶
When the candidate content needs to be modified Regenerate agent candidate solutions.