Skip to content

API Reference parrot_formdesigner.services.remote_response_resolver

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_formdesigner.services.remote_response_resolver

View source

RemoteResponseResolver service for REMOTE_RESPONSE field type.

Calls an external API on behalf of a REMOTE_RESPONSE form field and returns the API response as the field value. Mirrors SubmissionForwarder pattern from services/forwarder.py.

No memoisation — every call hits the endpoint. Callers must ensure endpoint idempotency when repeated calls are a concern.

Alias AuthContext

Re-exported from parrot_formdesigner.services.auth_context.AuthContext.

Class RemoteResponseResolver

Resolve REMOTE_RESPONSE fields by calling an external API.

Mirrors SubmissionForwarder aiohttp + auth pattern. Every call hits the endpoint — no memoisation. Callers must ensure endpoint idempotency if needed.

Parameter Type Default Description
timeout int DEFAULT_TIMEOUT Request timeout in seconds. Defaults to DEFAULT_TIMEOUT.

Attributes:

Attribute Type Description
DEFAULT_TIMEOUT int Default request timeout in seconds (30).
timeout Configured timeout for this resolver instance.

Method RemoteResponseResolver.resolve

Call the external API and return its response as the field value.

Sends {"content": content} (plus "prompt" if present in spec) as the JSON request body for POST, or as query parameters for GET.

resolve(spec: RemoteResponseSpec, content: Any, *, auth_context: AuthContext | None = None) -> RemoteResponseResult

Parameter Type Default Description
spec RemoteResponseSpec The RemoteResponseSpec from FormField.meta.
content Any The content to send (typically from the content_field value resolved by the caller).
auth_context AuthContext | None None Optional runtime auth context for header injection.

Returns: RemoteResponseResult — RemoteResponseResult — never raises, captures all errors.

Class RemoteResponseResult

Result of a RemoteResponseResolver.resolve() call.

Fields:

Field Type Default Description
success bool True when the endpoint returned a 2xx response.
value Any | None None Parsed response value (JSON) from the endpoint.
status_code int | None None HTTP status code received from the endpoint (if any).
error str | None None Human-readable error message when success is False.

Class RemoteResponseSpec

Configuration for a REMOTE_RESPONSE field embedded in FormField.meta.

Fields:

Field Type Default Description
endpoint str URL of the external API to call.
http_method Literal['GET', 'POST'] 'POST' HTTP verb to use. Defaults to "POST".
content_field str | None None Other field ID whose value is sent as request body (resolved by the caller before invoking the resolver).
prompt str | None None Optional prompt string sent alongside content.
auth_ref str | None None Reference key into the AuthContext credentials store.
timeout_seconds int 30 Per-request timeout in seconds. Defaults to 30.
response_schema dict[str, Any] | None None Optional JSON Schema dict to validate the API response. Validation is informational — the resolver never rejects a valid 2xx.

Attribute logger

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally