Build the Chat Form
Goal
Compose a query form from Amplify UI components that collects the four fields required by the Lambda Contract, submits them to a handler function, and renders the inference response. This page focuses on the UI layer only — connecting to the live Lambda happens in the next page.
Contract
Your form must produce a request body conforming to the Lambda Contract:
{
"question": "What were the key investments disclosed this quarter?",
"ticker": "AMZN",
"year": 2024,
"period": "Q2"
}The response shape (also defined in the contract) is:
{
"answer": "...",
"meta": {}
}Your UI renders the answer field to the user.
Required Reading
Amplify UI React introduction: https://ui.docs.amplify.aws/react/getting-started/introduction
Constraints
Use Amplify UI components (
SelectField,TextField,Button,View) — do not introduce a separate component library.The company
SelectFieldmust display human-readable names (e.g., "Apple") but your submit handler must map them to the uppercase stock ticker ("AAPL") before building the request body.The
yearfield must submit as an integer, not a string.The
periodfield must offer exactly the enum values defined in the contract:Q1,Q2,Q3,Q4,FY.Do not hardcode a Lambda endpoint in this page. Wire a stub handler that logs the request body to the console and returns a fake response. The real integration is the next page's concern.
Display a loading indicator while the handler is in flight and an error message if it rejects.
Acceptance Criteria
Hints
Last verified: 2026-06
Last updated