MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / handleLlmError

Function handleLlmError

packages/baseai/src/dev/llms/utils.ts:7–19  ·  view source on GitHub ↗
({
	error,
	provider
}: {
	error: any;
	provider: string;
})

Source from the content-addressed store, hash-verified

5import type { Pipe } from 'types/pipe';
6
7export function handleLlmError({
8 error,
9 provider
10}: {
11 error: any;
12 provider: string;
13}) {
14 dlog(`Error call-${provider}.ts:`, error);
15 throw new ApiError({
16 code: 'BAD_REQUEST',
17 message: `Error from ${provider}: ${error.message}`
18 });
19}
20
21export function applyJsonModeIfEnabled(modelParams: ModelParams, pipe: Pipe) {
22 const hasJsonMode = isJsonModeOn({

Callers 10

callGroqFunction · 0.90
callOpenAIFunction · 0.90
callTogetherFunction · 0.90
callGoogleFunction · 0.90
callOllamaFunction · 0.90
callAnthropicFunction · 0.90
callCohereFunction · 0.90
callXAIFunction · 0.90
callPerplexityFunction · 0.90
callFireworksFunction · 0.90

Calls 1

dlogFunction · 0.90

Tested by

no test coverage detected