(mut raw: Value)
| 327 | } |
| 328 | |
| 329 | fn with_xai_provider(mut raw: Value) -> Value { |
| 330 | if let Some(obj) = raw.as_object_mut() { |
| 331 | obj.entry("provider".to_string()) |
| 332 | .or_insert_with(|| Value::String("xai".to_string())); |
| 333 | } |
| 334 | raw |
| 335 | } |
| 336 | |
| 337 | /// Map Grok's `reason` onto the `finish_reason` field used by the record pipeline. |
| 338 | fn normalize_stop_raw(mut raw: Value, reason: Option<&str>) -> Value { |