remove check vision model

This commit is contained in:
lloydzhou 2024-07-09 18:06:59 +08:00
parent 9d7e19cebf
commit 1149d45589
1 changed files with 2 additions and 3 deletions

View File

@ -21,7 +21,7 @@ import {
} from "@fortaine/fetch-event-source"; } from "@fortaine/fetch-event-source";
import { prettyObject } from "@/app/utils/format"; import { prettyObject } from "@/app/utils/format";
import { getClientConfig } from "@/app/config/client"; import { getClientConfig } from "@/app/config/client";
import { getMessageTextContent, isVisionModel } from "@/app/utils"; import { getMessageTextContent } from "@/app/utils";
export interface OpenAIListModelResponse { export interface OpenAIListModelResponse {
object: string; object: string;
@ -78,10 +78,9 @@ export class DoubaoApi implements LLMApi {
} }
async chat(options: ChatOptions) { async chat(options: ChatOptions) {
const visionModel = isVisionModel(options.config.model);
const messages = options.messages.map((v) => ({ const messages = options.messages.map((v) => ({
role: v.role, role: v.role,
content: visionModel ? v.content : getMessageTextContent(v), content: getMessageTextContent(v),
})); }));
const modelConfig = { const modelConfig = {