Skip to content

API Reference parrot_formdesigner.tools.services.abstract

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

parrot_formdesigner.tools.services.abstract

View source

AbstractFormService — strategy interface for form-source services.

Class AbstractFormService

Strategy interface for sourcing a FormSchema from any origin.

Subclasses implement two methods:

  • fetch(*, formid, orgid, **kwargs) — retrieve raw data (DB row, REST payload, …). All parameters are keyword-only.
  • to_form_schema(raw) — translate raw data into a FormSchema.

Splitting fetch from mapping keeps the schema-mapping logic testable without I/O. The FormRegistry coupling stays in DatabaseFormTool — the service must not call registry.register() itself.

Method AbstractFormService.fetch

Fetch raw form data from the underlying source.

Implementations should declare keyword-only parameters explicitly (e.g. *, formid: int, orgid: int, **kwargs: Any) and accept additional kwargs gracefully so that callers can forward extra service-specific parameters without breaking the interface.

fetch(**params: Any) -> dict[str, Any]

Parameter Type Default Description
**params Any {}

Returns: dict[str, Any]

Method AbstractFormService.to_form_schema

Translate the raw payload into a canonical FormSchema.

to_form_schema(raw: dict[str, Any]) -> FormSchema

Parameter Type Default Description
raw dict[str, Any]

Returns: FormSchema

Alias FormSchema

Re-exported from parrot_formdesigner.core.schema.FormSchema.

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