From 6dddde48968e5b3994c61115d2f5d29def492e5d Mon Sep 17 00:00:00 2001 From: stsr1284 <1599zzang@gmail.com> Date: Wed, 1 Jan 2025 12:09:07 +0900 Subject: [PATCH 1/2] DatetimeOutputParser modified load_dotenv() parmeter [Team] Existing content development team 2 [Title] Datetime Output Parser [Version] initial [Language] ENG [Packages] langchain, langchain_core, langchain_openai Add the 'override' parameter to 'load_dotenv()' --- 03-OutputParser/06-DatetimeOutputParser.ipynb | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/03-OutputParser/06-DatetimeOutputParser.ipynb b/03-OutputParser/06-DatetimeOutputParser.ipynb index ce81679e3..eaab884b0 100644 --- a/03-OutputParser/06-DatetimeOutputParser.ipynb +++ b/03-OutputParser/06-DatetimeOutputParser.ipynb @@ -54,7 +54,7 @@ }, { "cell_type": "code", - "execution_count": 80, + "execution_count": 18, "id": "21943adb", "metadata": {}, "outputs": [], @@ -65,7 +65,7 @@ }, { "cell_type": "code", - "execution_count": 81, + "execution_count": 19, "id": "f25ec196", "metadata": {}, "outputs": [], @@ -87,7 +87,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 20, "id": "7f9065ea", "metadata": {}, "outputs": [ @@ -126,17 +126,17 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 21, "id": "4f99b5b6", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "False" + "True" ] }, - "execution_count": 9, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -144,7 +144,7 @@ "source": [ "from dotenv import load_dotenv\n", "\n", - "load_dotenv()" + "load_dotenv(override=True)" ] }, { @@ -181,7 +181,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 22, "id": "69cb77da", "metadata": {}, "outputs": [ @@ -191,12 +191,12 @@ "text": [ "Write a datetime string that matches the following pattern: '%Y-%m-%d'.\n", "\n", - "Examples: 0429-08-26, 1434-12-25, 1628-01-06\n", + "Examples: 0727-11-27, 0177-08-19, 0383-11-24\n", "\n", "Return ONLY this string, no other words!\n", "-----------------------------------------------\n", "\n", - "input_variables=['question'] input_types={} partial_variables={'format_instructions': \"Write a datetime string that matches the following pattern: '%Y-%m-%d'.\\n\\nExamples: 0429-08-26, 1434-12-25, 1628-01-06\\n\\nReturn ONLY this string, no other words!\"} template='Answer the users question:\\n\\n#Format Instructions: \\n{format_instructions}\\n\\n#Question: \\n{question}\\n\\n#Answer:'\n" + "input_variables=['question'] input_types={} partial_variables={'format_instructions': \"Write a datetime string that matches the following pattern: '%Y-%m-%d'.\\n\\nExamples: 0727-11-27, 0177-08-19, 0383-11-24\\n\\nReturn ONLY this string, no other words!\"} template='Answer the users question:\\n\\n#Format Instructions: \\n{format_instructions}\\n\\n#Question: \\n{question}\\n\\n#Answer:'\n" ] } ], @@ -232,7 +232,7 @@ }, { "cell_type": "code", - "execution_count": 78, + "execution_count": 23, "id": "4fc39071", "metadata": {}, "outputs": [ @@ -260,7 +260,7 @@ }, { "cell_type": "code", - "execution_count": 79, + "execution_count": 24, "id": "6cf66464", "metadata": {}, "outputs": [ @@ -270,7 +270,7 @@ "'1998-09-04'" ] }, - "execution_count": 79, + "execution_count": 24, "metadata": {}, "output_type": "execute_result" } From 2411ffbe619129f0488229f9bf05fef7d8288a2c Mon Sep 17 00:00:00 2001 From: Donghak Lee <68745729+stsr1284@users.noreply.github.com> Date: Fri, 3 Jan 2025 00:03:36 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=EC=98=A4=ED=83=80=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit praser -> parser --- 03-OutputParser/06-DatetimeOutputParser.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/03-OutputParser/06-DatetimeOutputParser.ipynb b/03-OutputParser/06-DatetimeOutputParser.ipynb index eaab884b0..084a6a555 100644 --- a/03-OutputParser/06-DatetimeOutputParser.ipynb +++ b/03-OutputParser/06-DatetimeOutputParser.ipynb @@ -28,7 +28,7 @@ "\n", "- [Overview](#overview)\n", "- [Environement Setup](#environment-setup)\n", - "- [Implementing the Datetime Output Praser](#implementing-the-datetime-output-praser)\n", + "- [Implementing the Datetime Output Parser](#implementing-the-datetime-output-parser)\n", "\n", "\n", "### References\n", @@ -152,7 +152,7 @@ "id": "c9760b5f", "metadata": {}, "source": [ - "## Implementing the Datetime Output Praser\n", + "## Implementing the Datetime Output Parser\n", "If you need to generate output in the form of a date or time, LangChain's `DatetimeOutputParser` simplifies the process.\n", "\n", "The `format` of the `DatetimeOutputParser` can be specified by referring to the table below.\n",