GHHG10/CodeServer / opencode /packages /core /src /github-copilot /responses /map-openai-responses-finish-reason.ts
GHHG10's picture
download
raw
656 Bytes
import type { LanguageModelV3FinishReason } from "@ai-sdk/provider"
export function mapOpenAIResponseFinishReason({
finishReason,
hasFunctionCall,
}: {
finishReason: string | null | undefined
// flag that checks if there have been client-side tool calls (not executed by openai)
hasFunctionCall: boolean
}): LanguageModelV3FinishReason["unified"] {
switch (finishReason) {
case undefined:
case null:
return hasFunctionCall ? "tool-calls" : "stop"
case "max_output_tokens":
return "length"
case "content_filter":
return "content-filter"
default:
return hasFunctionCall ? "tool-calls" : "other"
}
}

Xet Storage Details

Size:
656 Bytes
·
Xet hash:
d82eafc447908cc311afd35e42bab27a708198440652fdbc4fc8a5ca36d18794

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