Lambda Contract
This page defines the canonical request and response schema for the course Lambda function. Every project page that specifies Lambda input or output links here and conforms to this schema.
Request Schema
The Lambda function accepts a JSON object with the following fields:
question
string
yes
The natural-language question to answer
ticker
string
yes
Stock ticker symbol (e.g., "AAPL")
year
integer
yes
Filing year in four-digit format (e.g., 2024)
period
enum
yes
Filing period: "Q1", "Q2", "Q3", "Q4", or "FY"
Field rules
questionmust be a non-empty string.tickermust be a non-empty string containing only uppercase letters.yearmust be a four-digit integer (1900 or later).periodmust be exactly one of:Q1,Q2,Q3,Q4,FY.
Response Schema
The Lambda function returns a JSON object with the following fields:
answer
string
The LLM-generated answer text
meta
object
Metadata about the invocation (model used, token count, latency)
Valid Example
A well-formed request and its corresponding response:
Request:
Response:
Invalid Example
A malformed request and its expected validation error:
Request (invalid):
Validation error:
The period field accepts only the five enumerated values. "Annual" is not valid; use "FY" for full-year filings.
Last updated