fix doubao and grok not upload image

This commit is contained in:
suruiqiang
2025-02-07 16:14:19 +08:00
parent add9ca200c
commit f30c6a4348
2 changed files with 8 additions and 7 deletions

View File

@@ -17,7 +17,7 @@ import {
SpeechOptions,
} from "../api";
import { getClientConfig } from "@/app/config/client";
import { getMessageTextContent } from "@/app/utils";
import { preProcessImageContent } from "@/app/utils/chat";
import { RequestPayload } from "./openai";
import { fetch } from "@/app/utils/stream";
@@ -62,7 +62,7 @@ export class XAIApi implements LLMApi {
async chat(options: ChatOptions) {
const messages: ChatOptions["messages"] = [];
for (const v of options.messages) {
const content = getMessageTextContent(v);
const content = await preProcessImageContent(v.content);
messages.push({ role: v.role, content });
}