Skip to content

Commit

Permalink
generateReadme: Refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 28, 2023
1 parent d3ea5f3 commit c9040bd
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 88 deletions.
48 changes: 24 additions & 24 deletions .github/push_templates_to_algolia.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
"id": "aa0e3e6f-1260-4452-8abf-7c084e26c8a4",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-25T15:33:31.721482Z",
"iopub.status.busy": "2023-10-25T15:33:31.721107Z",
"iopub.status.idle": "2023-10-25T15:33:31.802709Z",
"shell.execute_reply": "2023-10-25T15:33:31.801670Z"
"iopub.execute_input": "2023-10-28T19:34:54.105904Z",
"iopub.status.busy": "2023-10-28T19:34:54.105210Z",
"iopub.status.idle": "2023-10-28T19:34:54.162986Z",
"shell.execute_reply": "2023-10-28T19:34:54.162305Z"
},
"papermill": {},
"tags": []
Expand Down Expand Up @@ -95,10 +95,10 @@
"id": "cfa97168-63eb-4e8c-89c3-0a5d26f47740",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-25T15:33:31.807342Z",
"iopub.status.busy": "2023-10-25T15:33:31.807039Z",
"iopub.status.idle": "2023-10-25T15:33:31.813564Z",
"shell.execute_reply": "2023-10-25T15:33:31.812511Z"
"iopub.execute_input": "2023-10-28T19:34:54.167155Z",
"iopub.status.busy": "2023-10-28T19:34:54.166514Z",
"iopub.status.idle": "2023-10-28T19:34:54.170411Z",
"shell.execute_reply": "2023-10-28T19:34:54.169744Z"
},
"papermill": {},
"tags": []
Expand Down Expand Up @@ -141,10 +141,10 @@
"id": "7a9c86c2-931d-4113-abbc-31b3f517b6c4",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-25T15:33:31.818124Z",
"iopub.status.busy": "2023-10-25T15:33:31.817824Z",
"iopub.status.idle": "2023-10-25T15:33:31.839152Z",
"shell.execute_reply": "2023-10-25T15:33:31.838188Z"
"iopub.execute_input": "2023-10-28T19:34:54.173919Z",
"iopub.status.busy": "2023-10-28T19:34:54.173323Z",
"iopub.status.idle": "2023-10-28T19:34:54.191045Z",
"shell.execute_reply": "2023-10-28T19:34:54.190422Z"
},
"tags": []
},
Expand Down Expand Up @@ -178,10 +178,10 @@
"id": "c50e96b2-4403-413c-a99a-9243be0c0a04",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-25T15:33:31.843704Z",
"iopub.status.busy": "2023-10-25T15:33:31.843377Z",
"iopub.status.idle": "2023-10-25T15:33:32.746745Z",
"shell.execute_reply": "2023-10-25T15:33:32.745668Z"
"iopub.execute_input": "2023-10-28T19:34:54.194233Z",
"iopub.status.busy": "2023-10-28T19:34:54.193800Z",
"iopub.status.idle": "2023-10-28T19:34:54.553013Z",
"shell.execute_reply": "2023-10-28T19:34:54.552273Z"
},
"tags": []
},
Expand Down Expand Up @@ -230,10 +230,10 @@
"id": "da661ba3-fd15-4abc-bd4f-d13ae77b82b0",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-25T15:33:32.751227Z",
"iopub.status.busy": "2023-10-25T15:33:32.750935Z",
"iopub.status.idle": "2023-10-25T15:33:33.772861Z",
"shell.execute_reply": "2023-10-25T15:33:33.771585Z"
"iopub.execute_input": "2023-10-28T19:34:54.556772Z",
"iopub.status.busy": "2023-10-28T19:34:54.556166Z",
"iopub.status.idle": "2023-10-28T19:34:54.921978Z",
"shell.execute_reply": "2023-10-28T19:34:54.921178Z"
},
"tags": []
},
Expand All @@ -260,10 +260,10 @@
"id": "f1482a8f-4ce5-4e04-93c8-ddd883375d67",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-25T15:33:33.777818Z",
"iopub.status.busy": "2023-10-25T15:33:33.777236Z",
"iopub.status.idle": "2023-10-25T15:33:33.803668Z",
"shell.execute_reply": "2023-10-25T15:33:33.802787Z"
"iopub.execute_input": "2023-10-28T19:34:54.926559Z",
"iopub.status.busy": "2023-10-28T19:34:54.925828Z",
"iopub.status.idle": "2023-10-28T19:34:54.949853Z",
"shell.execute_reply": "2023-10-28T19:34:54.949157Z"
},
"tags": []
},
Expand Down
104 changes: 81 additions & 23 deletions LangChain/LangChain_Perform_QA_on_SQL_Databases.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"tags": []
},
"source": [
"# Langchain - QA on SQL Database"
"# LangChain - QA on SQL Database\n",
"<a href=\"https://app.naas.ai/user-redirect/naas/downloader?url=https://raw.githubusercontent.com/jupyter-naas/awesome-notebooks/master/LangChain/LangChain_Perform_QA_on_SQL_Databases.ipynb\" target=\"_parent\"><img src=\"https://naasai-public.s3.eu-west-3.amazonaws.com/Open_in_Naas_Lab.svg\"/></a><br><br><a href=\"https://bit.ly/3JyWIk6\">Give Feedback</a> | <a href=\"https://github.com/jupyter-naas/awesome-notebooks/issues/new?assignees=&labels=bug&template=bug_report.md&title=LangChain+-+QA+on+SQL+Database:+Error+short+description\">Bug report</a>"
]
},
{
Expand Down Expand Up @@ -159,7 +160,10 @@
{
"cell_type": "markdown",
"id": "2f7ab5dc",
"metadata": {},
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"#### Creating a mock database (Optional)\n",
"The Chinook database is a sample database for you to run quick tests, such as trying out this notebook. It represents a digital media store, including tables for artists, albums, media tracks, invoices and customers.\n",
Expand All @@ -175,15 +179,21 @@
{
"cell_type": "markdown",
"id": "3ba70fc1",
"metadata": {},
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"## *Text to SQL query*"
]
},
{
"cell_type": "markdown",
"id": "9b1db6dd",
"metadata": {},
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"## Model"
]
Expand All @@ -192,7 +202,10 @@
"cell_type": "code",
"execution_count": 4,
"id": "86ba23e8",
"metadata": {},
"metadata": {
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"from langchain.chat_models import ChatOpenAI\n",
Expand All @@ -202,7 +215,10 @@
{
"cell_type": "markdown",
"id": "4dbca1bc",
"metadata": {},
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"#### Build an SQL query using Create_sql_query_chain"
]
Expand All @@ -211,7 +227,10 @@
"cell_type": "code",
"execution_count": 5,
"id": "f66d1a9b",
"metadata": {},
"metadata": {
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"db = SQLDatabase.from_uri(sql_uri) \n",
Expand All @@ -221,15 +240,21 @@
{
"cell_type": "markdown",
"id": "4443a2ae",
"metadata": {},
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"## Output"
]
},
{
"cell_type": "markdown",
"id": "e1eecee9",
"metadata": {},
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"#### Display result"
]
Expand All @@ -238,7 +263,10 @@
"cell_type": "code",
"execution_count": 6,
"id": "c3e94abb",
"metadata": {},
"metadata": {
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"response = chain.invoke({\"question\":\"How many songs are in the Grunge playlist ?\"})\n",
Expand All @@ -248,7 +276,10 @@
{
"cell_type": "markdown",
"id": "ebfef2e5",
"metadata": {},
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"You can test out the SQL query by running :"
]
Expand All @@ -257,7 +288,10 @@
"cell_type": "code",
"execution_count": null,
"id": "cfb1d20e",
"metadata": {},
"metadata": {
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"db.run(response)"
Expand All @@ -266,15 +300,21 @@
{
"cell_type": "markdown",
"id": "a4923704",
"metadata": {},
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"## *Text to SQL query and execution*"
]
},
{
"cell_type": "markdown",
"id": "4abf9e57",
"metadata": {},
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"## Model"
]
Expand All @@ -283,7 +323,10 @@
"cell_type": "code",
"execution_count": 7,
"id": "df536f67",
"metadata": {},
"metadata": {
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"from langchain_experimental.sql import SQLDatabaseChain"
Expand All @@ -292,7 +335,10 @@
{
"cell_type": "markdown",
"id": "3caef398",
"metadata": {},
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"#### Build and run an SQL query using SQLDatabaseChain "
]
Expand All @@ -301,7 +347,10 @@
"cell_type": "code",
"execution_count": 8,
"id": "9cc14e45",
"metadata": {},
"metadata": {
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"db = SQLDatabase.from_uri(sql_uri) \n",
Expand All @@ -312,15 +361,21 @@
{
"cell_type": "markdown",
"id": "20a4e159",
"metadata": {},
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"## Output"
]
},
{
"cell_type": "markdown",
"id": "9ea4deda",
"metadata": {},
"metadata": {
"papermill": {},
"tags": []
},
"source": [
"#### Display result"
]
Expand All @@ -329,7 +384,10 @@
"cell_type": "code",
"execution_count": 9,
"id": "eb795f63",
"metadata": {},
"metadata": {
"papermill": {},
"tags": []
},
"outputs": [],
"source": [
"db_chain.run(\"Who is the artist with the most albums ?\")"
Expand All @@ -355,8 +413,8 @@
"version": "3.11.3"
},
"naas": {
"notebook_id": "658a8244b01dfe532c4faaf8423ce808aca1020f8afdf491d99810b8e1cb4ba1",
"notebook_path": "LangChain/LangChain_CSV_Agent.ipynb"
"notebook_id": "c8dbc30b8e01ffed4b0db7efe88f7120222b35f7b081e86aca522dbe1b294818",
"notebook_path": "LangChain/LangChain_Perform_QA_on_SQL_Databases.ipynb"
},
"papermill": {
"default_parameters": {},
Expand All @@ -379,4 +437,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@ We are committed to sharing templates and giving shout outs to the contributors
* [Gmail Toolkit](https://github.com/jupyter-naas/awesome-notebooks/blob/master/LangChain/LangChain_Gmail_Toolkit.ipynb)
* [JSON Agent](https://github.com/jupyter-naas/awesome-notebooks/blob/master/LangChain/LangChain_JSON_Agent.ipynb)
* [Pandas Dataframe Agent](https://github.com/jupyter-naas/awesome-notebooks/blob/master/LangChain/LangChain_Pandas_Dataframe_Agent.ipynb)
* [QA on SQL Database](https://github.com/jupyter-naas/awesome-notebooks/blob/master/LangChain/LangChain_Perform_QA_on_SQL_Databases.ipynb)
* [Vector Search on PDF](https://github.com/jupyter-naas/awesome-notebooks/blob/master/LangChain/LangChain_Vector_Search_on_PDF.ipynb)

## LeFigaro
Expand Down
Loading

0 comments on commit c9040bd

Please sign in to comment.