For the complete documentation index, see llms.txt. This page is also available as Markdown.

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:

Field
Type
Required
Description

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

  • question must be a non-empty string.

  • ticker must be a non-empty string containing only uppercase letters.

  • year must be a four-digit integer (1900 or later).

  • period must be exactly one of: Q1, Q2, Q3, Q4, FY.

Response Schema

The Lambda function returns a JSON object with the following fields:

Field
Type
Description

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