跳到主要内容

aiPreferencesGetToolPermissionMode

AiChatToolPermissionMode aiPreferencesGetToolPermissionMode(entityId)

GET /api/2.0/ai/preferences/get-tool-permission-mode

Get tool permission mode

Returns how a tool call the model makes is approved for the calling user, in the chat library's spelling: ask prompts for every call bar the tools pinned as always allowed, auto also runs a tool that opted out of approval itself or is annotated read-only / non-destructive, allow runs everything without asking. The mode is one value per user, stored in the user's AI settings (the same value GET api/2.0/ai/config/tool-mode reports as the AI service's enum); entityId is accepted for symmetry with the depth routes and ignored. The AI service's default is auto.

Parameters​

NameInTypeDescriptionNotes
entityIdqueryStringThe DocSpace entity the request is scoped to - the room, folder or agent workspace the chat is invoked from. Omit for the portal-wide scope.[optional] [example: 1234]

Responses​

Status codeDescriptionTypeResponse headers
200The mode in force for the scope, as a bare JSON string, falling back to ask when none is stored.AiChatToolPermissionMode-
401Missing asc_auth_key cookie or Authorization header.AiErrorResponse-
403AI is disabled for this portal, the caller is a guest, or the room named by entityId is one the caller cannot open. Relayed from the DocSpace AI service or the Files API.AiErrorResponse-
500Unhandled failure. The reason is logged server-side and never echoed back.AiErrorResponse-

Return type​

AiChatToolPermissionMode

Authorization​

cookieAuth, bearerAuth

HTTP request headers​

  • Content-Type: Not defined
  • Accept: application/json