(reason: Option<&str>)
| 995 | } |
| 996 | |
| 997 | fn parse_finish_reason(reason: Option<&str>) -> FinishReason { |
| 998 | match reason { |
| 999 | Some("stop") => FinishReason::Stop, |
| 1000 | Some("length") => FinishReason::Length, |
| 1001 | Some("tool_calls") => FinishReason::ToolCalls, |
| 1002 | Some("content_filter") => FinishReason::ContentFilter, |
| 1003 | Some(other) => FinishReason::Other(other.to_string()), |
| 1004 | None => FinishReason::Stop, |
| 1005 | } |
| 1006 | } |
| 1007 | |
| 1008 | #[cfg(test)] |
| 1009 | mod tests { |
no test coverage detected