From c9aee31b4872e42881eec173c3481474e850109a Mon Sep 17 00:00:00 2001 From: VedantDeshmukh2 Date: Wed, 25 Sep 2024 18:09:21 +0530 Subject: [PATCH 1/9] Update Convert_any_webpage_to_quiz.ipynb --- cookbook/Convert_any_webpage_to_quiz.ipynb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cookbook/Convert_any_webpage_to_quiz.ipynb b/cookbook/Convert_any_webpage_to_quiz.ipynb index d3a6de4..519ce92 100644 --- a/cookbook/Convert_any_webpage_to_quiz.ipynb +++ b/cookbook/Convert_any_webpage_to_quiz.ipynb @@ -95,12 +95,13 @@ { "cell_type": "code", "source": [ - "from educhain import qna_engine\n", + "from educhain import Educhain\n", "from langchain_openai import ChatOpenAI\n", "\n", "gpt_4o_mini = ChatOpenAI(model = \"gpt-4o-mini\")\n", "\n", - "url_mcqs = qna_engine.generate_mcqs_from_data(\n", + "client = Educhain()\n" + "url_mcqs = client.qna_engine.generate_questions_from_data(\n", " source=\"https://en.wikipedia.org/wiki/Butterfly_effect\",\n", " source_type=\"url\",\n", " num=5,\n", @@ -191,4 +192,4 @@ "outputs": [] } ] -} \ No newline at end of file +} From cc236e55c82759640e06c4214f4bc78b45db3ff3 Mon Sep 17 00:00:00 2001 From: VedantDeshmukh2 Date: Wed, 25 Sep 2024 18:12:41 +0530 Subject: [PATCH 2/9] Delete cookbook/Convert_any_webpage_to_quiz.ipynb --- cookbook/Convert_any_webpage_to_quiz.ipynb | 195 --------------------- 1 file changed, 195 deletions(-) delete mode 100644 cookbook/Convert_any_webpage_to_quiz.ipynb diff --git a/cookbook/Convert_any_webpage_to_quiz.ipynb b/cookbook/Convert_any_webpage_to_quiz.ipynb deleted file mode 100644 index 519ce92..0000000 --- a/cookbook/Convert_any_webpage_to_quiz.ipynb +++ /dev/null @@ -1,195 +0,0 @@ -{ - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - }, - "language_info": { - "name": "python" - } - }, - "cells": [ - { - "cell_type": "markdown", - "source": [ - "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1i-K3mdWfyApCuUx7t_uSRTczZ-B4qpdI?usp=sharing)" - ], - "metadata": { - "id": "ScXuwxJl9uTo" - } - }, - { - "cell_type": "markdown", - "source": [ - "## Convert any webpage to quiz with [Educhain](https://github.com/satvik314/educhain)\n", - "\n", - "\n", - "Explore the power of AI-driven education with Educhain! This notebook demonstrates how to create high-quality Multiple Choice Questions (MCQs) from any Web URL.\n", - "\n", - "Key Features of Educhain:\n", - "- Generate MCQs from PDF files, web pages, and plain text\n", - "- Customize difficulty levels and learning objectives\n", - "- Export questions to CSV, JSON, or PDF formats\n", - "- Leverage advanced language models for question generation" - ], - "metadata": { - "id": "pZFj9oTc-LtI" - } - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "AUaUnlRo6pT3", - "outputId": "aa5aa1cd-1b26-419b-e2e3-d83cff7174b4" - }, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m990.0/990.0 kB\u001b[0m \u001b[31m11.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.3/2.3 MB\u001b[0m \u001b[31m14.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m46.7/46.7 kB\u001b[0m \u001b[31m2.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m337.0/337.0 kB\u001b[0m \u001b[31m11.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.9/1.9 MB\u001b[0m \u001b[31m13.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m232.6/232.6 kB\u001b[0m \u001b[31m8.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m373.5/373.5 kB\u001b[0m \u001b[31m9.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m139.8/139.8 kB\u001b[0m \u001b[31m7.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.1/1.1 MB\u001b[0m \u001b[31m42.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m75.6/75.6 kB\u001b[0m \u001b[31m4.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m49.2/49.2 kB\u001b[0m \u001b[31m2.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m77.9/77.9 kB\u001b[0m \u001b[31m5.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m5.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m141.1/141.1 kB\u001b[0m \u001b[31m4.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25h" - ] - } - ], - "source": [ - "!pip install -qU educhain" - ] - }, - { - "cell_type": "code", - "source": [ - "import os\n", - "from google.colab import userdata\n", - "\n", - "os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY')" - ], - "metadata": { - "id": "e5R2skFs6wCq" - }, - "execution_count": 2, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "from educhain import Educhain\n", - "from langchain_openai import ChatOpenAI\n", - "\n", - "gpt_4o_mini = ChatOpenAI(model = \"gpt-4o-mini\")\n", - "\n", - "client = Educhain()\n" - "url_mcqs = client.qna_engine.generate_questions_from_data(\n", - " source=\"https://en.wikipedia.org/wiki/Butterfly_effect\",\n", - " source_type=\"url\",\n", - " num=5,\n", - " llm = gpt_4o_mini\n", - " )\n", - "\n", - "url_mcqs.show()" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "-GIvZQuO6zKH", - "outputId": "230790b6-50b9-4eb3-cb16-289024245d6a" - }, - "execution_count": 4, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "Question 1:\n", - "Question: What is the butterfly effect primarily associated with?\n", - "Options:\n", - " A. Quantum mechanics\n", - " B. Sensitive dependence on initial conditions\n", - " C. Linear systems\n", - " D. Gravitational waves\n", - "\n", - "Correct Answer: Sensitive dependence on initial conditions\n", - "Explanation: The butterfly effect refers to the phenomenon where a small change in initial conditions can lead to vastly different outcomes in complex systems, particularly highlighted in chaos theory.\n", - "\n", - "Question 2:\n", - "Question: Who is credited with popularizing the term 'butterfly effect'?\n", - "Options:\n", - " A. Henri Poincaré\n", - " B. Norbert Wiener\n", - " C. Edward Norton Lorenz\n", - " D. Ray Bradbury\n", - "\n", - "Correct Answer: Edward Norton Lorenz\n", - "Explanation: Edward Norton Lorenz, a mathematician and meteorologist, is credited with the term 'butterfly effect' after he illustrated how small changes in initial conditions can lead to significant differences in outcomes.\n", - "\n", - "Question 3:\n", - "Question: In what context is the butterfly effect most commonly discussed?\n", - "Options:\n", - " A. Quantum mechanics\n", - " B. Weather prediction\n", - " C. Economic modeling\n", - " D. Biological systems\n", - "\n", - "Correct Answer: Weather prediction\n", - "Explanation: The butterfly effect is most commonly discussed in the context of weather prediction, where minor changes in atmospheric conditions can lead to vastly different weather patterns.\n", - "\n", - "Question 4:\n", - "Question: What metaphor does the butterfly effect use to illustrate its concept?\n", - "Options:\n", - " A. A sea gull causing a hurricane\n", - " B. A butterfly flapping its wings causing a tornado\n", - " C. A pebble causing an avalanche\n", - " D. A tree falling in a forest\n", - "\n", - "Correct Answer: A butterfly flapping its wings causing a tornado\n", - "Explanation: The butterfly effect uses the metaphor of a butterfly flapping its wings to suggest that small actions can lead to significant consequences, such as influencing the formation of a tornado.\n", - "\n", - "Question 5:\n", - "Question: What does the phrase 'sensitive dependence on initial conditions' mean?\n", - "Options:\n", - " A. The outcomes of a system are predictable based on its initial state.\n", - " B. Minor differences in initial states can lead to vastly different outcomes.\n", - " C. All systems behave predictably regardless of initial conditions.\n", - " D. Initial conditions have no impact on outcomes over time.\n", - "\n", - "Correct Answer: Minor differences in initial states can lead to vastly different outcomes.\n", - "Explanation: Sensitive dependence on initial conditions refers to the idea that small changes at the beginning of a process can result in large differences in the end state, which is a fundamental characteristic of chaotic systems.\n", - "\n" - ] - } - ] - }, - { - "cell_type": "code", - "source": [], - "metadata": { - "id": "ewgsof_97Ouk" - }, - "execution_count": null, - "outputs": [] - } - ] -} From 3008f82e523eb2dbd759490140f53b587f32893d Mon Sep 17 00:00:00 2001 From: VedantDeshmukh2 Date: Wed, 25 Sep 2024 18:14:25 +0530 Subject: [PATCH 3/9] Add files via upload --- cookbook/Convert_any_webpage_to_quiz.ipynb | 196 +++++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 cookbook/Convert_any_webpage_to_quiz.ipynb diff --git a/cookbook/Convert_any_webpage_to_quiz.ipynb b/cookbook/Convert_any_webpage_to_quiz.ipynb new file mode 100644 index 0000000..c516e21 --- /dev/null +++ b/cookbook/Convert_any_webpage_to_quiz.ipynb @@ -0,0 +1,196 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/185Py9FXMLspaEqwmUAx0I1p-IeCa67zH?usp=sharing)" + ], + "metadata": { + "id": "ScXuwxJl9uTo" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Convert any webpage to quiz with [Educhain](https://github.com/satvik314/educhain)\n", + "\n", + "\n", + "Explore the power of AI-driven education with Educhain! This notebook demonstrates how to create high-quality Multiple Choice Questions (MCQs) from any Web URL.\n", + "\n", + "Key Features of Educhain:\n", + "- Generate MCQs from PDF files, web pages, and plain text\n", + "- Customize difficulty levels and learning objectives\n", + "- Export questions to CSV, JSON, or PDF formats\n", + "- Leverage advanced language models for question generation" + ], + "metadata": { + "id": "pZFj9oTc-LtI" + } + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "AUaUnlRo6pT3", + "outputId": "aa5aa1cd-1b26-419b-e2e3-d83cff7174b4" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m990.0/990.0 kB\u001b[0m \u001b[31m11.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.3/2.3 MB\u001b[0m \u001b[31m14.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m46.7/46.7 kB\u001b[0m \u001b[31m2.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m337.0/337.0 kB\u001b[0m \u001b[31m11.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.9/1.9 MB\u001b[0m \u001b[31m13.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m232.6/232.6 kB\u001b[0m \u001b[31m8.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m373.5/373.5 kB\u001b[0m \u001b[31m9.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m139.8/139.8 kB\u001b[0m \u001b[31m7.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.1/1.1 MB\u001b[0m \u001b[31m42.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m75.6/75.6 kB\u001b[0m \u001b[31m4.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m49.2/49.2 kB\u001b[0m \u001b[31m2.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m77.9/77.9 kB\u001b[0m \u001b[31m5.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m5.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m141.1/141.1 kB\u001b[0m \u001b[31m4.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25h" + ] + } + ], + "source": [ + "!pip install -qU educhain" + ] + }, + { + "cell_type": "code", + "source": [ + "import os\n", + "from google.colab import userdata\n", + "\n", + "os.environ[\"OPENAI_API_KEY\"] = userdata.get('OPENAI_API_KEY')" + ], + "metadata": { + "id": "e5R2skFs6wCq" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "source": [ + "from educhain import Educhain\n", + "from langchain_openai import ChatOpenAI\n", + "\n", + "gpt_4o_mini = ChatOpenAI(model = \"gpt-4o-mini\")\n", + "\n", + "client = Educhain()\n", + "\n", + "url_mcqs = qna_engine.generate_mcqs_from_data(\n", + " source=\"https://en.wikipedia.org/wiki/Butterfly_effect\",\n", + " source_type=\"url\",\n", + " num=5,\n", + " llm = gpt_4o_mini\n", + " )\n", + "\n", + "url_mcqs.show()" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "-GIvZQuO6zKH", + "outputId": "230790b6-50b9-4eb3-cb16-289024245d6a" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Question 1:\n", + "Question: What is the butterfly effect primarily associated with?\n", + "Options:\n", + " A. Quantum mechanics\n", + " B. Sensitive dependence on initial conditions\n", + " C. Linear systems\n", + " D. Gravitational waves\n", + "\n", + "Correct Answer: Sensitive dependence on initial conditions\n", + "Explanation: The butterfly effect refers to the phenomenon where a small change in initial conditions can lead to vastly different outcomes in complex systems, particularly highlighted in chaos theory.\n", + "\n", + "Question 2:\n", + "Question: Who is credited with popularizing the term 'butterfly effect'?\n", + "Options:\n", + " A. Henri Poincaré\n", + " B. Norbert Wiener\n", + " C. Edward Norton Lorenz\n", + " D. Ray Bradbury\n", + "\n", + "Correct Answer: Edward Norton Lorenz\n", + "Explanation: Edward Norton Lorenz, a mathematician and meteorologist, is credited with the term 'butterfly effect' after he illustrated how small changes in initial conditions can lead to significant differences in outcomes.\n", + "\n", + "Question 3:\n", + "Question: In what context is the butterfly effect most commonly discussed?\n", + "Options:\n", + " A. Quantum mechanics\n", + " B. Weather prediction\n", + " C. Economic modeling\n", + " D. Biological systems\n", + "\n", + "Correct Answer: Weather prediction\n", + "Explanation: The butterfly effect is most commonly discussed in the context of weather prediction, where minor changes in atmospheric conditions can lead to vastly different weather patterns.\n", + "\n", + "Question 4:\n", + "Question: What metaphor does the butterfly effect use to illustrate its concept?\n", + "Options:\n", + " A. A sea gull causing a hurricane\n", + " B. A butterfly flapping its wings causing a tornado\n", + " C. A pebble causing an avalanche\n", + " D. A tree falling in a forest\n", + "\n", + "Correct Answer: A butterfly flapping its wings causing a tornado\n", + "Explanation: The butterfly effect uses the metaphor of a butterfly flapping its wings to suggest that small actions can lead to significant consequences, such as influencing the formation of a tornado.\n", + "\n", + "Question 5:\n", + "Question: What does the phrase 'sensitive dependence on initial conditions' mean?\n", + "Options:\n", + " A. The outcomes of a system are predictable based on its initial state.\n", + " B. Minor differences in initial states can lead to vastly different outcomes.\n", + " C. All systems behave predictably regardless of initial conditions.\n", + " D. Initial conditions have no impact on outcomes over time.\n", + "\n", + "Correct Answer: Minor differences in initial states can lead to vastly different outcomes.\n", + "Explanation: Sensitive dependence on initial conditions refers to the idea that small changes at the beginning of a process can result in large differences in the end state, which is a fundamental characteristic of chaotic systems.\n", + "\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "ewgsof_97Ouk" + }, + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file From 75f59ab5beaabaf065582f3179edf2b4a93ff2c6 Mon Sep 17 00:00:00 2001 From: VedantDeshmukh2 Date: Wed, 25 Sep 2024 18:19:55 +0530 Subject: [PATCH 4/9] Delete cookbook/educhain_claude3_5_sonnet.ipynb --- cookbook/educhain_claude3_5_sonnet.ipynb | 219 ----------------------- 1 file changed, 219 deletions(-) delete mode 100644 cookbook/educhain_claude3_5_sonnet.ipynb diff --git a/cookbook/educhain_claude3_5_sonnet.ipynb b/cookbook/educhain_claude3_5_sonnet.ipynb deleted file mode 100644 index 916bf73..0000000 --- a/cookbook/educhain_claude3_5_sonnet.ipynb +++ /dev/null @@ -1,219 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "source": [ - "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1pVcI0MPqlww9O5NXwOWxMNFwkWsEhyON?usp=sharing)" - ], - "metadata": { - "id": "dNGLGan2h4I2" - } - }, - { - "cell_type": "markdown", - "source": [ - "## Educhain + Claude 3.5 Sonnet\n", - "\n", - "Generate high quality MCQs with Educhain & Claude 3.5 Sonnet in a flash!" - ], - "metadata": { - "id": "ZOXOIvSmh_GT" - } - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "d1L8uTg01jyV", - "outputId": "7fa6a68c-9795-4690-bbca-cfd4aa4d9e0d" - }, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m975.5/975.5 kB\u001b[0m \u001b[31m6.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.2/2.2 MB\u001b[0m \u001b[31m14.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m40.6/40.6 kB\u001b[0m \u001b[31m2.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m327.5/327.5 kB\u001b[0m \u001b[31m16.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.9/1.9 MB\u001b[0m \u001b[31m23.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m863.5/863.5 kB\u001b[0m \u001b[31m22.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m332.8/332.8 kB\u001b[0m \u001b[31m20.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m75.6/75.6 kB\u001b[0m \u001b[31m3.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m318.9/318.9 kB\u001b[0m \u001b[31m17.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m127.4/127.4 kB\u001b[0m \u001b[31m8.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.1/1.1 MB\u001b[0m \u001b[31m14.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m49.2/49.2 kB\u001b[0m \u001b[31m2.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m77.9/77.9 kB\u001b[0m \u001b[31m8.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m3.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m145.0/145.0 kB\u001b[0m \u001b[31m3.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", - "\u001b[?25h" - ] - } - ], - "source": [ - "!pip install -qU educhain langchain_anthropic" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "id": "EpFqH5_WXQq_" - }, - "outputs": [], - "source": [ - "import os\n", - "from google.colab import userdata\n", - "\n", - "os.environ[\"ANTHROPIC_API_KEY\"] = userdata.get('ANTHROPIC_API_KEY')" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "id": "2AESsAOd-xfF" - }, - "outputs": [], - "source": [ - "from langchain_anthropic import ChatAnthropic\n", - "\n", - "sonnet = ChatAnthropic(model = \"claude-3-5-sonnet-20240620\")" - ] - }, - { - "cell_type": "code", - "source": [ - "from educhain import qna_engine\n", - "\n", - "questions = qna_engine.generate_mcq(topic = \"Functions - Calculus\",\n", - " num = 5,\n", - " llm = sonnet\n", - " )\n", - "\n", - "questions" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "YVq1bTXviJLI", - "outputId": "d51bf077-2c92-44e4-83bf-298a0cf72ef3" - }, - "execution_count": 6, - "outputs": [ - { - "output_type": "execute_result", - "data": { - "text/plain": [ - "MCQList(questions=[MCQ(question='What is the derivative of f(x) = x^2?', options=[\"f'(x) = x\", \"f'(x) = 2x\", \"f'(x) = 2\", \"f'(x) = x^2\"], correct_answer=\"f'(x) = 2x\", explanation='The derivative of x^2 is 2x using the power rule: d/dx(x^n) = nx^(n-1).'), MCQ(question='Which of the following is an example of a discontinuous function?', options=['f(x) = x^2', 'f(x) = sin(x)', 'f(x) = 1/x', 'f(x) = e^x'], correct_answer='f(x) = 1/x', explanation=\"The function f(x) = 1/x is discontinuous at x = 0, as it's undefined at this point.\"), MCQ(question='What is the integral of f(x) = 2x?', options=['F(x) = x^2 + C', 'F(x) = 2x^2 + C', 'F(x) = x^2/2 + C', 'F(x) = 2x + C'], correct_answer='F(x) = x^2 + C', explanation='The integral of 2x is x^2 + C, as the derivative of x^2 is 2x.'), MCQ(question='Which of the following is true for an even function?', options=['f(-x) = f(x)', 'f(-x) = -f(x)', 'f(x+y) = f(x) + f(y)', 'f(xy) = f(x)f(y)'], correct_answer='f(-x) = f(x)', explanation='An even function is symmetric about the y-axis, meaning f(-x) = f(x) for all x in the domain of f.'), MCQ(question='What is the limit of (sin x)/x as x approaches 0?', options=['0', '1', 'Undefined', 'Infinity'], correct_answer='1', explanation='This is a famous limit in calculus. Although it appears to be 0/0 (indeterminate form), the limit actually exists and equals 1.')])" - ] - }, - "metadata": {}, - "execution_count": 6 - } - ] - }, - { - "cell_type": "code", - "source": [ - "questions.show()" - ], - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "eRO5DcWlJaok", - "outputId": "2874fe5b-f870-488f-f678-e73a521b870b" - }, - "execution_count": 7, - "outputs": [ - { - "output_type": "stream", - "name": "stdout", - "text": [ - "MCQs:\n", - "\n", - "Question 1:\n", - "Question: What is the derivative of f(x) = x^2?\n", - "Options:\n", - " A. f'(x) = x\n", - " B. f'(x) = 2x\n", - " C. f'(x) = 2\n", - " D. f'(x) = x^2\n", - "Correct Answer: f'(x) = 2x\n", - "Explanation: The derivative of x^2 is 2x using the power rule: d/dx(x^n) = nx^(n-1).\n", - "\n", - "Question 2:\n", - "Question: Which of the following is an example of a discontinuous function?\n", - "Options:\n", - " A. f(x) = x^2\n", - " B. f(x) = sin(x)\n", - " C. f(x) = 1/x\n", - " D. f(x) = e^x\n", - "Correct Answer: f(x) = 1/x\n", - "Explanation: The function f(x) = 1/x is discontinuous at x = 0, as it's undefined at this point.\n", - "\n", - "Question 3:\n", - "Question: What is the integral of f(x) = 2x?\n", - "Options:\n", - " A. F(x) = x^2 + C\n", - " B. F(x) = 2x^2 + C\n", - " C. F(x) = x^2/2 + C\n", - " D. F(x) = 2x + C\n", - "Correct Answer: F(x) = x^2 + C\n", - "Explanation: The integral of 2x is x^2 + C, as the derivative of x^2 is 2x.\n", - "\n", - "Question 4:\n", - "Question: Which of the following is true for an even function?\n", - "Options:\n", - " A. f(-x) = f(x)\n", - " B. f(-x) = -f(x)\n", - " C. f(x+y) = f(x) + f(y)\n", - " D. f(xy) = f(x)f(y)\n", - "Correct Answer: f(-x) = f(x)\n", - "Explanation: An even function is symmetric about the y-axis, meaning f(-x) = f(x) for all x in the domain of f.\n", - "\n", - "Question 5:\n", - "Question: What is the limit of (sin x)/x as x approaches 0?\n", - "Options:\n", - " A. 0\n", - " B. 1\n", - " C. Undefined\n", - " D. Infinity\n", - "Correct Answer: 1\n", - "Explanation: This is a famous limit in calculus. Although it appears to be 0/0 (indeterminate form), the limit actually exists and equals 1.\n", - "\n" - ] - } - ] - }, - { - "cell_type": "code", - "source": [], - "metadata": { - "id": "60_DRNlmiNSt" - }, - "execution_count": null, - "outputs": [] - } - ], - "metadata": { - "colab": { - "provenance": [] - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file From 6237015d8b414feb4ef1d4ae11aaf48e851887f5 Mon Sep 17 00:00:00 2001 From: VedantDeshmukh2 Date: Wed, 25 Sep 2024 18:20:06 +0530 Subject: [PATCH 5/9] Add files via upload --- cookbook/educhain_claude3_5_sonnet.ipynb | 222 +++++++++++++++++++++++ 1 file changed, 222 insertions(+) create mode 100644 cookbook/educhain_claude3_5_sonnet.ipynb diff --git a/cookbook/educhain_claude3_5_sonnet.ipynb b/cookbook/educhain_claude3_5_sonnet.ipynb new file mode 100644 index 0000000..a5fb7e5 --- /dev/null +++ b/cookbook/educhain_claude3_5_sonnet.ipynb @@ -0,0 +1,222 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "source": [ + "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1-t8Lvh10g3Qj_6bALuWIySqEHX9wWyjw?usp=sharing)" + ], + "metadata": { + "id": "dNGLGan2h4I2" + } + }, + { + "cell_type": "markdown", + "source": [ + "## Educhain + Claude 3.5 Sonnet\n", + "\n", + "Generate high quality MCQs with Educhain & Claude 3.5 Sonnet in a flash!" + ], + "metadata": { + "id": "ZOXOIvSmh_GT" + } + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "d1L8uTg01jyV", + "outputId": "7fa6a68c-9795-4690-bbca-cfd4aa4d9e0d" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m975.5/975.5 kB\u001b[0m \u001b[31m6.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.2/2.2 MB\u001b[0m \u001b[31m14.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m40.6/40.6 kB\u001b[0m \u001b[31m2.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m327.5/327.5 kB\u001b[0m \u001b[31m16.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.9/1.9 MB\u001b[0m \u001b[31m23.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m863.5/863.5 kB\u001b[0m \u001b[31m22.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m332.8/332.8 kB\u001b[0m \u001b[31m20.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m75.6/75.6 kB\u001b[0m \u001b[31m3.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m318.9/318.9 kB\u001b[0m \u001b[31m17.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m127.4/127.4 kB\u001b[0m \u001b[31m8.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.1/1.1 MB\u001b[0m \u001b[31m14.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m49.2/49.2 kB\u001b[0m \u001b[31m2.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m77.9/77.9 kB\u001b[0m \u001b[31m8.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m3.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m145.0/145.0 kB\u001b[0m \u001b[31m3.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25h" + ] + } + ], + "source": [ + "!pip install -qU educhain langchain_anthropic" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "EpFqH5_WXQq_" + }, + "outputs": [], + "source": [ + "import os\n", + "from google.colab import userdata\n", + "\n", + "os.environ[\"ANTHROPIC_API_KEY\"] = userdata.get('ANTHROPIC_API_KEY')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "2AESsAOd-xfF" + }, + "outputs": [], + "source": [ + "from langchain_anthropic import ChatAnthropic\n", + "\n", + "sonnet = ChatAnthropic(model = \"claude-3-5-sonnet-20240620\")" + ] + }, + { + "cell_type": "code", + "source": [ + "from educhain import Educhain, LLMConfig\n", + "\n", + "sonnet_config = LLMConfig(custom_model=sonnet)\n", + "\n", + "client = Educhain(sonnet_config)\n", + "\n", + "questions = client.qna_engine.generate_questions(topic = \"Functions - Calculus\",\n", + " num = 5\n", + " )\n", + "\n", + "questions" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "YVq1bTXviJLI", + "outputId": "d51bf077-2c92-44e4-83bf-298a0cf72ef3" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "MCQList(questions=[MCQ(question='What is the derivative of f(x) = x^2?', options=[\"f'(x) = x\", \"f'(x) = 2x\", \"f'(x) = 2\", \"f'(x) = x^2\"], correct_answer=\"f'(x) = 2x\", explanation='The derivative of x^2 is 2x using the power rule: d/dx(x^n) = nx^(n-1).'), MCQ(question='Which of the following is an example of a discontinuous function?', options=['f(x) = x^2', 'f(x) = sin(x)', 'f(x) = 1/x', 'f(x) = e^x'], correct_answer='f(x) = 1/x', explanation=\"The function f(x) = 1/x is discontinuous at x = 0, as it's undefined at this point.\"), MCQ(question='What is the integral of f(x) = 2x?', options=['F(x) = x^2 + C', 'F(x) = 2x^2 + C', 'F(x) = x^2/2 + C', 'F(x) = 2x + C'], correct_answer='F(x) = x^2 + C', explanation='The integral of 2x is x^2 + C, as the derivative of x^2 is 2x.'), MCQ(question='Which of the following is true for an even function?', options=['f(-x) = f(x)', 'f(-x) = -f(x)', 'f(x+y) = f(x) + f(y)', 'f(xy) = f(x)f(y)'], correct_answer='f(-x) = f(x)', explanation='An even function is symmetric about the y-axis, meaning f(-x) = f(x) for all x in the domain of f.'), MCQ(question='What is the limit of (sin x)/x as x approaches 0?', options=['0', '1', 'Undefined', 'Infinity'], correct_answer='1', explanation='This is a famous limit in calculus. Although it appears to be 0/0 (indeterminate form), the limit actually exists and equals 1.')])" + ] + }, + "metadata": {}, + "execution_count": 6 + } + ] + }, + { + "cell_type": "code", + "source": [ + "questions.show()" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "eRO5DcWlJaok", + "outputId": "2874fe5b-f870-488f-f678-e73a521b870b" + }, + "execution_count": null, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "MCQs:\n", + "\n", + "Question 1:\n", + "Question: What is the derivative of f(x) = x^2?\n", + "Options:\n", + " A. f'(x) = x\n", + " B. f'(x) = 2x\n", + " C. f'(x) = 2\n", + " D. f'(x) = x^2\n", + "Correct Answer: f'(x) = 2x\n", + "Explanation: The derivative of x^2 is 2x using the power rule: d/dx(x^n) = nx^(n-1).\n", + "\n", + "Question 2:\n", + "Question: Which of the following is an example of a discontinuous function?\n", + "Options:\n", + " A. f(x) = x^2\n", + " B. f(x) = sin(x)\n", + " C. f(x) = 1/x\n", + " D. f(x) = e^x\n", + "Correct Answer: f(x) = 1/x\n", + "Explanation: The function f(x) = 1/x is discontinuous at x = 0, as it's undefined at this point.\n", + "\n", + "Question 3:\n", + "Question: What is the integral of f(x) = 2x?\n", + "Options:\n", + " A. F(x) = x^2 + C\n", + " B. F(x) = 2x^2 + C\n", + " C. F(x) = x^2/2 + C\n", + " D. F(x) = 2x + C\n", + "Correct Answer: F(x) = x^2 + C\n", + "Explanation: The integral of 2x is x^2 + C, as the derivative of x^2 is 2x.\n", + "\n", + "Question 4:\n", + "Question: Which of the following is true for an even function?\n", + "Options:\n", + " A. f(-x) = f(x)\n", + " B. f(-x) = -f(x)\n", + " C. f(x+y) = f(x) + f(y)\n", + " D. f(xy) = f(x)f(y)\n", + "Correct Answer: f(-x) = f(x)\n", + "Explanation: An even function is symmetric about the y-axis, meaning f(-x) = f(x) for all x in the domain of f.\n", + "\n", + "Question 5:\n", + "Question: What is the limit of (sin x)/x as x approaches 0?\n", + "Options:\n", + " A. 0\n", + " B. 1\n", + " C. Undefined\n", + " D. Infinity\n", + "Correct Answer: 1\n", + "Explanation: This is a famous limit in calculus. Although it appears to be 0/0 (indeterminate form), the limit actually exists and equals 1.\n", + "\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "60_DRNlmiNSt" + }, + "execution_count": null, + "outputs": [] + } + ], + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3", + "name": "python3" + }, + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file From 85393953bf259084b39369456eab02c155ee8e0b Mon Sep 17 00:00:00 2001 From: VedantDeshmukh2 Date: Wed, 25 Sep 2024 18:21:12 +0530 Subject: [PATCH 6/9] Update index.md --- docs/index.md | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/docs/index.md b/docs/index.md index 95cc437..987786d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -31,9 +31,11 @@ Educhain consistently outperforms traditional methods in content generation spee ## 🚀 Get Started in Minutes ```python -from educhain import qna_engine +from educhain import Educhain -questions = qna_engine.generate_mcq( +client = Educhain() + +questions = client.qna_engine.generate_questions( topic="Indian History", level="Beginner", num=5 @@ -47,15 +49,6 @@ print(questions) Educators worldwide are using Educhain to transform their teaching. Check out our [success stories](resources/case-studies.md) to see how Educhain is making a difference in classrooms around the globe. -## 🗺️ Roadmap - -We're constantly improving Educhain. Here's what's on the horizon: - -- [ ] Finetuned Model for question generation -- [ ] Integration with popular Learning Management Systems -- [ ] Mobile app for on-the-go content generation - -[📅 View our full roadmap](https://github.com/educhain/educhain/projects/1) ## 🤝 Contributing From b35b7e26f7d6578ef6f0d11eb592354eb8b8ad94 Mon Sep 17 00:00:00 2001 From: VedantDeshmukh2 Date: Wed, 25 Sep 2024 18:22:01 +0530 Subject: [PATCH 7/9] Update mcq_from_data.md --- docs/features/mcq_from_data.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/features/mcq_from_data.md b/docs/features/mcq_from_data.md index 584f74a..1e915a1 100644 --- a/docs/features/mcq_from_data.md +++ b/docs/features/mcq_from_data.md @@ -5,9 +5,10 @@ Generate engaging MCQs from various data sources using AI! 🧠✨ ## 🚀 Basic Usage ```python -from educhain import generate_mcqs_from_data +from educhain import Educhain -questions = generate_mcqs_from_data( +client = Educhain() +questions = client.qna_engine.generate_questions_from_data( source="https://en.wikipedia.org/wiki/Artificial_intelligence", source_type="url", num=5, From 2003577ebbf042e542917a7a60891a5ba1fd2fc4 Mon Sep 17 00:00:00 2001 From: VedantDeshmukh2 Date: Wed, 25 Sep 2024 18:22:58 +0530 Subject: [PATCH 8/9] Update mcq_generation.md --- docs/features/mcq_generation.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/features/mcq_generation.md b/docs/features/mcq_generation.md index 26fbf14..2578116 100644 --- a/docs/features/mcq_generation.md +++ b/docs/features/mcq_generation.md @@ -8,9 +8,10 @@ Unleash the power of AI to create engaging MCQs! 🧠✨ ## 🚀 Basic Usage ```python -from educhain import qna_engine +from educhain import Educhain -questions = qna_engine.generate_mcq( +client = Educhain() +questions = client.qna_engine.generate_questions( topic="Python Programming", level="Intermediate", num=10 From f51e3396aa19a43b675f5522e7156ba5deee5062 Mon Sep 17 00:00:00 2001 From: VedantDeshmukh2 Date: Wed, 25 Sep 2024 18:26:50 +0530 Subject: [PATCH 9/9] Update quick-start.md --- docs/getting-started/quick-start.md | 40 ++++++++++++++--------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/docs/getting-started/quick-start.md b/docs/getting-started/quick-start.md index eba5c62..d05cc85 100644 --- a/docs/getting-started/quick-start.md +++ b/docs/getting-started/quick-start.md @@ -9,10 +9,14 @@ Get up and running with Educhain in minutes! 🚀 Here's a simple example to generate multiple-choice questions: + ```python -from educhain import qna_engine +` +from educhain import Educhain + +client = Educhain() -questions = qna_engine.generate_mcq( +questions = client.qna_engine.generate_questions( topic="Python Programming", level="Beginner", num=5 @@ -30,7 +34,9 @@ for i, q in enumerate(questions, 1): Customize your questions with additional parameters: ```python -questions = qna_engine.generate_mcq( +client = Educhain() + +questions = client.qna_engine.generate_questions( topic="Machine Learning", level="Intermediate", num=3, @@ -44,9 +50,9 @@ questions = qna_engine.generate_mcq( Create comprehensive lesson plans with ease: ```python -from educhain import content_engine - -lesson_plan = content_engine.generate_lesson_plan( +from educhain import Educhain() +client = Educhain() +lesson_plan = client.content_engine.generate_lesson_plan( topic="World War II", grade_level="High School", duration="60 minutes" @@ -92,24 +98,16 @@ export EDUCHAIN_API_KEY="your-api-key-here" Choose your preferred language model: ```python -from educhain import qna_engine +from langchain_google_genai import ChatGoogleGenerativeAI +from educhain import Educhain, LLMConfig -qna_engine.set_model("gpt-4") # Default is "gpt-3.5-turbo" -``` - -## 🎨 Customizing Prompt Templates - -Define your own prompt templates: - -```python -from educhain import qna_engine +gemini_flash = ChatGoogleGenerativeAI( + model="gemini-1.5-flash-exp-0827", + google_api_key="GOOGLE_API_KEY") -custom_template = """ -Generate {num} multiple-choice questions about {topic} at {level} level. -Each question should have 4 options and one correct answer. -""" +flash_config = LLMConfig(custom_model=gemini_flash) -qna_engine.set_prompt_template(custom_template) +client = Educhain(flash_config) ```