From 6d3e9eaf84ed4f24b4e38067c0ca61bc49919bab Mon Sep 17 00:00:00 2001 From: Bagatur <22008038+baskaryan@users.noreply.github.com> Date: Tue, 30 Apr 2024 19:32:41 -0400 Subject: [PATCH] docs: format (#21132) --- cookbook/Multi_modal_RAG.ipynb | 4 +- cookbook/Multi_modal_RAG_google.ipynb | 4 +- cookbook/advanced_rag_eval.ipynb | 4 +- cookbook/self_query_hotel_search.ipynb | 24 ++++---- .../vectorstores/azure_cosmos_db.ipynb | 56 +++++++++---------- .../vectorstores/documentdb.ipynb | 6 +- .../recursive_text_splitter.ipynb | 2 +- docs/scripts/check_imports.py | 1 + 8 files changed, 51 insertions(+), 50 deletions(-) diff --git a/cookbook/Multi_modal_RAG.ipynb b/cookbook/Multi_modal_RAG.ipynb index ab9fde3d9e6..87863475f76 100644 --- a/cookbook/Multi_modal_RAG.ipynb +++ b/cookbook/Multi_modal_RAG.ipynb @@ -464,8 +464,8 @@ " Check if the base64 data is an image by looking at the start of the data\n", " \"\"\"\n", " image_signatures = {\n", - " b\"\\xFF\\xD8\\xFF\": \"jpg\",\n", - " b\"\\x89\\x50\\x4E\\x47\\x0D\\x0A\\x1A\\x0A\": \"png\",\n", + " b\"\\xff\\xd8\\xff\": \"jpg\",\n", + " b\"\\x89\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\": \"png\",\n", " b\"\\x47\\x49\\x46\\x38\": \"gif\",\n", " b\"\\x52\\x49\\x46\\x46\": \"webp\",\n", " }\n", diff --git a/cookbook/Multi_modal_RAG_google.ipynb b/cookbook/Multi_modal_RAG_google.ipynb index 3ba989edcfd..55a53d5ea0f 100644 --- a/cookbook/Multi_modal_RAG_google.ipynb +++ b/cookbook/Multi_modal_RAG_google.ipynb @@ -462,8 +462,8 @@ " Check if the base64 data is an image by looking at the start of the data\n", " \"\"\"\n", " image_signatures = {\n", - " b\"\\xFF\\xD8\\xFF\": \"jpg\",\n", - " b\"\\x89\\x50\\x4E\\x47\\x0D\\x0A\\x1A\\x0A\": \"png\",\n", + " b\"\\xff\\xd8\\xff\": \"jpg\",\n", + " b\"\\x89\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\": \"png\",\n", " b\"\\x47\\x49\\x46\\x38\": \"gif\",\n", " b\"\\x52\\x49\\x46\\x46\": \"webp\",\n", " }\n", diff --git a/cookbook/advanced_rag_eval.ipynb b/cookbook/advanced_rag_eval.ipynb index 8874640de68..deac4673ca6 100644 --- a/cookbook/advanced_rag_eval.ipynb +++ b/cookbook/advanced_rag_eval.ipynb @@ -532,8 +532,8 @@ "def is_image_data(b64data):\n", " \"\"\"Check if the base64 data is an image by looking at the start of the data.\"\"\"\n", " image_signatures = {\n", - " b\"\\xFF\\xD8\\xFF\": \"jpg\",\n", - " b\"\\x89\\x50\\x4E\\x47\\x0D\\x0A\\x1A\\x0A\": \"png\",\n", + " b\"\\xff\\xd8\\xff\": \"jpg\",\n", + " b\"\\x89\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\": \"png\",\n", " b\"\\x47\\x49\\x46\\x38\": \"gif\",\n", " b\"\\x52\\x49\\x46\\x46\": \"webp\",\n", " }\n", diff --git a/cookbook/self_query_hotel_search.ipynb b/cookbook/self_query_hotel_search.ipynb index edd8b78e4f5..865d940165b 100644 --- a/cookbook/self_query_hotel_search.ipynb +++ b/cookbook/self_query_hotel_search.ipynb @@ -355,15 +355,15 @@ "metadata": {}, "outputs": [], "source": [ - "attribute_info[-2][\n", - " \"description\"\n", - "] += f\". Valid values are {sorted(latest_price['starrating'].value_counts().index.tolist())}\"\n", - "attribute_info[3][\n", - " \"description\"\n", - "] += f\". Valid values are {sorted(latest_price['maxoccupancy'].value_counts().index.tolist())}\"\n", - "attribute_info[-3][\n", - " \"description\"\n", - "] += f\". Valid values are {sorted(latest_price['country'].value_counts().index.tolist())}\"" + "attribute_info[-2][\"description\"] += (\n", + " f\". Valid values are {sorted(latest_price['starrating'].value_counts().index.tolist())}\"\n", + ")\n", + "attribute_info[3][\"description\"] += (\n", + " f\". Valid values are {sorted(latest_price['maxoccupancy'].value_counts().index.tolist())}\"\n", + ")\n", + "attribute_info[-3][\"description\"] += (\n", + " f\". Valid values are {sorted(latest_price['country'].value_counts().index.tolist())}\"\n", + ")" ] }, { @@ -688,9 +688,9 @@ "metadata": {}, "outputs": [], "source": [ - "attribute_info[-3][\n", - " \"description\"\n", - "] += \". NOTE: Only use the 'eq' operator if a specific country is mentioned. If a region is mentioned, include all relevant countries in filter.\"\n", + "attribute_info[-3][\"description\"] += (\n", + " \". NOTE: Only use the 'eq' operator if a specific country is mentioned. If a region is mentioned, include all relevant countries in filter.\"\n", + ")\n", "chain = load_query_constructor_runnable(\n", " ChatOpenAI(model=\"gpt-3.5-turbo\", temperature=0),\n", " doc_contents,\n", diff --git a/docs/docs/integrations/vectorstores/azure_cosmos_db.ipynb b/docs/docs/integrations/vectorstores/azure_cosmos_db.ipynb index de3aa689b7f..5db035b51c5 100644 --- a/docs/docs/integrations/vectorstores/azure_cosmos_db.ipynb +++ b/docs/docs/integrations/vectorstores/azure_cosmos_db.ipynb @@ -21,22 +21,22 @@ }, { "cell_type": "markdown", - "source": [], + "id": "8c493e205ce1dda5", "metadata": { "collapsed": false }, - "id": "8c493e205ce1dda5" + "source": [] }, { "cell_type": "code", "execution_count": 1, "id": "ab8e45f5bd435ade", "metadata": { - "collapsed": false, "ExecuteTime": { "end_time": "2024-02-08T18:25:05.278480Z", "start_time": "2024-02-08T18:24:51.560677Z" - } + }, + "collapsed": false }, "outputs": [ { @@ -44,8 +44,8 @@ "output_type": "stream", "text": [ "\r\n", - "\u001B[1m[\u001B[0m\u001B[34;49mnotice\u001B[0m\u001B[1;39;49m]\u001B[0m\u001B[39;49m A new release of pip is available: \u001B[0m\u001B[31;49m23.2.1\u001B[0m\u001B[39;49m -> \u001B[0m\u001B[32;49m23.3.2\u001B[0m\r\n", - "\u001B[1m[\u001B[0m\u001B[34;49mnotice\u001B[0m\u001B[1;39;49m]\u001B[0m\u001B[39;49m To update, run: \u001B[0m\u001B[32;49mpip install --upgrade pip\u001B[0m\r\n", + "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.2.1\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m23.3.2\u001b[0m\r\n", + "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\r\n", "Note: you may need to restart the kernel to use updated packages.\n" ] } @@ -59,11 +59,11 @@ "execution_count": 2, "id": "9c7ce9e7b26efbb0", "metadata": { - "collapsed": false, "ExecuteTime": { "end_time": "2024-02-08T18:25:56.926147Z", "start_time": "2024-02-08T18:25:56.900087Z" - } + }, + "collapsed": false }, "outputs": [], "source": [ @@ -90,24 +90,24 @@ "execution_count": 3, "id": "4a052d99c6b8a2a7", "metadata": { - "collapsed": false, "ExecuteTime": { "end_time": "2024-02-08T18:26:06.558294Z", "start_time": "2024-02-08T18:26:06.550008Z" - } + }, + "collapsed": false }, "outputs": [], "source": [ "# Set up the OpenAI Environment Variables\n", "os.environ[\"OPENAI_API_TYPE\"] = \"azure\"\n", "os.environ[\"OPENAI_API_VERSION\"] = \"2023-05-15\"\n", - "os.environ[\n", - " \"OPENAI_API_BASE\"\n", - "] = \"YOUR_OPEN_AI_ENDPOINT\" # https://example.openai.azure.com/\n", + "os.environ[\"OPENAI_API_BASE\"] = (\n", + " \"YOUR_OPEN_AI_ENDPOINT\" # https://example.openai.azure.com/\n", + ")\n", "os.environ[\"OPENAI_API_KEY\"] = \"YOUR_OPENAI_API_KEY\"\n", - "os.environ[\n", - " \"OPENAI_EMBEDDINGS_DEPLOYMENT\"\n", - "] = \"smart-agent-embedding-ada\" # the deployment name for the embedding model\n", + "os.environ[\"OPENAI_EMBEDDINGS_DEPLOYMENT\"] = (\n", + " \"smart-agent-embedding-ada\" # the deployment name for the embedding model\n", + ")\n", "os.environ[\"OPENAI_EMBEDDINGS_MODEL_NAME\"] = \"text-embedding-ada-002\" # the model name" ] }, @@ -128,11 +128,11 @@ "execution_count": 4, "id": "183741cf8f4c7c53", "metadata": { - "collapsed": false, "ExecuteTime": { "end_time": "2024-02-08T18:27:00.782280Z", "start_time": "2024-02-08T18:26:47.339151Z" - } + }, + "collapsed": false }, "outputs": [], "source": [ @@ -169,11 +169,11 @@ "execution_count": 5, "id": "39ae6058c2f7fdf1", "metadata": { - "collapsed": false, "ExecuteTime": { "end_time": "2024-02-08T18:31:13.486173Z", "start_time": "2024-02-08T18:30:54.175890Z" - } + }, + "collapsed": false }, "outputs": [ { @@ -227,11 +227,11 @@ "execution_count": 6, "id": "32c68d3246adc21f", "metadata": { - "collapsed": false, "ExecuteTime": { "end_time": "2024-02-08T18:31:47.468902Z", "start_time": "2024-02-08T18:31:46.053602Z" - } + }, + "collapsed": false }, "outputs": [], "source": [ @@ -245,11 +245,11 @@ "execution_count": 7, "id": "8feeeb4364efb204", "metadata": { - "collapsed": false, "ExecuteTime": { "end_time": "2024-02-08T18:31:50.982598Z", "start_time": "2024-02-08T18:31:50.977605Z" - } + }, + "collapsed": false }, "outputs": [ { @@ -285,11 +285,11 @@ "execution_count": 8, "id": "3c218ab6f59301f7", "metadata": { - "collapsed": false, "ExecuteTime": { "end_time": "2024-02-08T18:32:14.299599Z", "start_time": "2024-02-08T18:32:12.923464Z" - } + }, + "collapsed": false }, "outputs": [ { @@ -323,11 +323,11 @@ "execution_count": 9, "id": "fd67e4d92c9ab32f", "metadata": { - "collapsed": false, "ExecuteTime": { "end_time": "2024-02-08T18:32:24.021434Z", "start_time": "2024-02-08T18:32:22.867658Z" - } + }, + "collapsed": false }, "outputs": [ { diff --git a/docs/docs/integrations/vectorstores/documentdb.ipynb b/docs/docs/integrations/vectorstores/documentdb.ipynb index e39e3276481..577a5462cd7 100644 --- a/docs/docs/integrations/vectorstores/documentdb.ipynb +++ b/docs/docs/integrations/vectorstores/documentdb.ipynb @@ -105,9 +105,9 @@ "\n", "# Set up the OpenAI Environment Variables\n", "os.environ[\"OPENAI_API_KEY\"] = getpass.getpass(\"OpenAI API Key:\")\n", - "os.environ[\n", - " \"OPENAI_EMBEDDINGS_DEPLOYMENT\"\n", - "] = \"smart-agent-embedding-ada\" # the deployment name for the embedding model\n", + "os.environ[\"OPENAI_EMBEDDINGS_DEPLOYMENT\"] = (\n", + " \"smart-agent-embedding-ada\" # the deployment name for the embedding model\n", + ")\n", "os.environ[\"OPENAI_EMBEDDINGS_MODEL_NAME\"] = \"text-embedding-ada-002\" # the model name" ] }, diff --git a/docs/docs/modules/data_connection/document_transformers/recursive_text_splitter.ipynb b/docs/docs/modules/data_connection/document_transformers/recursive_text_splitter.ipynb index 9d10763895c..4d576acddd9 100644 --- a/docs/docs/modules/data_connection/document_transformers/recursive_text_splitter.ipynb +++ b/docs/docs/modules/data_connection/document_transformers/recursive_text_splitter.ipynb @@ -140,7 +140,7 @@ " \" \",\n", " \".\",\n", " \",\",\n", - " \"\\u200B\", # Zero-width space\n", + " \"\\u200b\", # Zero-width space\n", " \"\\uff0c\", # Fullwidth comma\n", " \"\\u3001\", # Ideographic comma\n", " \"\\uff0e\", # Fullwidth full stop\n", diff --git a/docs/scripts/check_imports.py b/docs/scripts/check_imports.py index c416932432d..6092a1c93ee 100644 --- a/docs/scripts/check_imports.py +++ b/docs/scripts/check_imports.py @@ -1,4 +1,5 @@ """This script checks documentation for broken import statements.""" + import importlib import json import logging