fix(llm): update router and llm_chat tool to call providers routes (#2986)

* fix(llm): update router and llm_chat tool to call providers routes

* updated failing tests
This commit is contained in:
Waleed
2026-01-24 18:50:37 -08:00
committed by GitHub
parent bcf6dc8828
commit 6f0a093869
3 changed files with 19 additions and 12 deletions

View File

@@ -71,6 +71,19 @@ vi.mock('@/executor/path')
vi.mock('@/executor/resolver', () => ({
InputResolver: vi.fn(),
}))
vi.mock('@/executor/utils/http', () => ({
buildAuthHeaders: vi.fn().mockResolvedValue({ 'Content-Type': 'application/json' }),
buildAPIUrl: vi.fn((path: string) => new URL(path, 'http://localhost:3000')),
extractAPIErrorMessage: vi.fn(async (response: Response) => {
const defaultMessage = `API request failed with status ${response.status}`
try {
const errorData = await response.json()
return errorData.error || defaultMessage
} catch {
return defaultMessage
}
}),
}))
// Specific block utilities
vi.mock('@/blocks/blocks/router')