mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-09-23 20:50:08 +08:00
fix typescript error
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
ServiceProvider,
|
||||
} from "../constant";
|
||||
import { ChatMessage, ModelType, useAccessStore, useChatStore } from "../store";
|
||||
import { ChatGPTApi } from "./platforms/openai";
|
||||
import { ChatGPTApi, DalleRequestPayload } from "./platforms/openai";
|
||||
import { GeminiProApi } from "./platforms/google";
|
||||
import { ClaudeApi } from "./platforms/anthropic";
|
||||
import { ErnieApi } from "./platforms/baidu";
|
||||
@@ -42,6 +42,7 @@ export interface LLMConfig {
|
||||
stream?: boolean;
|
||||
presence_penalty?: number;
|
||||
frequency_penalty?: number;
|
||||
size?: DalleRequestPayload["size"];
|
||||
}
|
||||
|
||||
export interface ChatOptions {
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user