diff --git a/source/img/manage_organization/addprompt.png b/source/img/manage_organization/addprompt.png new file mode 100644 index 00000000..72557446 Binary files /dev/null and b/source/img/manage_organization/addprompt.png differ diff --git a/source/img/manage_organization/promptmanagement.png b/source/img/manage_organization/promptmanagement.png new file mode 100644 index 00000000..4837540f Binary files /dev/null and b/source/img/manage_organization/promptmanagement.png differ diff --git a/source/instructors/admin/organization/organisation.rst b/source/instructors/admin/organization/organisation.rst index 67ee2872..c1d73884 100644 --- a/source/instructors/admin/organization/organisation.rst +++ b/source/instructors/admin/organization/organisation.rst @@ -29,6 +29,7 @@ Organization settings llms webhook course-action-data + prompt-management @@ -53,9 +54,11 @@ The person who creates the organization in Codio is the owner and is given the a - :ref:`Set Organization Contact URL ` - :ref:`Enable/Disable Release Grade Automatically ` - :ref:`Hide A/V calls ` -- :ref:`SSO Integration ` -- :ref:`LLMs ` - +- :ref:`Set up SSO Integration ` +- :ref:`Provide your own LLM keys ` +- :ref:`Create a webhook to receive Codio events ` +- :ref:`Download Course Activity Data ` +- :ref:`Manage Prompts for your Organization ` To access the **Organizations** page, follow these steps: @@ -71,15 +74,17 @@ Organization owners can add other owners to an organization and view all members The following Codio features are only accessible to Organization owners: - - **Overview** - Update organization profile, enable or disable the ability to create public objects, enable or disable Codio support access, obtain invitation token, manage education settings, and delete the organization. - - **Members** - View, add, and remove users in your organization and invite teachers to the organization. - - **Billing** - View your Codio plan information. - - **Rubrics** - Create and manage your grading templates. - - **Dashboard** - Specify the Student Dashboard default page (My Projects or Courses), and specify whether to hide/show Courses. - - **IP Consent** - Enable or disable IP Consent and manage the versions. - - **Custom Scripts** - Manage custom scripts used to integrate third-party systems to help and track students. - - **Extensions** - Add and enable custom extensions for the organization. - - **LTI Integrations** - Specify and manage LTI integration settings. - - **Integrations** - Specify API key for Sense.Network integration, and add other API integrations. - - **Assessment Libraries** - Create and manage assessment libraries for your organization. - - **LLMs** - Specify API keys for LLM models or add a custom LLM provider. \ No newline at end of file +- **Overview** - Update organization profile, manage the ability to create public objects, manage Codio support access, manage education settings, and delete the organization. +- **Members** - View, add, and remove users in your organization and invite teachers to the organization. +- **Billing** - View your Codio subscription information. +- **Rubrics** - Create and manage your grading templates. +- **Dashboard** - Specify Dashboard configurations for students, teachers and read-only teachers. +- **IP Consent** - Enable or disable IP Consent and manage the versions. +- **Custom Scripts** - Manage custom scripts used to integrate third-party systems to help and track students. +- **Extensions** - Add and enable custom extensions for the organization. +- **LTI Integrations** - View and manage LTI integration settings. +- **Integrations** - Specify API integrations, Webhooks and SSO Integration. +- **Assessment Libraries** - Create and manage assessment libraries for your organization. +- **LLMs** - Specify API keys for LLM models or add a custom LLM provider. +- **Course Action Data** - Download a report of all course management activities for the entire organization. +- **Prompt Management** - Manage prompts, used in custom extensions, for the entire organization. \ No newline at end of file diff --git a/source/instructors/admin/organization/prompt-management.rst b/source/instructors/admin/organization/prompt-management.rst new file mode 100644 index 00000000..a342e133 --- /dev/null +++ b/source/instructors/admin/organization/prompt-management.rst @@ -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": ""}}`` 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 + :alt: The prompt management dialog + +Example Prompts +~~~~~~~~~~~~~~~ + +**Prompt Example 1: Secure Folder File** + +.. code:: none + + Here is the question the student is working on: + + {{"type": "VARIABLE", "name": "GUIDE_CONTENT"}} + + + Here's the sample solution for the question: + + {{"type": "INSTRUCTOR_VIEW", "filepath": ".guides/secure/exercise-solutions/solution1.py"}} + + + 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: + + {{"type": "VARIABLE", "name": "GUIDE_CONTENT"}} + + + Here is the solution file: + + {{"type": "INSTRUCTOR_VIEW", "filepath": "code/exercise1.py"}} + + + Here's the starter code provided to the student: + + {{"type": "STARTER_CODE", "filepath": "code/exercise1.py"}} + + + Here's the student current code file: + + {{"type": "VARIABLE", "name": "STUDENT_FILE_CONTENT"}} + + + 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) + diff --git a/source/instructors/admin/organization/webhook.rst b/source/instructors/admin/organization/webhook.rst index 5e9fa635..ff69c178 100644 --- a/source/instructors/admin/organization/webhook.rst +++ b/source/instructors/admin/organization/webhook.rst @@ -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). -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