This provides sample Blazor apps that summarise a YouTube video transcript to a given language.
- .NET 7 SDK
- Visual Studio or Visual Studio Code with C# Dev Kit
- Azure Subscription
- Azure OpenAI Service
- If your YouTube video is long enough, you might exceed the maximum number of tokens that Azure OpenAI Service can handle. For more information, see Model summary.
gpt-35-turbo
: 4Kgpt-35-turbo-16k
: 16Kgpt-4
: 4Kgpt-4-32K
: 32K
-
Fork this repository to your GitHub account,
{{GITHUB_USERNAME}}
. -
Run the commands below to set up a resource names:
# PowerShell $AZURE_ENV_NAME="summariser$(Get-Random -Min 1000 -Max 9999)" $GITHUB_USERNAME="{{GITHUB_USERNAME}}" $GITHUB_REPOSITORY_NAME="{{GITHUB_REPOSITORY_NAME}}" # Bash AZURE_ENV_NAME="summariser$RANDOM" GITHUB_USERNAME="{{GITHUB_USERNAME}}" GITHUB_REPOSITORY_NAME="{{GITHUB_REPOSITORY_NAME}}"
-
Run the commands below to provision Azure resources:
azd auth login azd init -e $AZURE_ENV_NAME azd up
Note: You may be asked to enter your GitHub username/orgname and repository name where your forked repository is located.
-
Get the endpoint, API key and deployment ID.
# PowerShell $AOAI_ENDPOINT_URL = $(az cognitiveservices account show ` -g rg-$AZURE_ENV_NAME ` -n aoai-$AZURE_ENV_NAME ` --query "properties.endpoint" -o tsv) $AOAI_API_KEY = $(az cognitiveservices account keys list ` -g rg-$AZURE_ENV_NAME ` -n aoai-$AZURE_ENV_NAME ` --query "key1" -o tsv) $AOAI_DEPLOYMENT_ID = $(az cognitiveservices account deployment list ` -g rg-$AZURE_ENV_NAME ` -n aoai-$AZURE_ENV_NAME ` --query "[0].name" -o tsv) # Bash AOAI_ENDPOINT_URL=$(az cognitiveservices account show \ -g rg-$AZURE_ENV_NAME \ -n aoai-$AZURE_ENV_NAME \ --query "properties.endpoint" -o tsv) AOAI_API_KEY=$(az cognitiveservices account keys list \ -g rg-$AZURE_ENV_NAME \ -n aoai-$AZURE_ENV_NAME \ --query "key1" -o tsv) AOAI_DEPLOYMENT_ID=$(az cognitiveservices account deployment list \ -g rg-$AZURE_ENV_NAME \ -n aoai-$AZURE_ENV_NAME \ --query "[0].name" -o tsv)
-
Run the commands below to deploy apps to Azure:
az login gh auth login azd pipeline config gh workflow run "Azure Dev" --repo $GITHUB_USERNAME/$GITHUB_REPOSITORY_NAME
-
To avoid unexpected billing shock, run the commands below to deprovision Azure resources:
azd down --force --purge --no-prompt
TBD
TBD
-
Copy
local.settings.sample.json
tolocal.settings.json
-
Update
local.settings.json
file for backend API."OpenAI__Endpoint": "{{AOAI_ENDPOINT_URL}}", "OpenAI__ApiKey": "{{AOAI_API_KEY}}", "OpenAI__DeploymentId": "{{AOAI_DEPLOYMENT_ID}}",
-
Build the entire solution.
dotnet restore && dotnet build
-
Open a new terminal and run the backend API app.
pushd src/YouTubeSummariser.ApiApp func start popd
-
Open a new terminal and run the Blazor WebAssembly app.
pushd /src/YouTubeSummariser.WebApp.Wasm dotnet watch run popd