Commit graph

10 commits

Author SHA1 Message Date
mateo-berri
91595780ec fix(gigachat): fold cached tokens back into prompt and total token counts
GigaChat reports prompt_tokens and total_tokens after subtracting cached
tokens (the docs example is prompt_tokens=1, precached_prompt_tokens=37,
total_tokens=5, so the fields are disjoint, not a subset). Map to the
OpenAI convention by adding precached_prompt_tokens back onto prompt and
total while still surfacing it as prompt_tokens_details.cached_tokens.
2026-08-31 15:16:44 -07:00
mateo-berri
98b1e2e7b4 fix(gigachat): correct cached-token accounting, stream usage on all finish reasons, stop mutating cached request body
precached_prompt_tokens is a subset of prompt_tokens (OpenAI cached_tokens
semantics), so map it to prompt_tokens_details.cached_tokens instead of
adding it on top of prompt/total. Emit stream usage from any final chunk
carrying it rather than only finish_reason stop, which dropped tokens for
function_call and length streams. Merge auth metadata into a new dict in
the gigachat router handler instead of mutating the shared parsed-body
cache in place.
2026-08-31 14:28:30 -07:00
mateo-berri
de1f38820a fix(passthrough): flush interrupted streams on client disconnect and reuse cached gigachat http clients 2026-08-30 13:36:51 -07:00
mateo-berri
b0ce17c755 fix(gigachat): generic env-credential passthrough fallback plus type hardening
- forward unrouted /gigachat/* requests with env credentials like other passthrough providers (the old fallback returned 400 on any request without a routed model, /gigachat/models included)
- fix basedpyright budget breaches across the gigachat provider, common_request_processing, and llm_passthrough_endpoints with real narrowing, no new suppressions
- add regression tests for the fallback target, auth header, and model-less endpoints
2026-08-29 22:08:54 -07:00
KnyazSh
ef6cb77f91 fix(lint): Partly fix basedpyright lint issues 2026-08-23 19:35:51 +00:00
KnyazSh
0fc3bccef8 fix(lint): Partly fix TQ lint issues 2026-08-23 14:35:12 +00:00
KnyazSh
88747ef70c fix(test): add tests for gigachat 2026-08-23 12:03:01 +00:00
KnyazSh
b99a038ea8 fix(tests): remove stale gigachat authenticator tests from old path, add utils tests 2026-08-23 11:15:06 +00:00
KnyazSh
12c291c39d test(gigachat): add authenticator tests and update passthrough test 2026-07-08 07:11:50 +00:00
KnyazSh
0cc9147f49 Add gigachat tests 2026-06-20 22:04:59 +00:00