refactor(ai-client): unify OpenAI-compatible path to AI SDK generateText
Eliminate the dual code path (raw fetch vs AI SDK) for text and vision. All providers now go through createLanguageModel() + generateText(), removing chatOpenAiCompatible/analyzeOpenAiCompatible, the manual Usage type, summarizeUsage, and responseFormat plumbing from 8 call sites. Key fix: @ai-sdk/openai v3 defaults to the Responses API (/responses); DeepSeek only supports Chat Completions, so we use .chat() explicitly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -55,7 +55,6 @@ export async function POST(req: Request) {
|
||||
config.vision,
|
||||
body.imageDataUrl,
|
||||
STYLE_EXTRACTION_PROMPT,
|
||||
{ responseFormat: "json_object" },
|
||||
);
|
||||
|
||||
let parsed: { stylePrompt?: string };
|
||||
|
||||
Reference in New Issue
Block a user