feat(llm): a request carries how much the model thinks, in each provider's field

LlmRequest.effort (LlmEffort: low, medium, high, xhigh, max, Anthropic's
names) goes as Anthropic's output_config.effort, as reasoning.effort to
the Responses API and OpenRouter, and as reasoning_effort to OpenAI's chat
completions, Gemini and any other host. endpoint.efforts says which
levels a host takes (Gemini low to high, Mistral none); send refuses
another before anything goes, the fake client too. LlmEffort.outputCeiling
gives the room for output each level wants, as thinking counts towards
the ceiling (Halkyon Learn's ADR 0021, D63).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-26 14:53:48 +01:00
commit 0590a4b43d
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -1,5 +1,6 @@
import 'dart:typed_data';
import 'package:halkyon_llm/src/effort.dart';
import 'package:halkyon_llm/src/endpoint.dart';
import 'package:halkyon_llm/src/failure.dart';
@ -166,9 +167,14 @@ final class const LlmRequest({
required final List<LlmMessage> messages,
/// The ceiling on the answer's tokens, which also bounds what one request
/// may cost; a model's thinking counts towards it.
/// may cost; a model's thinking counts towards it, so a higher [effort]
/// wants a higher one ([LlmEffort.outputCeiling]).
required final int maxOutputTokens,
/// How much the model thinks first; null: as much as it does by default.
/// Only a level the endpoint takes (its `efforts`).
final LlmEffort? effort,
/// What the model is told before the conversation; empty: nothing.
final String system = '',