MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / classifyChatGptOAuthStreamError

Function classifyChatGptOAuthStreamError

sdk/src/impl/llm.ts:263–284  ·  view source on GitHub ↗
(params: {
  isChatGptOAuth: boolean
  skipChatGptOAuth?: boolean
  hasYieldedContent: boolean
  error: unknown
})

Source from the content-addressed store, hash-verified

261 | 'ignore'
262
263export function classifyChatGptOAuthStreamError(params: {
264 isChatGptOAuth: boolean
265 skipChatGptOAuth?: boolean
266 hasYieldedContent: boolean
267 error: unknown
268}): ChatGptOAuthStreamErrorPolicy {
269 const { isChatGptOAuth, skipChatGptOAuth, hasYieldedContent, error } = params
270
271 if (!isChatGptOAuth || skipChatGptOAuth || hasYieldedContent) {
272 return 'ignore'
273 }
274
275 if (isOAuthRateLimitError(error)) {
276 return 'fallback-rate-limit'
277 }
278
279 if (isOAuthAuthError(error)) {
280 return 'fail-auth-reconnect'
281 }
282
283 return 'fail-fast'
284}
285
286export async function* promptAiSdkStream(
287 params: ParamsOf<PromptAiSdkStreamFn> & {

Callers 2

promptAiSdkStreamFunction · 0.85

Calls 2

isOAuthRateLimitErrorFunction · 0.85
isOAuthAuthErrorFunction · 0.85

Tested by

no test coverage detected