mirror of
https://github.com/morgan9e/chatgpt-web
synced 2026-04-14 00:14:04 +09:00
make token env var optional with defult value
This commit is contained in:
2
.env
2
.env
@@ -2,4 +2,4 @@
|
|||||||
#VITE_API_BASE=http://localhost:5174
|
#VITE_API_BASE=http://localhost:5174
|
||||||
#VITE_ENDPOINT_COMPLETIONS=/v1/chat/completions
|
#VITE_ENDPOINT_COMPLETIONS=/v1/chat/completions
|
||||||
#VITE_ENDPOINT_MODELS=/v1/models
|
#VITE_ENDPOINT_MODELS=/v1/models
|
||||||
OPENAI_API_KEY="your-openai-api-key"
|
#OPENAI_API_KEY="your-openai-api-key"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
export const chatsStorage = persisted('chats', [] as Chat[])
|
export const chatsStorage = persisted('chats', [] as Chat[])
|
||||||
export const latestModelMap = persisted('latestModelMap', {} as Record<Model, Model>) // What was returned when a model was requested
|
export const latestModelMap = persisted('latestModelMap', {} as Record<Model, Model>) // What was returned when a model was requested
|
||||||
export const globalStorage = persisted('global', {} as GlobalSettings)
|
export const globalStorage = persisted('global', {} as GlobalSettings)
|
||||||
const apiKeyFromEnv = import.meta.env.OPENAI_API_KEY
|
const apiKeyFromEnv = import.meta.env.OPENAI_API_KEY || 'some default token'
|
||||||
export const apiKeyStorage = persisted('apiKey', apiKeyFromEnv as string)
|
export const apiKeyStorage = persisted('apiKey', apiKeyFromEnv as string)
|
||||||
export let checkStateChange = writable(0) // Trigger for Chat
|
export let checkStateChange = writable(0) // Trigger for Chat
|
||||||
export let showSetChatSettings = writable(false) //
|
export let showSetChatSettings = writable(false) //
|
||||||
|
|||||||
Reference in New Issue
Block a user