Skip to content

Commit 3a8e37a

Browse files
committed
fix: chatPrice type
1 parent bf1428e commit 3a8e37a

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/components/Settings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1450,7 +1450,7 @@ export default (props: {}) => {
14501450
variant="destructive"
14511451
className="w-full"
14521452
onClick={() => {
1453-
chatStore.chatPrice = null;
1453+
chatStore.chatPrice = undefined;
14541454
setChatStore({ ...chatStore });
14551455
}}
14561456
>

src/types/chatstore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export interface ChatStore {
4444
json_mode: boolean;
4545
logprobs: boolean;
4646
contents_for_index: string[];
47-
chatPrice: ModelPricing | null;
47+
chatPrice?: ModelPricing;
4848
}
4949

5050
export interface TemplateChatStore extends ChatStore {

src/types/newChatstore.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
CHATGPT_API_WEB_VERSION,
55
} from "@/const";
66
import { ChatStore, ChatStoreMessage } from "@/types/chatstore";
7-
import { models } from "@/types/models";
7+
import { ModelPricing, models } from "@/types/models";
88

99
interface NewChatStoreOptions {
1010
apiKey?: string;
@@ -36,6 +36,7 @@ interface NewChatStoreOptions {
3636
logprobs?: boolean;
3737
maxTokens?: number;
3838
use_this_history?: ChatStoreMessage[];
39+
chatPrice?: ModelPricing;
3940
}
4041

4142
export const newChatStore = (options: NewChatStoreOptions): ChatStore => {
@@ -82,5 +83,6 @@ export const newChatStore = (options: NewChatStoreOptions): ChatStore => {
8283
tts_format: options.tts_format ?? "mp3",
8384
logprobs: options.logprobs ?? false,
8485
contents_for_index: [],
86+
chatPrice: options.chatPrice ?? undefined,
8587
};
8688
};

0 commit comments

Comments
 (0)