Include LLM headers in ModelConfig

Merged
MI
8mo ago
+292-17

why

Custom headers for LLM requests are supported in Stagehand, canonical SDKs were not accounting for this until now.

what changed

Added headers to ModelConfig

test plan


Summary by cubic

Adds an optional headers field to ModelConfig to send custom headers with every LLM request. Also includes a patch changeset for @browserbasehq/stagehand.

  • New Features
    • Add headers?: Record<string, string> to ModelConfigObjectSchema in packages/core/lib/v3/types/public/api.ts.
    • Update packages/server-v3/openapi.v3.yaml to document headers in ModelConfig.
    • Update packages/server-v4/openapi.v4.yaml to use selector-based result/output schemas for page actions (click, hover, scroll, drag-and-drop) and add returnSelector support.