v3

latestOpenAPI 3.1.0Proprietary2026-08-07266348629.6 KB
Agents

Suggest Agent System Prompt

Generate a starter customInstructions block for the wizard.

Same two credential shapes as /agents/validate-llm:

  • Inline - raw apiKey (+ optional baseUrl) supplied directly.
  • Saved connection - savedConnectionId references a stored llmConnection; BE loads decrypted apiKey / baseUrl / provider server-side so the browser never holds the plaintext.

Composes a meta-system-prompt + a structured user message describing the agent (type, name, description, topics, fields, tools, output schema, optional existing draft) and calls the user's own LLM. The runtime build_system_prompt already emits the per-agentType base template + schema field listing + tool signatures at deploy time, so the LLM is constrained to produce only the user-facing instructions slot - the meta-prompt enforces that explicitly. Nothing is persisted.

Per-tenant rate limit: dedicated BUCKET_PROMPT_SUGGEST bucket (30/min/tenant) separate from validate-llm, so heavy "Generate" usage (humans iterating on prompt drafts) doesn't eat into the credential-check budget. Provider failures (timeouts, 4xx, schema errors) surface as 400 with the provider's error message so the FE's existing error-extraction works unchanged.

post/agents/system-prompt-suggestion

Request body

provider'anthropic' | 'openai' | 'openai-responses' | 'ollama' | 'azure' | 'azure-openai' | 'bedrock' | 'qwen' | 'openai-compatible' required

Unified LLM provider enum.

A single AgentLlmConnection row carries one provider and a set of capabilities (chat / embedding). PROVIDER_CAPABILITIES below pins which capabilities each provider can serve — picked by the FE Connections drawer and re-validated server-side on every write.

modelstring
apiKeystring

Raw key - never stored

baseUrlstring nullable
savedConnectionIdstring nullable

If set, BE resolves provider/apiKey/baseUrl from the tenant's saved llmConnection by id and ignores the inline apiKey / baseUrl.

agentTypestring required

Agent type (e.g. react, workflow)

agentNamestring nullable
descriptionstring nullable
inputTopicsstring[]
selectedFieldsstring[]
filterSQLstring nullable

Active record-filter (matches AgentInputConfig.filterSQL). Anchors the LLM's prompt to the actual shape of records reaching the agent.

existingCustomInstructionsstring nullable

Existing draft to refine. Matches the FE textarea cap.

generationHintstring nullable

Optional one-line steer the user types into the wizard's 'Hint for AI' input. The meta-prompt already gets the agent's metadata, so this should carry use-case intent (tone, edge-case priority, what to emphasize) rather than restate the data shape.

Response

Successful Response

generatedPromptstring required
tokensIninteger required
tokensOutinteger required
modelstring required
providerstring required