Skip to content

Commit 34e59a6

Browse files
committed
getpass
1 parent 0c00bae commit 34e59a6

File tree

1 file changed

+17
-7
lines changed
  • supporting-blog-content/context-engineering-mistral-completions

1 file changed

+17
-7
lines changed

supporting-blog-content/context-engineering-mistral-completions/notebook.ipynb

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
},
2828
{
2929
"cell_type": "code",
30-
"execution_count": null,
30+
"execution_count": 30,
3131
"id": "f284f828",
3232
"metadata": {},
3333
"outputs": [],
@@ -36,7 +36,8 @@
3636
"import json\n",
3737
"from typing import Generator\n",
3838
"from tqdm import tqdm\n",
39-
"from elasticsearch import Elasticsearch"
39+
"from elasticsearch import Elasticsearch\n",
40+
"import getpass"
4041
]
4142
},
4243
{
@@ -49,18 +50,27 @@
4950
"Set up your Elasticsearch and Mistral API credentials. For security, consider using environment variables."
5051
]
5152
},
53+
{
54+
"cell_type": "code",
55+
"execution_count": 31,
56+
"id": "dd01b30e",
57+
"metadata": {},
58+
"outputs": [],
59+
"source": [
60+
"# Credentials - Enter your API keys securely\n",
61+
"ELASTICSEARCH_URL = input(\"Enter your Elasticsearch URL: \").strip()\n",
62+
"ELASTICSEARCH_API_KEY = getpass.getpass(\"Enter your Elasticsearch API key: \")\n",
63+
"MISTRAL_API_KEY = getpass.getpass(\"Enter your Mistral API key: \")"
64+
]
65+
},
5266
{
5367
"cell_type": "code",
5468
"execution_count": null,
5569
"id": "5fdf1b27",
5670
"metadata": {},
5771
"outputs": [],
5872
"source": [
59-
"# Configuration - Update these values with your credentials\n",
60-
"ELASTICSEARCH_URL = \"https://tralmis-tral-d91b08.es.us-central1.gcp.elastic.cloud:443\"\n",
61-
"ELASTICSEARCH_API_KEY = \"<your_elasticsearch_api_key_here>\"\n",
62-
"MISTRAL_API_KEY = \"<your_mistral_api_key_here>\"\n",
63-
"\n",
73+
"# Configurations, no need to change these values\n",
6474
"MISTRAL_MODEL = \"mistral-large-latest\" # Mistral model to use\n",
6575
"INFERENCE_ENDPOINT_NAME = (\n",
6676
" \"mistral-embeddings-chat-completion\" # Name for the inference endpoint\n",

0 commit comments

Comments
 (0)