fix(types): narrow provider auth metadata

This commit is contained in:
Vincent Koc
2026-06-10 23:33:57 +09:00
parent 9db8601235
commit e7136005eb

View File

@@ -945,7 +945,11 @@ function createClient(
return { client, isOAuthToken: false };
}
if (model.provider === "microsoft-foundry" && model.authHeader === true) {
const foundryAuthHeader =
model.provider === "microsoft-foundry"
? (model as Model<"anthropic-messages"> & { authHeader?: unknown }).authHeader
: undefined;
if (foundryAuthHeader === true) {
const client = new Anthropic({
apiKey: null,
authToken: apiKey,