MCPcopy Create free account
hub / github.com/InfinitiBit/graphbit / parse_finish_reason

Function parse_finish_reason

core/src/llm/openai.rs:997–1006  ·  view source on GitHub ↗
(reason: Option<&str>)

Source from the content-addressed store, hash-verified

995}
996
997fn 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)]
1009mod tests {

Callers 2

parse_responseMethod · 0.85
streamMethod · 0.85

Calls 1

to_stringMethod · 0.80

Tested by

no test coverage detected