- In the
apifolder, create a file calledlocal.settings.json - Add the following to that file and make sure to populate with your OPENAI API key and Azure SignalR Service connection string.
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"OPENAI_API_KEY": "",
"AzureSignalRConnectionString": ""
},
"Host": {
"CORS": "*"
}
}- In the
apifolder usefunc host startcommand (or you can use debugger with F5) to run the API. - Make a get call to the URL of the
DurableFunctionsOrchestrationCSharp1_HttpStartfunction and provide thevideoUrlparameter with the url of the video you want to generate timestamps for.
- Make sure API is running.
- In Pages >
FetchData.razor.csmake surehubConnection = new HubConnectionBuilder().WithUrl("http://localhost:7071/api").Build();is set to the port your API is running on. - In the
clientfolder rundotnet run
The API is powered by Azure Durable Functions. It uses YouTube Explode to get the caption track of the requested YouTube video, slices the caption track into segments, and sends that segment to OpenAI API for a summary. The summary is then broadcasted to SignalR which the client app is connected to.
- At the moment, it will create 20 segments no matter the length of the video. This is set manually with the
slicesvariable in the API. I plan on making this user setable. - Local setup isn't ideal.
devcontainersupport in the works.azdsupport in the works.
- The
apifolder currently holds a Durable and non durable function. This is because this whole thing orignally started as a console app then I turned it into a HTTPTrigger Azure Function and then Durable Function which is ultimately the best model for this. I will clean this up. - Need to improve SignalR connection so API will only broadcast to client and not to all connected.
Feel free to open up an issue or reach out to me with.
- Gwyneth Pena-Siguenza: @madebygps
