Fix endpoint

This commit is contained in:
Webifi 2023-06-07 11:52:08 -05:00
parent a51cea24d4
commit 867c6d7e33
2 changed files with 2 additions and 2 deletions

2
.env
View File

@ -1,4 +1,4 @@
# Uncomment the following line to use the mocked API # Uncomment the following line to use the mocked API
#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_COMPLETIONS=/v1/models #VITE_ENDPOINT_MODELS=/v1/models

View File

@ -2,7 +2,7 @@
// This makes it possible to override the OpenAI API base URL in the .env file // This makes it possible to override the OpenAI API base URL in the .env file
const apiBase = import.meta.env.VITE_API_BASE || 'https://api.openai.com' const apiBase = import.meta.env.VITE_API_BASE || 'https://api.openai.com'
const endpointCompletions = import.meta.env.VITE_ENDPOINT_COMPLETIONS || '/v1/chat/completions' const endpointCompletions = import.meta.env.VITE_ENDPOINT_COMPLETIONS || '/v1/chat/completions'
const endpointModels = import.meta.env.VITE_ENDPOINT_COMPLETIONS || '/v1/models' const endpointModels = import.meta.env.VITE_ENDPOINT_MODELS || '/v1/models'
export const getApiBase = ():string => apiBase export const getApiBase = ():string => apiBase
export const getEndpointCompletions = ():string => endpointCompletions export const getEndpointCompletions = ():string => endpointCompletions