Handle FinishReason.NO_IMAGE and fix optional chaining

- Add NO_IMAGE to error finish reasons in Google provider
- Fix non-null assertion after optional chaining in Anthropic provider
- Migrate biome config to 2.3.5
- Ignore Tailwind CSS file from biome checks
- Bump all packages to version 0.6.0
This commit is contained in:
Mario Zechner 2025-11-12 10:58:03 +01:00
parent f147109da7
commit 00d8286523
14 changed files with 1451 additions and 2843 deletions

View file

@ -111,7 +111,8 @@ export const streamAnthropic: StreamFunction<"anthropic-messages"> = (
};
try {
const { client, isOAuthToken } = createClient(model, options?.apiKey!);
const apiKey = options?.apiKey ?? getApiKey(model.provider);
const { client, isOAuthToken } = createClient(model, apiKey);
const params = buildParams(model, context, isOAuthToken, options);
const anthropicStream = client.messages.stream({ ...params, stream: true }, { signal: options?.signal });
stream.push({ type: "start", partial: output });

View file

@ -466,6 +466,7 @@ function mapStopReason(reason: FinishReason): StopReason {
case FinishReason.LANGUAGE:
case FinishReason.MALFORMED_FUNCTION_CALL:
case FinishReason.UNEXPECTED_TOOL_CALL:
case FinishReason.NO_IMAGE:
return "error";
default: {
const _exhaustive: never = reason;