[STG-1573] Add providerOptions for extensible model auth
Merged
BB
8mo ago+2646+2646+0123456789012345678901234567890123456789-175-175-012345678901234567890123456789
Summary
- Add
providerOptionsbag to model config schema for provider-specific auth (Bedrock, Vertex, future providers) without polluting the shared schema with vendor-specific fields - Make
modelApiKeyoptional so providers with non-API-key auth (e.g. AWS SigV4) can work without it - Server stores
modelClientOptionsfrom session start and reuses them on subsequent act/observe/extract/execute calls — SDKs don't need to reimplement this logic - Send
modelClientOptions(includingproviderOptions) in the session start request body; server merges stored + per-request config
What this enables
- Bedrock: pass
region,accessKeyId,secretAccessKey,sessionTokenviaproviderOptions - Vertex: pass
project,location,googleAuthOptionsviaproviderOptions - Future providers: any provider with non-standard auth just adds fields to
providerOptions— zero schema or server changes needed
Architecture
SDK Server AI SDK
───────────────────────── ───────────────────────── ──────────────
modelClientOptions: { Stores in session, createAmazonBedrock({
apiKey?, merges on each request, apiKey,
providerOptions: { ──► passes to V3 constructor ──► region,
region, accessKeyId,
accessKeyId, Server is vendor-agnostic: secretAccessKey,
... just passes providerOptions ...
} through unchanged })
}