GHHG10/CodeServer / opencode /packages /core /src /github-copilot /chat /map-openai-compatible-finish-reason.ts
GHHG10's picture
download
raw
481 Bytes
import type { LanguageModelV3FinishReason } from "@ai-sdk/provider"
export function mapOpenAICompatibleFinishReason(
finishReason: string | null | undefined,
): LanguageModelV3FinishReason["unified"] {
switch (finishReason) {
case "stop":
return "stop"
case "length":
return "length"
case "content_filter":
return "content-filter"
case "function_call":
case "tool_calls":
return "tool-calls"
default:
return "other"
}
}

Xet Storage Details

Size:
481 Bytes
·
Xet hash:
fc36c49dca17a80d08c90d3234035249e103422c5338d40b5e56a0c907e4a097

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.