|
27 | 27 | }, |
28 | 28 | { |
29 | 29 | "cell_type": "code", |
30 | | - "execution_count": null, |
| 30 | + "execution_count": 30, |
31 | 31 | "id": "f284f828", |
32 | 32 | "metadata": {}, |
33 | 33 | "outputs": [], |
|
36 | 36 | "import json\n", |
37 | 37 | "from typing import Generator\n", |
38 | 38 | "from tqdm import tqdm\n", |
39 | | - "from elasticsearch import Elasticsearch" |
| 39 | + "from elasticsearch import Elasticsearch\n", |
| 40 | + "import getpass" |
40 | 41 | ] |
41 | 42 | }, |
42 | 43 | { |
|
49 | 50 | "Set up your Elasticsearch and Mistral API credentials. For security, consider using environment variables." |
50 | 51 | ] |
51 | 52 | }, |
| 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 | + }, |
52 | 66 | { |
53 | 67 | "cell_type": "code", |
54 | 68 | "execution_count": null, |
55 | 69 | "id": "5fdf1b27", |
56 | 70 | "metadata": {}, |
57 | 71 | "outputs": [], |
58 | 72 | "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", |
64 | 74 | "MISTRAL_MODEL = \"mistral-large-latest\" # Mistral model to use\n", |
65 | 75 | "INFERENCE_ENDPOINT_NAME = (\n", |
66 | 76 | " \"mistral-embeddings-chat-completion\" # Name for the inference endpoint\n", |
|
0 commit comments