mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
Central default for ChatModelId
This commit is contained in:
@@ -200,7 +200,7 @@ function copyToClipboard(text: string) {
|
||||
function prettyBaseModel(model: string | undefined): string {
|
||||
if (!model) return '';
|
||||
if (model.startsWith('gpt-4')) return 'gpt-4';
|
||||
if (model.startsWith('gpt-3.5-turbo')) return '3.5-turbo';
|
||||
if (model.startsWith('gpt-3.5-turbo')) return '3.5 Turbo';
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,8 @@ export const SystemPurposes: { [key in SystemPurposeId]: SystemPurposeData } = {
|
||||
|
||||
export type ChatModelId = 'gpt-4' | 'gpt-3.5-turbo';
|
||||
|
||||
export const defaultChatModelId: ChatModelId = 'gpt-4';
|
||||
|
||||
type ChatModelData = {
|
||||
description: string | JSX.Element;
|
||||
title: string;
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@ import * as React from 'react';
|
||||
import { create } from 'zustand';
|
||||
import { persist } from 'zustand/middleware';
|
||||
|
||||
import { ChatModelId, SystemPurposeId } from '@/lib/data';
|
||||
import { ChatModelId, defaultChatModelId, SystemPurposeId } from '@/lib/data';
|
||||
|
||||
|
||||
/// Conversations Store
|
||||
@@ -72,9 +72,9 @@ export interface DConversation {
|
||||
const createConversation = (id: string, name: string, systemPurposeId: SystemPurposeId, chatModelId: ChatModelId): DConversation =>
|
||||
({ id, name, messages: [], systemPurposeId, chatModelId, created: Date.now(), updated: Date.now() });
|
||||
|
||||
const defaultConversations: DConversation[] = [createConversation('default', 'Conversation', 'Generic', 'gpt-4')];
|
||||
const defaultConversations: DConversation[] = [createConversation('default', 'Conversation', 'Generic', defaultChatModelId)];
|
||||
|
||||
const errorConversation: DConversation = createConversation('error-missing', 'Missing Conversation', 'Developer', 'gpt-3.5-turbo');
|
||||
const errorConversation: DConversation = createConversation('error-missing', 'Missing Conversation', 'Developer', defaultChatModelId);
|
||||
|
||||
|
||||
export const useChatStore = create<ConversationsStore>()(
|
||||
|
||||
Reference in New Issue
Block a user