Add reasoning_effort to chat request
Introduce a new field `reasoning_effort` to the `ChatRequest` struct. This field, set to "medium" by default, allows tuning LLM reasoning depth to balance hallucination risk against latency and token cost. This setting is specifically for Ionos' GPT-OSS reasoning models and is ignored by other OpenAI-compatible models.
This commit is contained in:
@@ -48,6 +48,10 @@ pub struct LlmSettings<'a> {
|
|||||||
struct ChatRequest<'a> {
|
struct ChatRequest<'a> {
|
||||||
model: &'a str,
|
model: &'a str,
|
||||||
temperature: f32,
|
temperature: f32,
|
||||||
|
/// Tunes reasoning depth for gpt-oss reasoning models (Ionos):
|
||||||
|
/// `low`/`medium`/`high` trade off hallucination risk against latency and
|
||||||
|
/// token cost. Ignored by non-reasoning OpenAI-compatible models.
|
||||||
|
reasoning_effort: &'static str,
|
||||||
stream: bool,
|
stream: bool,
|
||||||
messages: Vec<Message<'a>>,
|
messages: Vec<Message<'a>>,
|
||||||
}
|
}
|
||||||
@@ -91,6 +95,7 @@ pub async fn chat_once(
|
|||||||
let body = ChatRequest {
|
let body = ChatRequest {
|
||||||
model: settings.model,
|
model: settings.model,
|
||||||
temperature: settings.temperature,
|
temperature: settings.temperature,
|
||||||
|
reasoning_effort: "medium",
|
||||||
stream: false,
|
stream: false,
|
||||||
messages: vec![
|
messages: vec![
|
||||||
Message {
|
Message {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ nur der konsolidierte Text. Mehrere Absätze erlaubt. KEINE Inline-Sektionsmarke
|
|||||||
|
|
||||||
QUELLE: Das Diktat wurde automatisch transkribiert und enthält typische ASR-Fehler — phonetisch ähnliche Verwechslungen und zerschnittene Komposita (z.B. "Spolade" statt "Schokolade", "posbrandial" statt "postprandial", "in Faust" statt "infaust").
|
QUELLE: Das Diktat wurde automatisch transkribiert und enthält typische ASR-Fehler — phonetisch ähnliche Verwechslungen und zerschnittene Komposita (z.B. "Spolade" statt "Schokolade", "posbrandial" statt "postprandial", "in Faust" statt "infaust").
|
||||||
|
|
||||||
MARKIERUNGEN: ==...== signalisiert dem Arzt "bitte prüfen". Keine anderen Annotations-Formen ("(unsicher)", "[TODO]" o.ä.) verwenden.
|
MARKIERUNGEN: ==Originaltext [<Hinweistext>]== signalisiert dem Arzt "bitte prüfen". Der <Hinweistext> ist optional und beschreibt kurz, warum markiert wurde. Keine anderen Annotations-Formen ("(unsicher)", "[TODO]" o.ä.) verwenden.
|
||||||
|
|
||||||
TREUE ZUM DIKTAT (höchste Priorität — vor allen anderen Regeln):
|
TREUE ZUM DIKTAT (höchste Priorität — vor allen anderen Regeln):
|
||||||
- Diktat-Reihenfolge erhalten.
|
- Diktat-Reihenfolge erhalten.
|
||||||
|
|||||||
@@ -8,3 +8,4 @@ Klappenvitien
|
|||||||
Koronarbaum
|
Koronarbaum
|
||||||
Pumpfunktion
|
Pumpfunktion
|
||||||
Ileus
|
Ileus
|
||||||
|
Orthopnoe
|
||||||
|
|||||||
Reference in New Issue
Block a user