Skip to content

Commit fc2c7f3

Browse files
committed
fix(providers): remove unused logger and dead modelInfo from fireworks
1 parent 7dd6584 commit fc2c7f3

File tree

2 files changed

+6
-24
lines changed

2 files changed

+6
-24
lines changed

apps/sim/app/api/providers/fireworks/models/route.ts

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,16 @@ interface FireworksModelsResponse {
1717
object?: string
1818
}
1919

20-
export interface FireworksModelInfo {
21-
id: string
22-
supportsStructuredOutputs?: boolean
23-
supportsTools?: boolean
24-
}
25-
2620
export async function GET(_request: NextRequest) {
2721
if (isProviderBlacklisted('fireworks')) {
2822
logger.info('Fireworks provider is blacklisted, returning empty models')
29-
return NextResponse.json({ models: [], modelInfo: {} })
23+
return NextResponse.json({ models: [] })
3024
}
3125

3226
const apiKey = env.FIREWORKS_API_KEY
3327
if (!apiKey) {
3428
logger.info('No FIREWORKS_API_KEY configured, returning empty models')
35-
return NextResponse.json({ models: [], modelInfo: {} })
29+
return NextResponse.json({ models: [] })
3630
}
3731

3832
try {
@@ -49,23 +43,14 @@ export async function GET(_request: NextRequest) {
4943
status: response.status,
5044
statusText: response.statusText,
5145
})
52-
return NextResponse.json({ models: [], modelInfo: {} })
46+
return NextResponse.json({ models: [] })
5347
}
5448

5549
const data = (await response.json()) as FireworksModelsResponse
5650

57-
const modelInfo: Record<string, FireworksModelInfo> = {}
5851
const allModels: string[] = []
59-
6052
for (const model of data.data ?? []) {
61-
const modelId = `fireworks/${model.id}`
62-
allModels.push(modelId)
63-
64-
modelInfo[modelId] = {
65-
id: modelId,
66-
supportsStructuredOutputs: true,
67-
supportsTools: true,
68-
}
53+
allModels.push(`fireworks/${model.id}`)
6954
}
7055

7156
const uniqueModels = Array.from(new Set(allModels))
@@ -76,11 +61,11 @@ export async function GET(_request: NextRequest) {
7661
filtered: uniqueModels.length - models.length,
7762
})
7863

79-
return NextResponse.json({ models, modelInfo })
64+
return NextResponse.json({ models })
8065
} catch (error) {
8166
logger.error('Error fetching Fireworks models', {
8267
error: error instanceof Error ? error.message : 'Unknown error',
8368
})
84-
return NextResponse.json({ models: [], modelInfo: {} })
69+
return NextResponse.json({ models: [] })
8570
}
8671
}

apps/sim/providers/fireworks/utils.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import { createLogger } from '@sim/logger'
21
import type { ChatCompletionChunk } from 'openai/resources/chat/completions'
32
import type { CompletionUsage } from 'openai/resources/completions'
43
import { checkForForcedToolUsageOpenAI, createOpenAICompatibleStream } from '@/providers/utils'
54

6-
const logger = createLogger('FireworksUtils')
7-
85
/**
96
* Checks if a model supports native structured outputs (json_schema).
107
* Fireworks AI supports structured outputs across their inference API.

0 commit comments

Comments
 (0)