From f020257fbe58e4feac099e2ef3b86b811ee715ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nielson=20Jann=C3=A9?= Date: Sat, 15 Mar 2025 14:12:32 +0100 Subject: [PATCH] Update readme with .env information --- README.md | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6ca699e..d7fa337 100644 --- a/README.md +++ b/README.md @@ -17,15 +17,47 @@ python generic_rag/app.py -p data # will work python generic_rag/app.py --help # will work and prints command line options ``` +## .env file + +A .env file needs to be populated to configure API end-points or local back-ends using environment variables. +Currently all required environment variables are defined in code at [backend/models.py](generic_rag/backend/models.py) +with the exception of the API key variables itself. +More information about configuring API endpoints for langchain can be found at the following locations. + +- [langchain cloud chat model doc](https://python.langchain.com/docs/integrations/chat/) +- [langchain local chat model doc](https://python.langchain.com/docs/how_to/local_llms/) +- [langchain cloud/local emb model doc](https://python.langchain.com/docs/integrations/text_embedding/) + +> for local models we currently use Ollama + + +An `.env` example is as followed. + +```text +# only need 1 backend (azure, google, local, etc) + +AZURE_OPENAI_API_KEY="" +AZURE_LLM_ENDPOINT="https://.openai.azure.com" +AZURE_LLM_DEPLOYMENT_NAME="gpt-4" +AZURE_LLM_API_VERSION="2025-01-01-preview" +AZURE_EMB_ENDPOINT="https://.openai.azure.com" +AZURE_EMB_DEPLOYMENT_NAME="text-embedding-3-large" +AZURE_EMB_API_VERSION="2023-05-15" + +LOCAL_CHAT_MODEL="llama3.1:8b" +LOCAL_EMB_MODEL="llama3.1:8b" + +# google vertex AI does not use API keys but a seperate authentication method +GOOGLE_GENAI_CHAT_MODEL="gemini-2.0-flash" +GOOGLE_GENAI_EMB_MODEL="models/text-embedding-004" +``` ## Chainlit starters Chainlit suggestions (starters) can be set with the `CHAINLIT_STARTERS` environment variable. The variable should be a JSON array of objects with `label` and `message` properties. -An example is given below +An example is as followed. ``` - CHAINLIT_STARTERS=[{"label":"Label 1","message":"Message one."},{"label":"Label 2","message":"Message two."},{"label":"Label 3","message":"Message three."}] - ```