Skip to main content

Module ai

Module ai 

Source
Expand description

AI-powered view generation via the Anthropic API.

Provides:

  • call_anthropic_plain: Makes a blocking request to the Anthropic Messages API, returns plain text.
  • call_anthropic_structured: Structured output via Anthropic tool_use, returns JSON string.
  • build_json_view_pass1: Builds system + user prompts for Pass 1 (plain-text plan).
  • build_json_view_pass2: Builds system + user prompts for Pass 2 (structured spec).
  • generate_json_view: Two-pass JSON-UI v2 spec generation (higher-level orchestration).

Functionsยง

build_json_view_pass1
Build Pass 1 prompts for JSON-UI v2 view generation (plain-text component plan).
build_json_view_pass2
Build Pass 2 prompts for JSON-UI v2 view generation (structured spec).
call_anthropic
call_anthropic_plain
Call the Anthropic Messages API with separate system and user prompts.
call_anthropic_structured
Call the Anthropic Messages API with structured output via tool_use.
generate_json_view
Two-pass AI generation of a JSON-UI v2 spec file.