Skip to content

Commit

Permalink
Remove copilot context(just comment) (Azure-Samples#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
level120 authored Feb 22, 2024
1 parent 0d7da22 commit 880616b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 74 deletions.
62 changes: 13 additions & 49 deletions docs/01-blazor-frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
## 01-2: UI Component 생성하기

> 세이브 포인트에서 가져온 프로젝트를 사용하려면 아래 명령어를 차례로 실행시켜 프로젝트를 복원합니다.
>
>
> ```bash
> cd $CODESPACE_VSCODE_FOLDER
> mkdir -p workshop && cp -a save-points/session-00/. workshop/
Expand All @@ -51,36 +51,20 @@

```razor
<h3>YouTubeSummariserComponent</h3>
@code {
}
```

1. 위 내용을 모두 지운 후 아래 코드를 입력합니다.
<!-- 1. 위 내용을 모두 지운 후 `CTRL`+`I` 키 또는 `CMD`+`I` 키를 눌러 GitHub Copilot Chat 창을 활성화 시킵니다. -->
<!-- 1. 아래 프롬프트를 GitHub Copilot Chat에 입력합니다.

```text
It's a razor component of a Blazor app. Add the following input controls with Bootstrap style:
- 1 text input for YouTube link URL
- 1 drop down list for the video language code selection of English and Korean
- 1 drop down list for the summary language code selection of English and Korean
- 2 buttons for summary and clear
- 1 textarea for summary result
Also add the corresponding code block.
```
그러면 아래와 비슷한 코드가 생성되었을 것입니다. 아래 코드를 참고해서 `YouTubeSummariserComponent.razor` 파일을 수정합니다. -->

```razor
<div class="container">
<div class="row">
<h2>YouTube Summariser</h2>
</div>
<div class="row">
<div class="col">
<div class="mb-3">
Expand All @@ -107,33 +91,33 @@
</div>
</div>
</div>
<div class="row">
<div class="mb-3">
<button type="button" class="btn btn-primary" @onclick="SummariseAsync">Summarise!</button>
<button type="button" class="btn btn-secondary" @onclick="ClearAsync">Clear!</button>
</div>
</div>
<div class="row">
<div class="mb-3">
<label for="summary" class="form-label"><strong>Summary</strong></label>
<textarea class="form-control" id="summary" rows="10" placeholder="Result will show here" readonly>@summaryResult</textarea>
</div>
</div>
</div>
@code {
private string youTubeLinkUrl = string.Empty;
private string videoLanguageCode = "en";
private string summaryLanguageCode = "en";
private string summaryResult = string.Empty;
private async Task SummariseAsync()
{
throw new NotImplementedException();
}
private async Task ClearAsync()
{
throw new NotImplementedException();
Expand All @@ -149,13 +133,6 @@
```

1. `YouTubeSummariserComponent.razor` 파일의 `SummariseAsync` 메서드 안에 아래 코드를 입력합니다.
<!-- 1. `YouTubeSummariserComponent.razor` 파일의 `SummariseAsync` 메서드 안에서 다시 GitHub Copilot Chat을 이용해 코드를 입력합니다.
```text
call ApiApp.SummariseAsync method with proper exception handling logic.
```
그러면 아래와 비슷한 코드가 생성되었을 것입니다. 아래 코드를 참고해서 `SummariseAsync` 메서드를 수정합니다. -->

```razor
private async Task SummariseAsync()
Expand Down Expand Up @@ -192,21 +169,14 @@

```csharp
namespace AspireYouTubeSummariser.WebApp.Clients;
public class ApiAppClient
{
}
```

1. `namespace``class` 사이에 아래와 같이 `IApiAppClient` 인터페이스를 추가합니다.
<!-- 1. `namespace`와 `class` 사이에서 GitHub Copilot Chat을 이용해 아래와 같이 프롬프트를 입력합니다.
```text
create an interface of IApiAppClient that has a SummariseAsync method with parameters of YouTube link, video language code and summary language code
```
그러면 아래와 비슷한 코드가 생성되었을 것입니다. 아래 코드를 참고해서 `ApiAppClient` 파일을 수정합니다. -->

```csharp
public interface IApiAppClient
Expand All @@ -216,13 +186,6 @@
```

1. 아래와 같이 `ApiAppClient` 클래스를 수정합니다.
<!-- 1. GitHub Copilot Chat을 이용해서 클래스를 수정합니다.
```text
create a class implementing IApiAppClient
```
그러면 아래와 비슷한 코드가 생성되었을 것입니다. 아래 코드를 참고해서 `ApiAppClient` 파일을 수정합니다. -->

```csharp
public class ApiAppClient : IApiAppClient
Expand Down Expand Up @@ -251,7 +214,7 @@
public class ApiAppClient(HttpClient http) : IApiAppClient
{
private readonly HttpClient _http = http ?? throw new ArgumentNullException(nameof(http));
public async Task<string> SummariseAsync(string youTubeLinkUrl, string videoLanguageCode, string summaryLanguageCode)
```
Expand All @@ -272,6 +235,7 @@
## 01-5: UI Component 페이지에 추가하기
1. Solution Explorer에서 `Components/Pages` 디렉토리 밑에 `Home.razor` 파일을 엽니다.
1. 페이지의 맨 아래에 아래와 같이 `YouTubeSummariserComponent`를 추가합니다.
```razor
Expand Down
25 changes: 0 additions & 25 deletions docs/02-aspnet-core-backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,6 @@
> 만약 네임스페이스 참조를 할 수 없다는 오류가 발생한다면 오류가 발생한 곳에 커서를 두고 `CTRL`+`.` 키 또는 `CMD`+`.` 키를 눌러 네임스페이스를 추가합니다.
1. `SummariseAsync` 메서드를 아래와 같이 수정합니다.
<!-- 1. `SummariseAsync` 메서드 안에서 YouTube 자막을 다운로드 받는 로직을 구현합니다. GitHub Copilot을 이용해 아래와 같이 수정합니다.
```text
Download the YouTube video transcript with the following conditions:
- It should use IYouTubeVideo instance to download the YouTube video transcript.
- It should aggregate the YouTube video transcript into a single string.
```
그러면 아래와 비슷한 코드가 생성되었을 것입니다. 아래 코드를 참고해서 `SummariseAsync` 메서드를 수정합니다. -->
```csharp
public async Task<string> SummariseAsync(SummaryRequest req)
Expand All @@ -198,21 +188,6 @@
> 만약 네임스페이스 참조를 할 수 없다는 오류가 발생한다면 오류가 발생한 곳에 커서를 두고 `CTRL`+`.` 키 또는 `CMD`+`.` 키를 눌러 네임스페이스를 추가합니다.
1. 계속해서 `SummariseAsync` 메서드 안에서 자막 내용을 요약하는 로직을 아래와 같이 구현합니다.
<!-- 1. 계속해서 `SummariseAsync` 메서드 안에서 자막 내용을 요약하는 로직을 구현합니다. GitHub Copilot을 이용해 아래와 같이 수정합니다.
```text
Create a ChatCompletionsOptions instance with the following conditions:
- It should have the "DeploymentName" property set to the value of "OpenAI:DeploymentName" in the configuration.
- It should have the "MaxTokens" property set to the value of "Prompt:MaxTokens" in the configuration.
- It should have the "Temperature" property set to the value of "Prompt:Temperature" in the configuration.
- It should have the "Messages" property set to the following messages:
- A message of "ChatRole.System" with the value of "Prompt:System" in the configuration.
- A message of "ChatRole.System" with the value of "Here's the transcript. Summarise it in 5 bullet point items in the given language code of \"{req.SummaryLanguageCode}\".".
- A message of "ChatRole.User" with the value of "caption".
```
그러면 아래와 비슷한 코드가 생성되었을 것입니다. 아래 코드를 참고해서 `SummariseAsync` 메서드를 수정합니다. -->
```csharp
public async Task<string> SummariseAsync(SummaryRequest req)
Expand Down

0 comments on commit 880616b

Please sign in to comment.