[PR #54] Removing Dependence on secrets.toml for environment variables #67

Open
opened 2026-02-16 00:15:24 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/run-llama/rags/pull/54
Author: @nickknyc
Created: 12/7/2023
Status: 🔄 Open

Base: mainHead: nick-pr-envar


📝 Commits (10+)

📊 Changes

8 files changed (+504 additions, -13 deletions)

View changed files

📝 .gitignore (+2 -0)
📝 1_🏠_Home.py (+5 -1)
cache/agents/agent_ids.json (+1 -0)
content/DesignStudent.md (+470 -0)
📝 core/agent_builder/loader.py (+6 -3)
📝 core/builder_config.py (+9 -3)
📝 core/utils.py (+9 -6)
📝 requirements.txt (+2 -0)

📄 Description

Per https://github.com/run-llama/rags/issues/51 I have removed the use of st.secrets and thus the need for using a secrets.toml file.

Why
The secrets.toml is problematic when deploying to hosting other that streamlit/snowflake. In my case deploying to Azure Application Services resulted in an exposed secrets.toml. This resulted in OpenAI automagically deleting the exposed key. Which in turn made my rags deployment fail at runtime.

What
This PR has removed all of the uses of st.secrets and the secrets.toml file and instead sets up use of good old os.getenv()


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/run-llama/rags/pull/54 **Author:** [@nickknyc](https://github.com/nickknyc) **Created:** 12/7/2023 **Status:** 🔄 Open **Base:** `main` ← **Head:** `nick-pr-envar` --- ### 📝 Commits (10+) - [`5e422cb`](https://github.com/run-llama/rags/commit/5e422cb67c4cf957a9999fa0aad9c4687a4b7eb4) start again - [`e7a400c`](https://github.com/run-llama/rags/commit/e7a400ca50d1124534c369043b0c15ef884f6680) restart - [`e1f1061`](https://github.com/run-llama/rags/commit/e1f106113acef5d1ad130af318e294986134f2da) try again - simple - [`9b8633e`](https://github.com/run-llama/rags/commit/9b8633ea45e9f75db9e73e4d3c77806fa675d75c) try getenv - [`0613543`](https://github.com/run-llama/rags/commit/06135436eefd644a50cf6186f5eabe2050dfa36e) forgot getenv in the req.txt - [`564c75d`](https://github.com/run-llama/rags/commit/564c75d2c1b716f239ac16938a1d6bb1271e104d) getenv typo fix - [`b1eb5e9`](https://github.com/run-llama/rags/commit/b1eb5e9f5eda7f892a7cd49371896a8e40dd79e4) remove st.secrets and commit cache (good idea?) - [`80994da`](https://github.com/run-llama/rags/commit/80994da8e62de31a9c8fd898fb56c43d451862ab) metaphor_python to requirements - [`6569597`](https://github.com/run-llama/rags/commit/656959741b99a64a160bd1fb98a3002a507dd5d4) clearing chache - [`1d7177f`](https://github.com/run-llama/rags/commit/1d7177fdc0a259e2b0571b9f49e97eda5370ab97) delte _trouble ### 📊 Changes **8 files changed** (+504 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+2 -0) 📝 `1_🏠_Home.py` (+5 -1) ➕ `cache/agents/agent_ids.json` (+1 -0) ➕ `content/DesignStudent.md` (+470 -0) 📝 `core/agent_builder/loader.py` (+6 -3) 📝 `core/builder_config.py` (+9 -3) 📝 `core/utils.py` (+9 -6) 📝 `requirements.txt` (+2 -0) </details> ### 📄 Description Per https://github.com/run-llama/rags/issues/51 I have removed the use of `st.secrets` and thus the need for using a `secrets.toml` file. Why The `secrets.toml` is problematic when deploying to hosting other that streamlit/snowflake. In my case deploying to Azure Application Services resulted in an exposed `secrets.toml`. This resulted in OpenAI automagically deleting the exposed key. Which in turn made my rags deployment fail at runtime. What This PR has removed all of the uses of st.secrets and the secrets.toml file and instead sets up use of good old `os.getenv()` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 00:15:24 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/rags#67