-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to gh-pages from @ 58a0993 🚀
- Loading branch information
0 parents
commit c687004
Showing
563 changed files
with
173,388 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: a8edfd581aa4acc7f76be46af4418956 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
127 changes: 127 additions & 0 deletions
127
.doctrees/nbsphinx/tutorials/tutorials.context_storages.1_basics.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "5598a180", | ||
"metadata": { | ||
"cell_marker": "\"\"\"" | ||
}, | ||
"source": [ | ||
"# 1. Basics\n", | ||
"\n", | ||
"The following tutorial shows the basic use of the database connection." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "95fb6686", | ||
"metadata": { | ||
"execution": { | ||
"iopub.execute_input": "2023-09-26T11:47:20.181316Z", | ||
"iopub.status.busy": "2023-09-26T11:47:20.180695Z", | ||
"iopub.status.idle": "2023-09-26T11:47:22.887898Z", | ||
"shell.execute_reply": "2023-09-26T11:47:22.887048Z" | ||
} | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Note: you may need to restart the kernel to use updated packages.\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"# installing dependencies\n", | ||
"%pip install -q dff[json,pickle]" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "819910d9", | ||
"metadata": { | ||
"execution": { | ||
"iopub.execute_input": "2023-09-26T11:47:22.892753Z", | ||
"iopub.status.busy": "2023-09-26T11:47:22.892233Z", | ||
"iopub.status.idle": "2023-09-26T11:47:23.762492Z", | ||
"shell.execute_reply": "2023-09-26T11:47:23.761784Z" | ||
} | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"(user) >>> text='Hi'\n", | ||
" (bot) <<< text='Hi, how are you?'\n", | ||
"(user) >>> text='i'm fine, how are you?'\n", | ||
" (bot) <<< text='Good. What do you want to talk about?'\n", | ||
"(user) >>> text='Let's talk about music.'\n", | ||
" (bot) <<< text='Sorry, I can not talk about music now.'\n", | ||
"(user) >>> text='Ok, goodbye.'\n", | ||
" (bot) <<< text='bye'\n", | ||
"(user) >>> text='Hi'\n", | ||
" (bot) <<< text='Hi, how are you?'\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"import pathlib\n", | ||
"\n", | ||
"from dff.context_storages import context_storage_factory\n", | ||
"\n", | ||
"from dff.pipeline import Pipeline\n", | ||
"from dff.utils.testing.common import (\n", | ||
" check_happy_path,\n", | ||
" is_interactive_mode,\n", | ||
" run_interactive_mode,\n", | ||
")\n", | ||
"from dff.utils.testing.toy_script import TOY_SCRIPT_ARGS, HAPPY_PATH\n", | ||
"\n", | ||
"pathlib.Path(\"dbs\").mkdir(exist_ok=True)\n", | ||
"db = context_storage_factory(\"json://dbs/file.json\")\n", | ||
"# db = context_storage_factory(\"pickle://dbs/file.pkl\")\n", | ||
"# db = context_storage_factory(\"shelve://dbs/file\")\n", | ||
"\n", | ||
"pipeline = Pipeline.from_script(*TOY_SCRIPT_ARGS, context_storage=db)\n", | ||
"\n", | ||
"if __name__ == \"__main__\":\n", | ||
" check_happy_path(pipeline, HAPPY_PATH)\n", | ||
" # This is a function for automatic tutorial running (testing) with HAPPY_PATH\n", | ||
"\n", | ||
" # This runs tutorial in interactive mode if not in IPython env\n", | ||
" # and if `DISABLE_INTERACTIVE_MODE` is not set\n", | ||
" if is_interactive_mode():\n", | ||
" run_interactive_mode(pipeline) # This runs tutorial in interactive mode" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"jupytext": { | ||
"cell_metadata_filter": "-all", | ||
"main_language": "python", | ||
"notebook_metadata_filter": "-all", | ||
"text_representation": { | ||
"extension": ".py", | ||
"format_name": "percent" | ||
} | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.18" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
158 changes: 158 additions & 0 deletions
158
.doctrees/nbsphinx/tutorials/tutorials.context_storages.2_postgresql.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "37ce6896", | ||
"metadata": { | ||
"cell_marker": "\"\"\"" | ||
}, | ||
"source": [ | ||
"# 2. PostgreSQL\n", | ||
"\n", | ||
"This is a tutorial on using PostgreSQL." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "2aa70456", | ||
"metadata": { | ||
"execution": { | ||
"iopub.execute_input": "2023-09-26T11:47:25.783524Z", | ||
"iopub.status.busy": "2023-09-26T11:47:25.783062Z", | ||
"iopub.status.idle": "2023-09-26T11:47:28.507519Z", | ||
"shell.execute_reply": "2023-09-26T11:47:28.506611Z" | ||
} | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Note: you may need to restart the kernel to use updated packages.\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"# installing dependencies\n", | ||
"%pip install -q dff[postgresql]" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "b6101790", | ||
"metadata": { | ||
"execution": { | ||
"iopub.execute_input": "2023-09-26T11:47:28.511795Z", | ||
"iopub.status.busy": "2023-09-26T11:47:28.511016Z", | ||
"iopub.status.idle": "2023-09-26T11:47:29.350142Z", | ||
"shell.execute_reply": "2023-09-26T11:47:29.349339Z" | ||
}, | ||
"lines_to_next_cell": 2 | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"import os\n", | ||
"\n", | ||
"from dff.context_storages import context_storage_factory\n", | ||
"\n", | ||
"from dff.pipeline import Pipeline\n", | ||
"from dff.utils.testing.common import (\n", | ||
" check_happy_path,\n", | ||
" is_interactive_mode,\n", | ||
" run_interactive_mode,\n", | ||
")\n", | ||
"from dff.utils.testing.toy_script import TOY_SCRIPT_ARGS, HAPPY_PATH" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"id": "182903b1", | ||
"metadata": { | ||
"execution": { | ||
"iopub.execute_input": "2023-09-26T11:47:29.354293Z", | ||
"iopub.status.busy": "2023-09-26T11:47:29.353802Z", | ||
"iopub.status.idle": "2023-09-26T11:47:29.475475Z", | ||
"shell.execute_reply": "2023-09-26T11:47:29.474554Z" | ||
}, | ||
"lines_to_next_cell": 2 | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"db_uri = \"postgresql+asyncpg://{}:{}@localhost:5432/{}\".format(\n", | ||
" os.environ[\"POSTGRES_USERNAME\"],\n", | ||
" os.environ[\"POSTGRES_PASSWORD\"],\n", | ||
" os.environ[\"POSTGRES_DB\"],\n", | ||
")\n", | ||
"db = context_storage_factory(db_uri)\n", | ||
"\n", | ||
"\n", | ||
"pipeline = Pipeline.from_script(*TOY_SCRIPT_ARGS, context_storage=db)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"id": "24543a07", | ||
"metadata": { | ||
"execution": { | ||
"iopub.execute_input": "2023-09-26T11:47:29.479312Z", | ||
"iopub.status.busy": "2023-09-26T11:47:29.479026Z", | ||
"iopub.status.idle": "2023-09-26T11:47:29.509596Z", | ||
"shell.execute_reply": "2023-09-26T11:47:29.508912Z" | ||
} | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"(user) >>> text='Hi'\n", | ||
" (bot) <<< text='Hi, how are you?'\n", | ||
"(user) >>> text='i'm fine, how are you?'\n", | ||
" (bot) <<< text='Good. What do you want to talk about?'\n", | ||
"(user) >>> text='Let's talk about music.'\n", | ||
" (bot) <<< text='Sorry, I can not talk about music now.'\n", | ||
"(user) >>> text='Ok, goodbye.'\n", | ||
" (bot) <<< text='bye'\n", | ||
"(user) >>> text='Hi'\n", | ||
" (bot) <<< text='Hi, how are you?'\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"if __name__ == \"__main__\":\n", | ||
" check_happy_path(pipeline, HAPPY_PATH)\n", | ||
" if is_interactive_mode():\n", | ||
" run_interactive_mode(pipeline)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"jupytext": { | ||
"cell_metadata_filter": "-all", | ||
"main_language": "python", | ||
"notebook_metadata_filter": "-all", | ||
"text_representation": { | ||
"extension": ".py", | ||
"format_name": "percent" | ||
} | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.18" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Oops, something went wrong.