fix typescript error

This commit is contained in:
lloydzhou
2024-08-02 18:50:48 +08:00
parent 1c24ca58c7
commit 46cb48023e
5 changed files with 14 additions and 5 deletions

View File

@@ -13,6 +13,7 @@ import { useAccessStore, useAppConfig, useChatStore } from "@/app/store";
import { collectModelsWithDefaultModel } from "@/app/utils/model";
import { preProcessImageContent } from "@/app/utils/chat";
import { cloudflareAIGatewayUrl } from "@/app/utils/cloudflare";
import { DalleSize } from "@/app/typing";
import {
ChatOptions,
@@ -63,7 +64,7 @@ export interface DalleRequestPayload {
model: string;
prompt: string;
n: number;
size: "1024x1024" | "1792x1024" | "1024x1792";
size: DalleSize;
}
export class ChatGPTApi implements LLMApi {
@@ -141,7 +142,9 @@ export class ChatGPTApi implements LLMApi {
const isDalle3 = _isDalle3(options.config.model);
if (isDalle3) {
const prompt = getMessageTextContent(options.messages.slice(-1)?.pop());
const prompt = getMessageTextContent(
options.messages.slice(-1)?.pop() as any,
);
requestPayload = {
model: options.config.model,
prompt,