Commit Graph

14 Commits

Author SHA1 Message Date
ton 367ebc1c7f new_pull 2026-07-26 14:02:37 +07:00
David Brailovsky 0e6909f050 anthropic-messages: skip usage fields if empty (#6611)
fixes: #6567
2026-07-13 18:07:59 +02:00
Armin Ronacher 3d8f74357c feat(ai): support message-anchored tool loading (#6474)
This adds cache-friendly dynamic tool loading anchored to tool results. Purely additive active-tool changes are recorded with `addedToolNames`, allowing supported Anthropic and OpenAI Responses models to load tool definitions at the point they become available instead of placing them in the cached prompt prefix.

It retains safe fallback behavior for unsupported models and non-additive changes but it will wipe caches.
2026-07-10 23:52:54 +02:00
David Brailovsky 6731a0ba9e fix: send anthropic thinking blocks also when thinking text is empty (#6457)
fixes: #6376
2026-07-09 23:25:22 +02:00
Mario Zechner fbdd46389c feat(ai): add max thinking level 2026-07-09 22:30:53 +02:00
Mario Zechner 09f1059575 fix(ai): clamp streamSimple max tokens
Clamps streamSimple max-token defaults against estimated context, addressing #5595.

closes #6061
2026-06-25 14:10:28 +02:00
Mario Zechner f78b163713 fix(ai): revert minimax max token clamp 2026-06-25 13:36:04 +02:00
Mario Zechner b940c52e7e fix(ai): clamp MiniMax shared budget max tokens
closes #6061
2026-06-25 12:00:37 +02:00
Mario Zechner d7868b0998 feat(ai): add reasoning token counts to Usage
Add optional reasoning?: number to Usage as a subset of output. Populate
for Anthropic (output_tokens_details.thinking_tokens), OpenAI
Responses/Codex/Azure (output_tokens_details.reasoning_tokens), OpenAI
Completions (completion_tokens_details.reasoning_tokens), and Google
Generative AI / Vertex (thoughtsTokenCount). Bedrock Converse and Mistral
do not return a reasoning breakdown, so they stay unset.

closes #6057
2026-06-25 10:35:02 +02:00
Mario Zechner 6184307c39 fix(ai): require explicit anthropic compat metadata 2026-06-23 21:04:59 +02:00
Armin Ronacher 828493b37c fix(ai): unblock release provider tests 2026-06-23 19:57:29 +02:00
Mario Zechner 129eb460cd feat(ai): complete models runtime migration 2026-06-23 15:29:46 +02:00
Mario Zechner abbd911693 Merge main into model-registry 2026-06-22 14:00:18 +02:00
Mario Zechner ba93da9a93 feat(ai): move API implementations to src/api with lazy wrappers (phase 2)
Stream implementations move from src/providers/ to src/api/, renamed by
API id (anthropic.ts -> anthropic-messages.ts, google.ts ->
google-generative-ai.ts, mistral.ts -> mistral-conversations.ts,
amazon-bedrock.ts -> bedrock-converse-stream.ts). Every module now
exports exactly stream/streamSimple; shared helpers move alongside.

New ProviderStreams dispatch contract in types.ts, lazyApi() wrapper in
api/lazy.ts, and one .lazy.ts wrapper per API. Bedrock's wrapper keeps
the node-only variable-specifier import and setBedrockProviderModule()
(now taking ProviderStreams).

providers/register-builtins.ts deleted; interim until the compat
entrypoint lands, builtin api-registry registration lives in stream.ts
and lazy wrappers are exported from the root barrel. Old per-API lazy
exports (streamAnthropic, ...) are gone; package.json subpaths retarget
to dist/api/.
2026-06-10 20:08:59 +02:00