Automatically create .env file in notebook

This commit is contained in:
James Murdza
2025-09-12 12:55:11 -04:00
parent 28f206d824
commit 1aca043006

View File

@@ -30,10 +30,19 @@
"1. Create a Cua account at https://www.trycua.com/\n",
"2. Start a Cua container at https://www.trycua.com/dashboard/containers\n",
"3. Create a HUD account at https://www.hud.so/\n",
"4. Create a .env file like this:\n",
"4. Create a .env file:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1757f145",
"metadata": {},
"outputs": [],
"source": [
"# Create a .env file if it doesn't exist\n",
"\n",
"```\n",
"# Required environment variables:\n",
"ENV_TEMPLATE = \"\"\"# Required environment variables:\n",
"CUA_API_KEY=\n",
"CUA_CONTAINER_NAME=\n",
"HUD_API_KEY=\n",
@@ -41,7 +50,19 @@
"# Any LLM provider will work:\n",
"ANTHROPIC_API_KEY=\n",
"OPENAI_API_KEY=\n",
"```"
"\"\"\"\n",
"\n",
"import os\n",
"if not os.path.exists(\".env\"):\n",
" open(\".env\", \"w\").write(ENV_TEMPLATE)"
]
},
{
"cell_type": "markdown",
"id": "0949908d",
"metadata": {},
"source": [
"5. Fill in all missing values in the .env file"
]
},
{