docs: format (#21132)

This commit is contained in:
Bagatur 2024-04-30 19:32:41 -04:00 committed by GitHub
parent 14422a4220
commit 6d3e9eaf84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 51 additions and 50 deletions

View File

@ -464,8 +464,8 @@
" Check if the base64 data is an image by looking at the start of the data\n", " Check if the base64 data is an image by looking at the start of the data\n",
" \"\"\"\n", " \"\"\"\n",
" image_signatures = {\n", " image_signatures = {\n",
" b\"\\xFF\\xD8\\xFF\": \"jpg\",\n", " b\"\\xff\\xd8\\xff\": \"jpg\",\n",
" b\"\\x89\\x50\\x4E\\x47\\x0D\\x0A\\x1A\\x0A\": \"png\",\n", " b\"\\x89\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\": \"png\",\n",
" b\"\\x47\\x49\\x46\\x38\": \"gif\",\n", " b\"\\x47\\x49\\x46\\x38\": \"gif\",\n",
" b\"\\x52\\x49\\x46\\x46\": \"webp\",\n", " b\"\\x52\\x49\\x46\\x46\": \"webp\",\n",
" }\n", " }\n",

View File

@ -462,8 +462,8 @@
" Check if the base64 data is an image by looking at the start of the data\n", " Check if the base64 data is an image by looking at the start of the data\n",
" \"\"\"\n", " \"\"\"\n",
" image_signatures = {\n", " image_signatures = {\n",
" b\"\\xFF\\xD8\\xFF\": \"jpg\",\n", " b\"\\xff\\xd8\\xff\": \"jpg\",\n",
" b\"\\x89\\x50\\x4E\\x47\\x0D\\x0A\\x1A\\x0A\": \"png\",\n", " b\"\\x89\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\": \"png\",\n",
" b\"\\x47\\x49\\x46\\x38\": \"gif\",\n", " b\"\\x47\\x49\\x46\\x38\": \"gif\",\n",
" b\"\\x52\\x49\\x46\\x46\": \"webp\",\n", " b\"\\x52\\x49\\x46\\x46\": \"webp\",\n",
" }\n", " }\n",

View File

@ -532,8 +532,8 @@
"def is_image_data(b64data):\n", "def is_image_data(b64data):\n",
" \"\"\"Check if the base64 data is an image by looking at the start of the data.\"\"\"\n", " \"\"\"Check if the base64 data is an image by looking at the start of the data.\"\"\"\n",
" image_signatures = {\n", " image_signatures = {\n",
" b\"\\xFF\\xD8\\xFF\": \"jpg\",\n", " b\"\\xff\\xd8\\xff\": \"jpg\",\n",
" b\"\\x89\\x50\\x4E\\x47\\x0D\\x0A\\x1A\\x0A\": \"png\",\n", " b\"\\x89\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\": \"png\",\n",
" b\"\\x47\\x49\\x46\\x38\": \"gif\",\n", " b\"\\x47\\x49\\x46\\x38\": \"gif\",\n",
" b\"\\x52\\x49\\x46\\x46\": \"webp\",\n", " b\"\\x52\\x49\\x46\\x46\": \"webp\",\n",
" }\n", " }\n",

View File

@ -355,15 +355,15 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"attribute_info[-2][\n", "attribute_info[-2][\"description\"] += (\n",
" \"description\"\n", " f\". Valid values are {sorted(latest_price['starrating'].value_counts().index.tolist())}\"\n",
"] += f\". Valid values are {sorted(latest_price['starrating'].value_counts().index.tolist())}\"\n", ")\n",
"attribute_info[3][\n", "attribute_info[3][\"description\"] += (\n",
" \"description\"\n", " f\". Valid values are {sorted(latest_price['maxoccupancy'].value_counts().index.tolist())}\"\n",
"] += f\". Valid values are {sorted(latest_price['maxoccupancy'].value_counts().index.tolist())}\"\n", ")\n",
"attribute_info[-3][\n", "attribute_info[-3][\"description\"] += (\n",
" \"description\"\n", " f\". Valid values are {sorted(latest_price['country'].value_counts().index.tolist())}\"\n",
"] += f\". Valid values are {sorted(latest_price['country'].value_counts().index.tolist())}\"" ")"
] ]
}, },
{ {
@ -688,9 +688,9 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"attribute_info[-3][\n", "attribute_info[-3][\"description\"] += (\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",
"] += \". 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", "chain = load_query_constructor_runnable(\n",
" ChatOpenAI(model=\"gpt-3.5-turbo\", temperature=0),\n", " ChatOpenAI(model=\"gpt-3.5-turbo\", temperature=0),\n",
" doc_contents,\n", " doc_contents,\n",

View File

@ -21,22 +21,22 @@
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"source": [], "id": "8c493e205ce1dda5",
"metadata": { "metadata": {
"collapsed": false "collapsed": false
}, },
"id": "8c493e205ce1dda5" "source": []
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 1, "execution_count": 1,
"id": "ab8e45f5bd435ade", "id": "ab8e45f5bd435ade",
"metadata": { "metadata": {
"collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2024-02-08T18:25:05.278480Z", "end_time": "2024-02-08T18:25:05.278480Z",
"start_time": "2024-02-08T18:24:51.560677Z" "start_time": "2024-02-08T18:24:51.560677Z"
} },
"collapsed": false
}, },
"outputs": [ "outputs": [
{ {
@ -44,8 +44,8 @@
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"\r\n", "\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 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 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" "Note: you may need to restart the kernel to use updated packages.\n"
] ]
} }
@ -59,11 +59,11 @@
"execution_count": 2, "execution_count": 2,
"id": "9c7ce9e7b26efbb0", "id": "9c7ce9e7b26efbb0",
"metadata": { "metadata": {
"collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2024-02-08T18:25:56.926147Z", "end_time": "2024-02-08T18:25:56.926147Z",
"start_time": "2024-02-08T18:25:56.900087Z" "start_time": "2024-02-08T18:25:56.900087Z"
} },
"collapsed": false
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
@ -90,24 +90,24 @@
"execution_count": 3, "execution_count": 3,
"id": "4a052d99c6b8a2a7", "id": "4a052d99c6b8a2a7",
"metadata": { "metadata": {
"collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2024-02-08T18:26:06.558294Z", "end_time": "2024-02-08T18:26:06.558294Z",
"start_time": "2024-02-08T18:26:06.550008Z" "start_time": "2024-02-08T18:26:06.550008Z"
} },
"collapsed": false
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"# Set up the OpenAI Environment Variables\n", "# Set up the OpenAI Environment Variables\n",
"os.environ[\"OPENAI_API_TYPE\"] = \"azure\"\n", "os.environ[\"OPENAI_API_TYPE\"] = \"azure\"\n",
"os.environ[\"OPENAI_API_VERSION\"] = \"2023-05-15\"\n", "os.environ[\"OPENAI_API_VERSION\"] = \"2023-05-15\"\n",
"os.environ[\n", "os.environ[\"OPENAI_API_BASE\"] = (\n",
" \"OPENAI_API_BASE\"\n", " \"YOUR_OPEN_AI_ENDPOINT\" # https://example.openai.azure.com/\n",
"] = \"YOUR_OPEN_AI_ENDPOINT\" # https://example.openai.azure.com/\n", ")\n",
"os.environ[\"OPENAI_API_KEY\"] = \"YOUR_OPENAI_API_KEY\"\n", "os.environ[\"OPENAI_API_KEY\"] = \"YOUR_OPENAI_API_KEY\"\n",
"os.environ[\n", "os.environ[\"OPENAI_EMBEDDINGS_DEPLOYMENT\"] = (\n",
" \"OPENAI_EMBEDDINGS_DEPLOYMENT\"\n", " \"smart-agent-embedding-ada\" # the deployment name for the embedding model\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" "os.environ[\"OPENAI_EMBEDDINGS_MODEL_NAME\"] = \"text-embedding-ada-002\" # the model name"
] ]
}, },
@ -128,11 +128,11 @@
"execution_count": 4, "execution_count": 4,
"id": "183741cf8f4c7c53", "id": "183741cf8f4c7c53",
"metadata": { "metadata": {
"collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2024-02-08T18:27:00.782280Z", "end_time": "2024-02-08T18:27:00.782280Z",
"start_time": "2024-02-08T18:26:47.339151Z" "start_time": "2024-02-08T18:26:47.339151Z"
} },
"collapsed": false
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
@ -169,11 +169,11 @@
"execution_count": 5, "execution_count": 5,
"id": "39ae6058c2f7fdf1", "id": "39ae6058c2f7fdf1",
"metadata": { "metadata": {
"collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2024-02-08T18:31:13.486173Z", "end_time": "2024-02-08T18:31:13.486173Z",
"start_time": "2024-02-08T18:30:54.175890Z" "start_time": "2024-02-08T18:30:54.175890Z"
} },
"collapsed": false
}, },
"outputs": [ "outputs": [
{ {
@ -227,11 +227,11 @@
"execution_count": 6, "execution_count": 6,
"id": "32c68d3246adc21f", "id": "32c68d3246adc21f",
"metadata": { "metadata": {
"collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2024-02-08T18:31:47.468902Z", "end_time": "2024-02-08T18:31:47.468902Z",
"start_time": "2024-02-08T18:31:46.053602Z" "start_time": "2024-02-08T18:31:46.053602Z"
} },
"collapsed": false
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
@ -245,11 +245,11 @@
"execution_count": 7, "execution_count": 7,
"id": "8feeeb4364efb204", "id": "8feeeb4364efb204",
"metadata": { "metadata": {
"collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2024-02-08T18:31:50.982598Z", "end_time": "2024-02-08T18:31:50.982598Z",
"start_time": "2024-02-08T18:31:50.977605Z" "start_time": "2024-02-08T18:31:50.977605Z"
} },
"collapsed": false
}, },
"outputs": [ "outputs": [
{ {
@ -285,11 +285,11 @@
"execution_count": 8, "execution_count": 8,
"id": "3c218ab6f59301f7", "id": "3c218ab6f59301f7",
"metadata": { "metadata": {
"collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2024-02-08T18:32:14.299599Z", "end_time": "2024-02-08T18:32:14.299599Z",
"start_time": "2024-02-08T18:32:12.923464Z" "start_time": "2024-02-08T18:32:12.923464Z"
} },
"collapsed": false
}, },
"outputs": [ "outputs": [
{ {
@ -323,11 +323,11 @@
"execution_count": 9, "execution_count": 9,
"id": "fd67e4d92c9ab32f", "id": "fd67e4d92c9ab32f",
"metadata": { "metadata": {
"collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2024-02-08T18:32:24.021434Z", "end_time": "2024-02-08T18:32:24.021434Z",
"start_time": "2024-02-08T18:32:22.867658Z" "start_time": "2024-02-08T18:32:22.867658Z"
} },
"collapsed": false
}, },
"outputs": [ "outputs": [
{ {

View File

@ -105,9 +105,9 @@
"\n", "\n",
"# Set up the OpenAI Environment Variables\n", "# Set up the OpenAI Environment Variables\n",
"os.environ[\"OPENAI_API_KEY\"] = getpass.getpass(\"OpenAI API Key:\")\n", "os.environ[\"OPENAI_API_KEY\"] = getpass.getpass(\"OpenAI API Key:\")\n",
"os.environ[\n", "os.environ[\"OPENAI_EMBEDDINGS_DEPLOYMENT\"] = (\n",
" \"OPENAI_EMBEDDINGS_DEPLOYMENT\"\n", " \"smart-agent-embedding-ada\" # the deployment name for the embedding model\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" "os.environ[\"OPENAI_EMBEDDINGS_MODEL_NAME\"] = \"text-embedding-ada-002\" # the model name"
] ]
}, },

View File

@ -140,7 +140,7 @@
" \" \",\n", " \" \",\n",
" \".\",\n", " \".\",\n",
" \",\",\n", " \",\",\n",
" \"\\u200B\", # Zero-width space\n", " \"\\u200b\", # Zero-width space\n",
" \"\\uff0c\", # Fullwidth comma\n", " \"\\uff0c\", # Fullwidth comma\n",
" \"\\u3001\", # Ideographic comma\n", " \"\\u3001\", # Ideographic comma\n",
" \"\\uff0e\", # Fullwidth full stop\n", " \"\\uff0e\", # Fullwidth full stop\n",

View File

@ -1,4 +1,5 @@
"""This script checks documentation for broken import statements.""" """This script checks documentation for broken import statements."""
import importlib import importlib
import json import json
import logging import logging