Skip to content

Commit

Permalink
Merge pull request #462 from XMCyber/get-apikey-from-env-var
Browse files Browse the repository at this point in the history
get-apikey-from-env-var
  • Loading branch information
Niek authored May 23, 2024
2 parents 01bfea7 + 6d60fc2 commit af10178
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
#VITE_API_BASE=http://localhost:5174
#VITE_ENDPOINT_COMPLETIONS=/v1/chat/completions
#VITE_ENDPOINT_MODELS=/v1/models
#OPENAI_API_KEY="your-openai-api-key"
3 changes: 2 additions & 1 deletion src/lib/Storage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
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 globalStorage = persisted('global', {} as GlobalSettings)
export const apiKeyStorage = persisted('apiKey', '' as string)
const apiKeyFromEnv = import.meta.env.OPENAI_API_KEY || ''
export const apiKeyStorage = persisted('apiKey', apiKeyFromEnv as string)
export let checkStateChange = writable(0) // Trigger for Chat
export let showSetChatSettings = writable(false) //
export let submitExitingPromptsNow = writable(false) // for them to go now. Will not submit anything in the input
Expand Down

0 comments on commit af10178

Please sign in to comment.