Sapience icon

Sapience

Sapience API integration

Agent → Execute System Agent

AI-generated

Summary

Execute a system agent with a user query, optionally specifying an output type and context.

Inputs

  • agentSelectMode (required) — Whether to select the agent from a dropdown (predefined agents) or enter the UID manually. Options: 'dropdown' (default) or 'manual'.
  • agentUid (required) — The unique identifier of the system agent. In 'dropdown' mode, choose from options like 'sys-agent-summarize' (Summarization Agent) or 'sys-agent-translate' (Translation Agent). In 'manual' mode, enter the UID directly (e.g., 'sys-agent-translate').
  • userQuery (required) — The prompt or question to send to the system agent.
  • outputType — The desired output format. Options vary by agent: for the Agent Builder Assistant, fixed to 'agent_instructions'; for the Task Breakdown Agent, fixed to 'task'; for others, choose from 'agent_instructions', 'document_translation', 'folder', 'generic', 'goal', 'page', 'project', 'task', or leave empty for plain text output.
  • context — Optional JSON object providing additional context to the agent (e.g., {'user_name': 'Ken', 'project_name': 'Birthday Party Planning'}).

Output shape

object

Returns the agent's response as a JSON object. The exact structure depends on the selected agent and output type (e.g., task objects for the Task Breakdown Agent, translated text for the Translation Agent, or plain text if outputType is omitted).

Examples

Example 1: Summarize a meeting transcript

agentSelectMode: dropdown; agentUid: sys-agent-summarize; userQuery: 'Summarize the key points from the transcript'; outputType: (empty for plain text) or 'goal' for structured output

Example 2: Extract entities from customer feedback

agentSelectMode: dropdown; agentUid: sys-agent-extract-entities; userQuery: 'Extract people, organizations, and dates from this feedback'; outputType: (empty for plain text)

Links

Discussion