feat: add agent roster observability APIs (#37566)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
zyssyz123
2026-06-17 13:22:52 +08:00
committed by GitHub
parent f992ede836
commit e970cbde0f
10 changed files with 1339 additions and 21 deletions

View File

@ -638,6 +638,26 @@ Commit an uploaded file into the Agent App drive under files/<name>
| ---- | ----------- | ------ |
| 201 | File committed into the agent drive | **application/json**: [AgentDriveFileCommitResponse](#agentdrivefilecommitresponse)<br> |
### [GET] /agent/{agent_id}/logs
#### Parameters
| Name | Located in | Description | Required | Schema |
| ---- | ---------- | ----------- | -------- | ------ |
| end | query | End date (YYYY-MM-DD HH:MM) | No | string |
| keyword | query | Search query, answer, or conversation name | No | string |
| limit | query | Page size | No | integer, <br>**Default:** 20 |
| page | query | Page number | No | integer, <br>**Default:** 1 |
| source | query | Filter by all, console/explore, api/service-api, web-app, debugger, openapi, or trigger | No | string |
| start | query | Start date (YYYY-MM-DD HH:MM) | No | string |
| status | query | Filter by success, failed, or paused | No | string |
| agent_id | path | | Yes | string |
#### Responses
| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | Agent logs | **application/json**: [AgentLogListResponse](#agentloglistresponse)<br> |
### [GET] /agent/{agent_id}/messages/{message_id}
Get Agent App message details by ID
@ -790,6 +810,22 @@ Infer CLI tool + ENV suggestions from a standardized Agent App skill
| ---- | ----------- | ------ |
| 200 | Inference result (draft suggestions, nothing persisted) | **application/json**: [SkillToolInferenceResult](#skilltoolinferenceresult)<br> |
### [GET] /agent/{agent_id}/statistics/summary
#### Parameters
| Name | Located in | Description | Required | Schema |
| ---- | ---------- | ----------- | -------- | ------ |
| end | query | End date (YYYY-MM-DD HH:MM) | No | string |
| source | query | Filter by all, console/explore, api/service-api, web-app, debugger, openapi, or trigger | No | string |
| start | query | Start date (YYYY-MM-DD HH:MM) | No | string |
| agent_id | path | | Yes | string |
#### Responses
| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | Agent monitoring summary and chart data | **application/json**: [AgentStatisticSummaryEnvelopeResponse](#agentstatisticsummaryenveloperesponse)<br> |
### [GET] /agent/{agent_id}/versions
#### Parameters
@ -11318,6 +11354,20 @@ default (the config form sends the full desired feature state on save).
| role | string | Agent role | No |
| use_icon_as_answer_icon | boolean | Use icon as answer icon | No |
#### AgentAverageResponseTimeStatisticResponse
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| date | string | | Yes |
| latency | number | | Yes |
#### AgentAverageSessionInteractionStatisticResponse
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| date | string | | Yes |
| interactions | number | | Yes |
#### AgentCliToolAuthorizationStatus
Authorization state for Agent-scoped CLI tools.
@ -11558,6 +11608,27 @@ Audit operation recorded for Agent Soul version/revision changes.
| version | integer | | Yes |
| version_note | string | | No |
#### AgentDailyConversationStatisticResponse
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| conversation_count | integer | | Yes |
| date | string | | Yes |
#### AgentDailyEndUserStatisticResponse
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| date | string | | Yes |
| terminal_count | integer | | Yes |
#### AgentDailyMessageStatisticResponse
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| date | string | | Yes |
| message_count | integer | | Yes |
#### AgentDriveDeleteFileByAgentQuery
| Name | Type | Description | Required |
@ -11797,6 +11868,41 @@ the current roster/workflow APIs scoped to Dify Agent.
| ---- | ---- | ----------- | -------- |
| AgentKnowledgeQueryMode | string | | |
#### AgentLogItemResponse
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| answer | string | | Yes |
| answer_tokens | integer | | Yes |
| conversation_id | string | | Yes |
| conversation_name | string | | No |
| created_at | integer | | No |
| currency | string | | Yes |
| error | string | | No |
| from_account_id | string | | No |
| from_end_user_id | string | | No |
| from_source | string | | No |
| id | string | | Yes |
| latency | number | | Yes |
| message_id | string | | Yes |
| message_tokens | integer | | Yes |
| query | string | | Yes |
| source | string | | No |
| status | string | | Yes |
| total_price | string | | Yes |
| total_tokens | integer | | Yes |
| updated_at | integer | | No |
#### AgentLogListResponse
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| data | [ [AgentLogItemResponse](#agentlogitemresponse) ] | | Yes |
| has_more | boolean | | Yes |
| limit | integer | | Yes |
| page | integer | | Yes |
| total | integer | | Yes |
#### AgentLogMetaResponse
| Name | Type | Description | Required |
@ -11824,6 +11930,18 @@ the current roster/workflow APIs scoped to Dify Agent.
| iterations | [ [AgentIterationLogResponse](#agentiterationlogresponse) ] | | Yes |
| meta | [AgentLogMetaResponse](#agentlogmetaresponse) | | Yes |
#### AgentLogsQuery
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| end | string | End date (YYYY-MM-DD HH:MM) | No |
| keyword | string | Search query, answer, or conversation name | No |
| limit | integer, <br>**Default:** 20 | Page size | No |
| page | integer, <br>**Default:** 1 | Page number | No |
| source | string | Filter by all, console/explore, api/service-api, web-app, debugger, openapi, or trigger | No |
| start | string | Start date (YYYY-MM-DD HH:MM) | No |
| status | string | Filter by success, failed, or paused | No |
#### AgentMemoryArtifactConfig
| Name | Type | Description | Required |
@ -12197,6 +12315,50 @@ Origin that created or imported the Agent.
| ---- | ---- | ----------- | -------- |
| AgentSource | string | Origin that created or imported the Agent. | |
#### AgentStatisticChartsResponse
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| average_response_time | [ [AgentAverageResponseTimeStatisticResponse](#agentaverageresponsetimestatisticresponse) ] | | No |
| average_session_interactions | [ [AgentAverageSessionInteractionStatisticResponse](#agentaveragesessioninteractionstatisticresponse) ] | | No |
| daily_conversations | [ [AgentDailyConversationStatisticResponse](#agentdailyconversationstatisticresponse) ] | | No |
| daily_end_users | [ [AgentDailyEndUserStatisticResponse](#agentdailyenduserstatisticresponse) ] | | No |
| daily_messages | [ [AgentDailyMessageStatisticResponse](#agentdailymessagestatisticresponse) ] | | No |
| token_usage | [ [AgentTokenUsageStatisticResponse](#agenttokenusagestatisticresponse) ] | | No |
| tokens_per_second | [ [AgentTokensPerSecondStatisticResponse](#agenttokenspersecondstatisticresponse) ] | | No |
| user_satisfaction_rate | [ [AgentUserSatisfactionRateStatisticResponse](#agentusersatisfactionratestatisticresponse) ] | | No |
#### AgentStatisticSummaryEnvelopeResponse
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| charts | [AgentStatisticChartsResponse](#agentstatisticchartsresponse) | | Yes |
| source | string | | Yes |
| summary | [AgentStatisticSummaryResponse](#agentstatisticsummaryresponse) | | Yes |
#### AgentStatisticSummaryResponse
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| average_response_time | number | | Yes |
| average_session_interactions | number | | Yes |
| currency | string | | Yes |
| tokens_per_second | number | | Yes |
| total_conversations | integer | | Yes |
| total_end_users | integer | | Yes |
| total_messages | integer | | Yes |
| total_price | string | | Yes |
| total_tokens | integer | | Yes |
| user_satisfaction_rate | number | | Yes |
#### AgentStatisticsQuery
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| end | string | End date (YYYY-MM-DD HH:MM) | No |
| source | string | Filter by all, console/explore, api/service-api, web-app, debugger, openapi, or trigger | No |
| start | string | Start date (YYYY-MM-DD HH:MM) | No |
#### AgentStatus
Soft lifecycle state for Agent records.
@ -12239,6 +12401,22 @@ Soft lifecycle state for Agent records.
| tool_input | string | | No |
| tool_labels | [JSONValue](#jsonvalue) | | Yes |
#### AgentTokenUsageStatisticResponse
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| currency | string | | Yes |
| date | string | | Yes |
| token_count | integer | | Yes |
| total_price | string | | Yes |
#### AgentTokensPerSecondStatisticResponse
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| date | string | | Yes |
| tps | number | | Yes |
#### AgentToolCallResponse
| Name | Type | Description | Required |
@ -12253,6 +12431,13 @@ Soft lifecycle state for Agent records.
| tool_output | object | | Yes |
| tool_parameters | object | | Yes |
#### AgentUserSatisfactionRateStatisticResponse
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| date | string | | Yes |
| rate | number | | Yes |
#### AllowedExtensionsResponse
| Name | Type | Description | Required |