-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add basic data fields and design
- Loading branch information
1 parent
1792640
commit 0ff791f
Showing
5 changed files
with
101 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# The dictionary should contain all the block types for which the chat should be | ||
# applicable If a block has sub-blocks or sub category, that should be added in the list | ||
CHAT_APPLICABLE_BLOCKS = ["problem", "video"] |
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,27 @@ | ||
.form-container { | ||
max-width: 400px; | ||
margin: 20px auto; | ||
padding: 20px; | ||
border: 1px solid #ccc; | ||
border-radius: 5px; | ||
background-color: #f9f9f9; | ||
} | ||
.form-container label { | ||
display: block; | ||
margin: 10px 0 5px; | ||
} | ||
.form-container input, | ||
.form-container select, | ||
.form-container button { | ||
width: 100%; | ||
padding: 8px; | ||
margin-bottom: 10px; | ||
border: 1px solid #ccc; | ||
border-radius: 4px; | ||
} | ||
.form-container .checkbox-container label { | ||
display: block; | ||
} | ||
.form-container .checkbox-container input { | ||
width: auto; | ||
} |
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 |
---|---|---|
@@ -1,25 +1,28 @@ | ||
<div> | ||
<body> | ||
|
||
<div class="textbox-container"> | ||
<label for="gpt_version">Add a GPT model</label> | ||
<input | ||
type="text" | ||
id="gpt_version" | ||
name="gpt_verson" | ||
placeholder="Enter GPT model version" | ||
pattern="[A-Za-z0-9]" | ||
title="Please add a GPT model name"> | ||
</div> | ||
<div class="form-container"> | ||
<form id="ol-chat-form"> | ||
<!-- Text Fields --> | ||
<label for="prompt_hint">Enter prompt hint:</label> | ||
<input type="text" id="prompt_hint" name="prompt_hint" placeholder="Enter prompt text" required> | ||
|
||
<div class="textbox-container"> | ||
<label for="add_prompt">Add GPT prompt</label> | ||
<input | ||
type="text" | ||
id="add_prompt" | ||
name="add_prompt" | ||
placeholder="Pleae add prompt context" | ||
pattern="[A-Za-z0-9]" | ||
title="Please add a GPT Prompt"> | ||
</div> | ||
<!-- Dropdown --> | ||
<label for="model">Select a Model:</label> | ||
<select id="model" name="model" required> | ||
<option value="">-- Select a GPT Model --</option> | ||
<option value="model1">GPT-4o</option> | ||
<option value="model2">gpt-4-turbo</option> | ||
<option value="model1">gpt-3.5-turbo</option> | ||
</select> | ||
|
||
</div> | ||
<!-- Checkbox --> | ||
<div class="checkbox-container"> | ||
<label><input type="checkbox" id="enabled" name="enabled"/>Enabled</label> | ||
</div> | ||
|
||
<!-- Save Button --> | ||
<button type="submit">Save</button> | ||
</form> | ||
</div> | ||
</body> | ||
</html> |
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,8 @@ | ||
"""Utility methods for the AI chat""" | ||
|
||
from ol_openedx_chat.constants import CHAT_APPLICABLE_BLOCKS | ||
|
||
|
||
def is_aside_applicable_to_block(block): | ||
"""Check if the xBlock should support AI Chat""" | ||
return getattr(block, "category", None) in CHAT_APPLICABLE_BLOCKS |