From 30dfa4fda433069a88714d9b0abe0d60b80eff51 Mon Sep 17 00:00:00 2001 From: Gaoyao Massimo Hu Date: Wed, 23 Oct 2024 16:36:12 +0100 Subject: [PATCH 1/3] chore: Add environment variables for OpenAI API Like integration --- .env.example | 8 ++++++++ app/components/chat/BaseChat.tsx | 13 ++++++++----- app/lib/.server/llm/api-key.ts | 11 +++++++++++ app/lib/.server/llm/model.ts | 13 +++++++++++-- app/utils/constants.ts | 33 ++++++++++++++++++++++++++++++-- vite.config.ts | 1 + worker-configuration.d.ts | 2 ++ 7 files changed, 72 insertions(+), 9 deletions(-) diff --git a/.env.example b/.env.example index 968e93484..2fa90e447 100644 --- a/.env.example +++ b/.env.example @@ -29,5 +29,13 @@ GOOGLE_GENERATIVE_AI_API_KEY= # EXAMPLE http://localhost:11434 OLLAMA_API_BASE_URL= +# You only need this environment variable set if you want to use OpenAI API Like models +# EXAMPLE https://xxx.xxxx.com/v1 +OPENAI_API_LIKE_BASE_URL= + +# Get your OpenAI API Like Key by following these instructions - +# https://help.openai.com/en/articles/4936850-where-do-i-find-my-openai-api-key +OPENAI_API_LIKE_KEY= + # Include this environment variable if you want more logging for debugging locally VITE_LOG_LEVEL=debug diff --git a/app/components/chat/BaseChat.tsx b/app/components/chat/BaseChat.tsx index b7421349e..bb0670650 100644 --- a/app/components/chat/BaseChat.tsx +++ b/app/components/chat/BaseChat.tsx @@ -28,7 +28,7 @@ const ModelSelector = ({ model, setModel, modelList, providerList }) => { const [provider, setProvider] = useState(DEFAULT_PROVIDER); return (
-