Skip to content

Commit

Permalink
JS Interop (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinyoo authored Sep 28, 2023
1 parent 4173657 commit fbbe99b
Show file tree
Hide file tree
Showing 33 changed files with 3,377 additions and 99 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 'Simple Build'

on:
workflow_dispatch:
push:
branches:
- main
- 'feature/*'
pull_request:
branches:
- main

jobs:
build-test:
name: Build Test

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.x

- name: Restore NuGet packages
shell: bash
run: |
dotnet restore
- name: Build solution
shell: bash
run: |
dotnet build -c Release
- name: Test solution
shell: bash
run: |
dotnet test -c Release
14 changes: 13 additions & 1 deletion YouTubeSummariser.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YouTubeSummariser.WebApp.Wasm", "src\YouTubeSummariser.WebApp.Wasm\YouTubeSummariser.WebApp.Wasm.csproj", "{BA0E2490-C014-4325-85C3-5132FEBE1844}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F0754B28-F0B2-414C-83DB-06854DBF508E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YouTubeSummariser.WebApp.Wasm", "src\YouTubeSummariser.WebApp.Wasm\YouTubeSummariser.WebApp.Wasm.csproj", "{BA0E2490-C014-4325-85C3-5132FEBE1844}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YouTubeSummariser.ApiApp", "src\YouTubeSummariser.ApiApp\YouTubeSummariser.ApiApp.csproj", "{D2B6ACCD-125F-4AB8-B072-0F3C104AEBB2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -15,10 +19,18 @@ Global
{BA0E2490-C014-4325-85C3-5132FEBE1844}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BA0E2490-C014-4325-85C3-5132FEBE1844}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BA0E2490-C014-4325-85C3-5132FEBE1844}.Release|Any CPU.Build.0 = Release|Any CPU
{D2B6ACCD-125F-4AB8-B072-0F3C104AEBB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D2B6ACCD-125F-4AB8-B072-0F3C104AEBB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D2B6ACCD-125F-4AB8-B072-0F3C104AEBB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D2B6ACCD-125F-4AB8-B072-0F3C104AEBB2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{BA0E2490-C014-4325-85C3-5132FEBE1844} = {F0754B28-F0B2-414C-83DB-06854DBF508E}
{D2B6ACCD-125F-4AB8-B072-0F3C104AEBB2} = {F0754B28-F0B2-414C-83DB-06854DBF508E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3E8AEBE9-75D2-45E8-8795-38BB5E81FEFD}
EndGlobalSection
Expand Down
264 changes: 264 additions & 0 deletions src/YouTubeSummariser.ApiApp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# Azure Functions localsettings file
local.settings.json

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/

# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

# DNX
project.lock.json
project.fragment.lock.json
artifacts/

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb

# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding add-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
#*.pubxml
*.publishproj

# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets

# Microsoft Azure Build Output
csx/
*.build.csdef

# Microsoft Azure Emulator
ecf/
rcf/

# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/

# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs

# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

# GhostDoc plugin setting file
*.GhostDoc.xml

# Node.js Tools for Visual Studio
.ntvs_analysis.dat

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions

# Paket dependency manager
.paket/paket.exe
paket-files/

# FAKE - F# Make
.fake/

# JetBrains Rider
.idea/
*.sln.iml

# CodeRush
.cr/

# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace YouTubeSummariser.WebApp.Wasm.Configurations;
namespace YouTubeSummariser.ApiApp.Configurations;

/// <summary>
/// This represents the settings entity for the OpenAI API.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace YouTubeSummariser.WebApp.Wasm.Configurations;
namespace YouTubeSummariser.ApiApp.Configurations;

/// <summary>
/// This represents the settings entity for the prompt.
Expand All @@ -13,15 +13,15 @@ public class PromptSettings
/// <summary>
/// Gets or sets the system prompt.
/// </summary>
public virtual string? System { get; set; } = "You are the expert of summarising long contents. You are going to summarise the following YouTube video transcript in 5 bullet point items.";
public virtual string? System { get; set; }

/// <summary>
/// Gets or sets the maximum number of tokens to use for completion.
/// </summary>
public virtual int? MaxTokens { get; set; } = 3000;
public virtual int? MaxTokens { get; set; }

/// <summary>
/// Gets or sets the temperature of the completion.
/// </summary>
public virtual float? Temperature { get; set; } = 0.7f;
public virtual float? Temperature { get; set; }
}
22 changes: 22 additions & 0 deletions src/YouTubeSummariser.ApiApp/Models/SummariseRequestModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace YouTubeSummariser.ApiApp.Models;

/// <summary>
/// This represents the request model entity containing YouTube video details.
/// </summary>
public class SummariseRequestModel
{
/// <summary>
/// Gets or sets the YouTube video URL.
/// </summary>
public string? VideoUrl { get; set; }

/// <summary>
/// Gets or sets the video language code.
/// </summary>
public string? VideoLanguageCode { get; set; }

/// <summary>
/// Gets or sets the summary language code.
/// </summary>
public string? SummaryLanguageCode { get; set; }
}
Loading

0 comments on commit fbbe99b

Please sign in to comment.