fix(chart): use 'chat' lane instead of invalid 'suggest-charts'
The AI router only supports lanes: 'chat', 'tags', 'embedding'. 'suggest-charts' was not a valid lane causing 500 errors. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -46,7 +46,7 @@ export async function POST(req: Request) {
|
|||||||
// 1.5 Quota check
|
// 1.5 Quota check
|
||||||
try {
|
try {
|
||||||
const sysConfigEarly = await getSystemConfig()
|
const sysConfigEarly = await getSystemConfig()
|
||||||
const { usedByok: willUseByok } = await willUseByokForLane('suggest-charts', sysConfigEarly, userId)
|
const { usedByok: willUseByok } = await willUseByokForLane('chat', sysConfigEarly, userId)
|
||||||
console.log('[suggest-charts] BYOK:', willUseByok)
|
console.log('[suggest-charts] BYOK:', willUseByok)
|
||||||
if (!willUseByok) {
|
if (!willUseByok) {
|
||||||
await checkEntitlementOrThrow(userId, 'suggest_charts')
|
await checkEntitlementOrThrow(userId, 'suggest_charts')
|
||||||
@@ -95,7 +95,7 @@ export async function POST(req: Request) {
|
|||||||
let sysConfig, provider, model
|
let sysConfig, provider, model
|
||||||
try {
|
try {
|
||||||
sysConfig = await getSystemConfig()
|
sysConfig = await getSystemConfig()
|
||||||
const result = await resolveAiRouteWithTiming('suggest-charts', sysConfig)
|
const result = await resolveAiRouteWithTiming('chat', sysConfig)
|
||||||
provider = result.provider
|
provider = result.provider
|
||||||
model = result.model
|
model = result.model
|
||||||
console.log('[suggest-charts] AI model:', model)
|
console.log('[suggest-charts] AI model:', model)
|
||||||
|
|||||||
Reference in New Issue
Block a user