This is a web app which allows teachers to submit prompts to OpenAI models.
It is a thin wrapper around OpenAI GPT-4o with pre-written prompts to assist teachers with common educational and administrative tasks. There is also experimental support for bulk marking of student work.
-
Create a general purpose v2 storage account in Microsoft Azure, and within it create a table called
chatlog
. -
Create an Azure app registration.
- Name -
Teacher AI
- Redirect URIs -
https://<app-website-domain>/signin-oidc
andhttps://<app-website-domain>/auth/authorise-service-account/done
- Implicit grant -
ID tokens
- Supported account types -
Accounts in this organizational directory only
- Allow public client flows -
Yes
- Client secrets - create a new secret and save the key
- API permissions -
Microsoft Graph - User.Read
andMicrosoft Graph - Files.ReadWrite.All
- Token configuration - add optional claim of type
ID
:upn
- Name -
-
Create an OpenAI account.
-
Create an Azure App Service web app, and configure the following settings:
Organisation__Name
- the name of your organisationOrganisation__AdminName
- the name of the user who will administrate the Teacher AI appOrganisation__AdminEmail
- the email address of the admin userOrganisation__ServiceAccountEmail
- the email address of the service account which will be used to access Excel spreadsheetsOrganisation__AppWebsite
- the URL where this app will be hostedOrganisation__Domain
- your organisation's domain nameOrganisation__UserCreditsPerWeek
- the number of AI credits to assign each user per weekAzure__ClientId
- the client ID of your Azure app registrationAzure__ClientSecret
- the client secret of your Azure app registrationAzure__TenantId
- your Azure tenant IDAzure__StorageAccountName
- the name of your Azure Storage accountAzure__StorageAccountKey
- the key for your Azure Storage accountOpenAI__Key
- the API key for your OpenAI accountOpenAI__Models__0__Type
- set tosmall
OpenAI__Models__0__Name
- the name of the small OpenAI model to use, e.g.gpt-4o-mini
OpenAI__Models__0__CostPerPromptToken
- the credit cost per prompt token for the small modelOpenAI__Models__0__CostPerCompletionToken
- the credit cost per completion token for the small modelOpenAI__Models__1__Type
- set todefault
OpenAI__Models__1__Name
- the name of the default OpenAI model to use, e.g.gpt-4o
OpenAI__Models__1__CostPerPromptToken
- the credit cost per prompt token for the default modelOpenAI__Models__1__CostPerCompletionToken
- the credit cost per completion token for the default model
-
Authorise a service account, which the app will use to access Excel spreadsheets when they are shared on OneDrive.
- Sign in as the admin user, and navigate to
/auth/authorise-service-account
- When prompted to sign in with a Microsoft account, select a purpose-made service account (not your admin account). Consent to the required permissions.
- You will be redirected to a page which displays the refresh token. Copy this and save it in the web app's
Azure__RefreshToken
setting.
- Sign in as the admin user, and navigate to