Merged
Conversation
…elds
Add a Protocols tab to the enrichment UI that exports enriched product
data as ACP (Agentic Commerce Protocol) and UCP (Unified Commerce
Protocol) compliant JSON schemas. A single backend endpoint calls the
LLM once to extract structured attributes (brand, material, age_group,
product_details, etc.) and builds both schemas from the same extraction.
Backend:
- POST /protocols/generate endpoint returns { acp, ucp }
- _call_nemotron_extract_schema_fields() in vlm.py for LLM extraction
- _build_acp_schema() and _build_ucp_schema() with DRY helpers
- Deterministic defaults (availability, condition, adult, is_bundle)
Frontend:
- ProtocolsTabContent component with ACP/UCP sub-tabs
- Syntax-highlighted JSON with VS Code dark theme colors
- Copy-to-clipboard with feedback
- Background generation chained after FAQs (same pattern)
Tests:
- 31 unit tests for both schema builders
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /protocols/generatebackend endpoint that calls the LLM once to extract structured fields (brand, material, age_group, product_details, etc.) and builds both ACP and UCP schemasstructured_title/structured_descriptionusingdigital_source_type: "trained_algorithmic_media"Changes
Backend (3 files):
src/backend/main.py— Protocol schema builders with DRY helpers,/protocols/generateendpointsrc/backend/vlm.py—_call_nemotron_extract_schema_fields()for LLM-based attribute extractionFrontend (4 files):
src/ui/components/ProtocolsTabContent.tsx— New component with segmented control, syntax-highlighted JSON, copy buttonsrc/ui/components/FieldsCard.tsx— Third tab wired insrc/ui/app/page.tsx— Background protocol generation chained after FAQssrc/ui/lib/api.ts—generateProtocolSchemas()API clientTests (1 file):
tests/test_protocol_schemas.py— 31 unit tests covering enriched field population, LLM field merging, deterministic defaults, nested types, edge casesDocs (4 files):
docs/API.md— Section 6 with full endpoint spec, response schema, curl exampledocs/PRD.md— FR-13 functional requirement + implementation TODOAGENTS.md— Status line + API endpoint entryREADME.md— Key Features bullet + API Endpoints listTest plan
🤖 Generated with Claude Code