-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
721dc3f
commit 7c9b18a
Showing
12 changed files
with
518 additions
and
328 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
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
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,92 @@ | ||
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/06_chatbot.ipynb. | ||
|
||
# %% auto 0 | ||
__all__ = ['StudentChatBot', 'EducatorChatBot'] | ||
|
||
# %% ../nbs/06_chatbot.ipynb 1 | ||
import ipywidgets as widgets | ||
import traitlets | ||
from ipywidgets import Textarea, Text, Layout, HBox, Stack, Layout | ||
from traitlets import HasTraits | ||
import os | ||
from langchain_openai import ChatOpenAI | ||
from langchain_core.messages import HumanMessage, SystemMessage | ||
from langchain_core.prompts.chat import ( | ||
ChatPromptTemplate, | ||
HumanMessagePromptTemplate, | ||
SystemMessagePromptTemplate, | ||
) | ||
from langchain_openai import ChatOpenAI | ||
from .chatbot import ChatBot, ChatBotModel | ||
|
||
# %% ../nbs/06_chatbot.ipynb 7 | ||
class StudentChatBot(widgets.VBox): | ||
|
||
#user = traitlets.CUnicode() | ||
#response = traitlets.CUnicode() | ||
#step_by_step = traitlets.Bool() | ||
#metaphor = traitlets.Bool() | ||
#hints = traitlets.Bool() | ||
#guided_questions = traitlets.Bool() | ||
|
||
def __init__(self, chatbot_model): | ||
# If you forget to call the superconstructor on an extended widget | ||
# you will get an AttributeError: object has no attribute '_model_id' | ||
super().__init__() | ||
|
||
self.chat_bot = ChatBot(chatbot_model) | ||
|
||
self.suggestion_buttons = HBox() | ||
self.step_by_step = widgets.Button( | ||
description='Step-by-Step', | ||
button_style='info', | ||
tooltip='Description', | ||
) | ||
self.metaphor = widgets.Button( | ||
description='Metaphor', | ||
button_style='info', | ||
tooltip='Description', | ||
) | ||
self.hints = widgets.Button( | ||
description='Hints', | ||
button_style='info', | ||
tooltip='Description', | ||
) | ||
self.guided_questions = widgets.Button( | ||
description='AI Guided Questions', | ||
button_style='info', | ||
tooltip='Description', | ||
) | ||
self.suggestion_buttons.children = (self.step_by_step, self.metaphor, self.hints, self.guided_questions) | ||
self.children = (self.chat_bot, self.suggestion_buttons) | ||
|
||
# %% ../nbs/06_chatbot.ipynb 9 | ||
class EducatorChatBot(widgets.VBox): | ||
|
||
#user = traitlets.CUnicode() | ||
#response = traitlets.CUnicode() | ||
#step_by_step = traitlets.Bool() | ||
#metaphor = traitlets.Bool() | ||
#hints = traitlets.Bool() | ||
#guided_questions = traitlets.Bool() | ||
|
||
def __init__(self, chatbot_model): | ||
# If you forget to call the superconstructor on an extended widget | ||
# you will get an AttributeError: object has no attribute '_model_id' | ||
super().__init__() | ||
|
||
self.chat_bot = ChatBot(chatbot_model) | ||
|
||
self.suggestion_buttons = HBox() | ||
self.exam_questions = widgets.Button( | ||
description='Exam Questions', | ||
button_style='info', | ||
tooltip='Description', | ||
) | ||
self.lesson_plan = widgets.Button( | ||
description='Lesson Plan', | ||
button_style='info', | ||
tooltip='Description', | ||
) | ||
self.suggestion_buttons.children = (self.exam_questions, self.lesson_plan ) | ||
self.children = (self.chat_bot, self.suggestion_buttons) |
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
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
Oops, something went wrong.