From 2df7529b5eca5d12df9be600db5643d000cbd362 Mon Sep 17 00:00:00 2001 From: Thibaut Patel Date: Thu, 4 Apr 2024 11:24:02 +0200 Subject: [PATCH] rename the Literal env variable to LITERAL_API_URL (#870) - backward compatible as `LITERAL_SERVER` is used as fallback --- CHANGELOG.md | 4 +++- backend/chainlit/data/__init__.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed9a0b2067..fc1b9fe5cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] -Nothing is unreleased! +### Changed + +- Renamed the Literal environment variable to `LITERAL_API_URL` (it used to be `LITERAL_SERVER`) ## [1.0.500] - 2024-04-02 diff --git a/backend/chainlit/data/__init__.py b/backend/chainlit/data/__init__.py index 19ee762cd0..729af04cd6 100644 --- a/backend/chainlit/data/__init__.py +++ b/backend/chainlit/data/__init__.py @@ -466,7 +466,8 @@ async def update_thread( if api_key := os.environ.get("LITERAL_API_KEY"): - server = os.environ.get("LITERAL_SERVER") + # support legacy LITERAL_SERVER variable as fallback + server = os.environ.get("LITERAL_API_URL", os.environ.get("LITERAL_SERVER")) _data_layer = ChainlitDataLayer(api_key=api_key, server=server)