fix(ai): Correctly imports generateText in openai.js, adds specific cause and reason for OpenRouter failures in the openrouter.js catch, performs complexity analysis on all tm tasks, adds new tasks to further improve the maxTokens to take input and output maximum into account. Adjusts default fallback max tokens so 3.5 does not fail.

This commit is contained in:
Eyal Toledano
2025-05-17 18:42:57 -04:00
parent 8a3b611fc2
commit 026815353f
12 changed files with 1364 additions and 304 deletions

View File

@@ -1,5 +1,5 @@
import { createOpenAI } from '@ai-sdk/openai'; // Using openai provider from Vercel AI SDK
import { generateObject } from 'ai'; // Import necessary functions from 'ai'
import { generateObject, generateText } from 'ai'; // Import necessary functions from 'ai'
import { log } from '../../scripts/modules/utils.js';
function getClient(apiKey, baseUrl) {