diff --git a/docs/docs/integrations/chat/anthropic.ipynb b/docs/docs/integrations/chat/anthropic.ipynb index 7167600b9ba..30ce233d329 100644 --- a/docs/docs/integrations/chat/anthropic.ipynb +++ b/docs/docs/integrations/chat/anthropic.ipynb @@ -59,7 +59,8 @@ "import getpass\n", "import os\n", "\n", - "os.environ[\"ANTHROPIC_API_KEY\"] = getpass.getpass(\"Enter your Anthropic API key: \")" + "if \"ANTHROPIC_API_KEY\" not in os.environ:\n", + " os.environ[\"ANTHROPIC_API_KEY\"] = getpass.getpass(\"Enter your Anthropic API key: \")" ] }, { diff --git a/docs/docs/integrations/chat/azure_chat_openai.ipynb b/docs/docs/integrations/chat/azure_chat_openai.ipynb index a6250f214e3..8b1454cae2f 100644 --- a/docs/docs/integrations/chat/azure_chat_openai.ipynb +++ b/docs/docs/integrations/chat/azure_chat_openai.ipynb @@ -58,7 +58,10 @@ "import getpass\n", "import os\n", "\n", - "os.environ[\"AZURE_OPENAI_API_KEY\"] = getpass.getpass(\"Enter your AzureOpenAI API key: \")\n", + "if \"AZURE_OPENAI_API_KEY\" not in os.environ:\n", + " os.environ[\"AZURE_OPENAI_API_KEY\"] = getpass.getpass(\n", + " \"Enter your AzureOpenAI API key: \"\n", + " )\n", "os.environ[\"AZURE_OPENAI_ENDPOINT\"] = \"https://YOUR-ENDPOINT.openai.azure.com/\"" ] }, diff --git a/docs/docs/integrations/chat/cerebras.ipynb b/docs/docs/integrations/chat/cerebras.ipynb index e6f1b3ffcd1..ef3568d4d0d 100644 --- a/docs/docs/integrations/chat/cerebras.ipynb +++ b/docs/docs/integrations/chat/cerebras.ipynb @@ -76,7 +76,8 @@ "import getpass\n", "import os\n", "\n", - "os.environ[\"CEREBRAS_API_KEY\"] = getpass.getpass(\"Enter your Cerebras API key: \")" + "if \"CEREBRAS_API_KEY\" not in os.environ:\n", + " os.environ[\"CEREBRAS_API_KEY\"] = getpass.getpass(\"Enter your Cerebras API key: \")" ] }, { diff --git a/docs/docs/integrations/chat/databricks.ipynb b/docs/docs/integrations/chat/databricks.ipynb index ad2a68dd51f..6da34df82b8 100644 --- a/docs/docs/integrations/chat/databricks.ipynb +++ b/docs/docs/integrations/chat/databricks.ipynb @@ -90,7 +90,10 @@ "import os\n", "\n", "os.environ[\"DATABRICKS_HOST\"] = \"https://your-workspace.cloud.databricks.com\"\n", - "os.environ[\"DATABRICKS_TOKEN\"] = getpass.getpass(\"Enter your Databricks access token: \")" + "if \"DATABRICKS_TOKEN\" not in os.environ:\n", + " os.environ[\"DATABRICKS_TOKEN\"] = getpass.getpass(\n", + " \"Enter your Databricks access token: \"\n", + " )" ] }, { diff --git a/docs/docs/integrations/chat/fireworks.ipynb b/docs/docs/integrations/chat/fireworks.ipynb index 187008820ca..c1144ab5913 100644 --- a/docs/docs/integrations/chat/fireworks.ipynb +++ b/docs/docs/integrations/chat/fireworks.ipynb @@ -52,7 +52,8 @@ "import getpass\n", "import os\n", "\n", - "os.environ[\"FIREWORKS_API_KEY\"] = getpass.getpass(\"Enter your Fireworks API key: \")" + "if \"FIREWORKS_API_KEY\" not in os.environ:\n", + " os.environ[\"FIREWORKS_API_KEY\"] = getpass.getpass(\"Enter your Fireworks API key: \")" ] }, { diff --git a/docs/docs/integrations/chat/friendli.ipynb b/docs/docs/integrations/chat/friendli.ipynb index f9fc3878f1f..bdce836562e 100644 --- a/docs/docs/integrations/chat/friendli.ipynb +++ b/docs/docs/integrations/chat/friendli.ipynb @@ -44,7 +44,8 @@ "import getpass\n", "import os\n", "\n", - "os.environ[\"FRIENDLI_TOKEN\"] = getpass.getpass(\"Friendi Personal Access Token: \")" + "if \"FRIENDLI_TOKEN\" not in os.environ:\n", + " os.environ[\"FRIENDLI_TOKEN\"] = getpass.getpass(\"Friendi Personal Access Token: \")" ] }, { diff --git a/docs/docs/integrations/chat/google_generative_ai.ipynb b/docs/docs/integrations/chat/google_generative_ai.ipynb index 8672bf1eb8f..1eb87304c34 100644 --- a/docs/docs/integrations/chat/google_generative_ai.ipynb +++ b/docs/docs/integrations/chat/google_generative_ai.ipynb @@ -60,7 +60,8 @@ "import getpass\n", "import os\n", "\n", - "os.environ[\"GOOGLE_API_KEY\"] = getpass.getpass(\"Enter your Google AI API key: \")" + "if \"GOOGLE_API_KEY\" not in os.environ:\n", + " os.environ[\"GOOGLE_API_KEY\"] = getpass.getpass(\"Enter your Google AI API key: \")" ] }, { diff --git a/docs/docs/integrations/chat/groq.ipynb b/docs/docs/integrations/chat/groq.ipynb index 7f1a3398418..bec7aff00f5 100644 --- a/docs/docs/integrations/chat/groq.ipynb +++ b/docs/docs/integrations/chat/groq.ipynb @@ -50,7 +50,8 @@ "import getpass\n", "import os\n", "\n", - "os.environ[\"GROQ_API_KEY\"] = getpass.getpass(\"Enter your Groq API key: \")" + "if \"GROQ_API_KEY\" not in os.environ:\n", + " os.environ[\"GROQ_API_KEY\"] = getpass.getpass(\"Enter your Groq API key: \")" ] }, { diff --git a/docs/docs/integrations/chat/mistralai.ipynb b/docs/docs/integrations/chat/mistralai.ipynb index e98a3c9c853..26b555738f5 100644 --- a/docs/docs/integrations/chat/mistralai.ipynb +++ b/docs/docs/integrations/chat/mistralai.ipynb @@ -52,7 +52,8 @@ "import getpass\n", "import os\n", "\n", - "os.environ[\"MISTRAL_API_KEY\"] = getpass.getpass(\"Enter your Mistral API key: \")" + "if \"MISTRAL_API_KEY\" not in os.environ:\n", + " os.environ[\"MISTRAL_API_KEY\"] = getpass.getpass(\"Enter your Mistral API key: \")" ] }, { diff --git a/docs/docs/integrations/chat/yi.ipynb b/docs/docs/integrations/chat/yi.ipynb index bd1a3f98ec3..3349bcb2a9d 100644 --- a/docs/docs/integrations/chat/yi.ipynb +++ b/docs/docs/integrations/chat/yi.ipynb @@ -41,7 +41,8 @@ "import getpass\n", "import os\n", "\n", - "os.environ[\"YI_API_KEY\"] = getpass.getpass(\"Enter your Yi API key: \")" + "if \"YI_API_KEY\" not in os.environ:\n", + " os.environ[\"YI_API_KEY\"] = getpass.getpass(\"Enter your Yi API key: \")" ] }, {