-
Notifications
You must be signed in to change notification settings - Fork 1
Prompt management and redid the webhooks page #445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+147
−24
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
156fa74
Prompt management and redid the webhooks page
shajason e10e2a3
A few of CR's complaints - more editing once it has a validity review
shajason 4edb191
Incorporated Mohit's feedback
shajason 49b6a0c
more CR edits
shajason d4d8ec7
incorporated feedback
shajason File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
113 changes: 113 additions & 0 deletions
113
source/instructors/admin/organization/prompt-management.rst
This file contains hidden or 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,113 @@ | ||
| .. meta:: | ||
| :description: Prompt management for an organization. | ||
|
|
||
| .. _prompt-management: | ||
|
|
||
|
|
||
| Prompt Management | ||
| ================= | ||
|
|
||
| This feature allows instructors to store prompts at an organization level. These prompts have unique **Prompt IDs** that can be used in custom assistants. | ||
|
|
||
| 1. Click your username in the top-right corner, then select **Organization** from the menu. | ||
|
|
||
| 2. In the **Organizations** tab, click the name of your organization. | ||
|
|
||
| 3. Click the **Prompt Management** tab and then click **Add Prompt**. | ||
|
|
||
| .. image:: /img/manage_organization/addprompt.png | ||
| :alt: Add a prompt | ||
|
|
||
| Creating the Prompt | ||
| ~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| Enter your prompt text and specify the data you want to include as context. | ||
|
|
||
| - Each Prompt must have a unique **Prompt ID**. Prompt IDs can only contain uppercase letters, numbers, and underscores. | ||
| - In the **Text Area**, enter your prompt text (user prompt or system prompt). | ||
| - Use the buttons to create templates to specify the data you want to add to your prompt as context: | ||
| - **Add Variable**: Pass dynamic variables as context to your prompt (e.g., open guide page, open file, error message, etc.). | ||
| - **Add Instructor View**: Pass a file from the ``.guides`` folder (hidden from students) or a file from the student workspace with solution file templating. For example, ``{{"type": "INSTRUCTOR_VIEW", "filepath": "<path/to/file>"}}`` will pull the contents of the specified file. | ||
| - **Add Starter Code**: Pass a file from the student workspace provided by the instructor with no student edits (starter code/boilerplate). | ||
| - You can use this feature to access solutions in the ``.guides/secure`` folder. See the example below. | ||
| - Click **Create** once you have entered all the information. | ||
|
|
||
| .. note:: | ||
| Files are retrieved dynamically on the server when the assistant is used. If a referenced file is deleted or doesn’t exist after the prompt is created, an empty string is sent as context. | ||
|
|
||
| .. image:: /img/manage_organization/promptmanagement.png | ||
shajason marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| :alt: The prompt management dialog | ||
|
|
||
| Example Prompts | ||
| ~~~~~~~~~~~~~~~ | ||
|
|
||
| **Prompt Example 1: Secure Folder File** | ||
|
|
||
| .. code:: none | ||
| Here is the question the student is working on: | ||
| <assignment> | ||
| {{"type": "VARIABLE", "name": "GUIDE_CONTENT"}} | ||
| </assignment> | ||
| Here's the sample solution for the question: | ||
| <solution> | ||
| {{"type": "INSTRUCTOR_VIEW", "filepath": ".guides/secure/exercise-solutions/solution1.py"}} | ||
| </solution> | ||
| Answer any questions the student has about this assignment without providing the solution directly. | ||
| Respond only with suggestions to help them make progress by themselves. | ||
| **Prompt Example 2: Starter Code and Solution File** | ||
|
|
||
| .. code:: none | ||
| Here is the question the student is working on: | ||
| <assignment> | ||
| {{"type": "VARIABLE", "name": "GUIDE_CONTENT"}} | ||
| </assignment> | ||
| Here is the solution file: | ||
| <solution> | ||
| {{"type": "INSTRUCTOR_VIEW", "filepath": "code/exercise1.py"}} | ||
| </solution> | ||
| Here's the starter code provided to the student: | ||
| <starter_code> | ||
| {{"type": "STARTER_CODE", "filepath": "code/exercise1.py"}} | ||
| </starter_code> | ||
| Here's the student current code file: | ||
| <student_code> | ||
| {{"type": "VARIABLE", "name": "STUDENT_FILE_CONTENT"}} | ||
| </student_code> | ||
| Provide 1-2 hints as suggestions to help them make progress. Do not give away the solution. Do not include code snippets in your hints. | ||
| Using the Prompt in a Custom Extension | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| .. code:: javascript | ||
| (async function(codioIDE, window) { | ||
| const systemPrompt = "System Prompt for the LLM goes here" | ||
| codioIDE.coachBot.register("iNeedHelpButton", "I have a question", onButtonPress) | ||
| async function onButtonPress() { | ||
| const context = await codioIDE.coachBot.getContext() | ||
| const userPrompt = "{% prompt 'TEST_PROMPT_1' %}" | ||
| const result = await codioIDE.coachBot.ask({ | ||
| systemPrompt: systemPrompt, | ||
| userPrompt: userPrompt, | ||
| vars: { | ||
| "GUIDE_CONTENT": context.guidesPage.content, | ||
| } | ||
| }) | ||
| } | ||
| })(window.codioIDE, window) | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or 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,30 @@ | ||
| .. meta:: | ||
| :description: Allow webhoooks to support passing of student data to extenal servers | ||
| :description: Allow webhooks to support passing of student data to external servers | ||
|
|
||
| .. _webhooks: | ||
|
|
||
| Webhooks | ||
| ======== | ||
| Webbhooks allow receiving Codio events by calling your endpoint. | ||
|
|
||
| The system won’t retry webhook calls for any missed events you can query the API event object using loadEvents function. | ||
| Webhooks provide a way to receive Codio events at an endpoint you specify. | ||
|
|
||
| You can add your own Webhooks to your Codio organization from the **Organization > Integrations** page in Codio. | ||
| The system does not retry webhook calls for missed events. You can query the API event object using the ``loadEvents`` function. | ||
|
|
||
| Go to the **Webhooks** area and **Add Webhook** | ||
| You can add Webhooks for your Codio organization from the **Organization > Integrations** page. | ||
|
|
||
| To add a webhook enter the URL of your server and press create, the system will send a test request to check endpoint validity. | ||
| 1. Click your username in the top-right corner, then select **Organization** from the menu. | ||
|
|
||
| .. image:: /img/createwebhook.png | ||
| 2. In the **Organizations** tab, click the name of your organization. | ||
|
|
||
| .. image:: /img/class_administration/createanorganization/organizations.png | ||
| :alt: My Organizations | ||
|
|
||
| All requests contain a JWT signature you can verify using codio keys https://apollo.codio.com/lti/oidc/certs (or https://apollo.codio.co.uk/lti/oidc/certs if working on codio.co.uk) | ||
| 3. Click the **Integrations** tab and go to the **Webhooks** area and click **Add Webhook**. | ||
|
|
||
| 4. Enter the URL of your server and click **Create**. The system will send a test request to validate endpoint connectivity. | ||
|
|
||
|
|
||
| All requests contain a JWT signature you can verify using Codio keys https://apollo.codio.com/lti/oidc/certs (or https://apollo.codio.co.uk/lti/oidc/certs if you are working on codio.co.uk). | ||
shajason marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Example app to receive webhooks into a Codio project can be found here: https://github.com/iyashtykov/webhook-server | ||
| View an example here: https://github.com/iyashtykov/webhook-server | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.