Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure environment variables for proxy #97

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ The following environment variables are required to run the application:
- `RAG_AZURE_OPENAI_ENDPOINT`: (Optional) The endpoint URL for Azure OpenAI service, including the resource.
- Example: `https://YOUR_RESOURCE_NAME.openai.azure.com`.
- Note: `AZURE_OPENAI_ENDPOINT` will work but `RAG_AZURE_OPENAI_ENDPOINT` will override it in order to not conflict with LibreChat setting.
- `RAG_AZURE_OPENAI_BASEURL`: (Optional) The base URL for your Azure OpenAI API Embeddings
- `RAG_AZURE_OPENAI_PROXY`: (Optional) Proxy for Azure OpenAI API Embeddings
- `HF_TOKEN`: (Optional) if needed for `huggingface` option.
- `OLLAMA_BASE_URL`: (Optional) defaults to `http://ollama:11434`.
- `ATLAS_SEARCH_INDEX`: (Optional) the name of the vector search index if using Atlas MongoDB, defaults to `vector_index`
Expand Down
4 changes: 4 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ async def dispatch(self, request, call_next):
RAG_AZURE_OPENAI_ENDPOINT = get_env_variable(
"RAG_AZURE_OPENAI_ENDPOINT", AZURE_OPENAI_ENDPOINT
).rstrip("/")
RAG_AZURE_OPENAI_BASEURL = get_env_variable("RAG_AZURE_OPENAI_BASEURL", None)
RAG_AZURE_OPENAI_PROXY = get_env_variable("RAG_AZURE_OPENAI_PROXY", None)
HF_TOKEN = get_env_variable("HF_TOKEN", "")
OLLAMA_BASE_URL = get_env_variable("OLLAMA_BASE_URL", "http://ollama:11434")
AWS_ACCESS_KEY_ID = get_env_variable("AWS_ACCESS_KEY_ID", "")
Expand All @@ -191,6 +193,8 @@ def init_embeddings(provider, model):
api_key=RAG_AZURE_OPENAI_API_KEY,
azure_endpoint=RAG_AZURE_OPENAI_ENDPOINT,
api_version=RAG_AZURE_OPENAI_API_VERSION,
openai_api_base=RAG_AZURE_OPENAI_BASEURL,
openai_proxy=RAG_AZURE_OPENAI_PROXY,
)
elif provider == EmbeddingsProvider.HUGGINGFACE:
from langchain_huggingface import HuggingFaceEmbeddings
Expand Down