aspire 대시보드에 copilot 기능이 들어가 있군요.
vscode나 visual studio가 아니어도 copilot을 사용할 수 있는 방법이 존재하는 걸로 보입니다. ![]()
개인적으로 운영 서비스에 코파일럿 붙이면 좋겠다고 생각하고 있었는데 어쩌면 가능할지도
aspire 대시보드에 copilot 기능이 들어가 있군요.
vscode나 visual studio가 아니어도 copilot을 사용할 수 있는 방법이 존재하는 걸로 보입니다. ![]()
개인적으로 운영 서비스에 코파일럿 붙이면 좋겠다고 생각하고 있었는데 어쩌면 가능할지도
아래는 깃허브 웹에서 코파일럿으로 저장소 코드 분석을 요청하여 작성한 문서입니다. aspire 대시보드의 코파일럿 기능은 비공개 api를 사용하고 디버거가 있어야 동작한다는군요.
.NET Aspire 대시보드는 GitHub Copilot을 두 가지 방식으로 통합하고 있습니다:
대시보드에 내장된 Copilot 채팅창은 **GHCP(GitHub Copilot Platform)**라는 비공개 엔드포인트를 사용합니다.
Aspire Dashboard
↓ (Debug Session Token 사용)
VS Code / Visual Studio (디버그 세션)
↓ (내부 GitHub Copilot 인증)
GHCP Endpoint (/v1, /ghcp_info)
↓
OpenAI GPT-4o / GPT-4o-mini
// src/Aspire.Dashboard/Model/Assistant/ChatClientFactory.cs
private void InitializeClientConfiguration(out Uri endpoint, out string credential, out HttpClient httpClient)
{
// VS Code/Visual Studio 디버그 세션에서 정보 가져오기
if (!DebugSessionHelpers.HasDebugSession(Options.DebugSession,
out var serverCert, out var debugSessionUri, out var token))
{
throw new InvalidOperationException("Debug session port is not set.");
}
credential = token; // 디버그 세션 토큰 사용
var uriBuilder = new UriBuilder(debugSessionUri);
uriBuilder.Path = "/v1"; // GHCP 엔드포인트
endpoint = uriBuilder.Uri;
httpClient = DebugSessionHelpers.CreateHttpClient(
debugSessionUri: null,
token: null,
cert: serverCert,
createHandler: null
);
}
public async Task<GhcpInfoResponse> GetInfoAsync(CancellationToken cancellationToken)
{
EnsureInitialized();
var ghcpInfoAddress = new Uri(_endpoint, "/ghcp_info");
using var httpRequest = new HttpRequestMessage(HttpMethod.Get, ghcpInfoAddress);
httpRequest.Headers.Add("Authorization", "Bearer " + _credential);
using var httpResponse = await _httpClient.SendAsync(httpRequest, cancellationToken);
httpResponse.EnsureSuccessStatusCode();
var response = await httpResponse.Content.ReadFromJsonAsync<GhcpInfoResponse>(cancellationToken);
// response.Models에 사용 가능한 모델 목록 포함 (gpt-4o, gpt-4o-mini 등)
return response;
}
public IChatClient CreateClient(string model)
{
EnsureInitialized();
// OpenAI SDK를 사용하지만 GHCP 엔드포인트로 요청
var innerChatClient = new OpenAI.Chat.ChatClient(
model.ToLower(CultureInfo.InvariantCulture),
new ApiKeyCredential(_credential),
new()
{
Endpoint = _endpoint, // GHCP 엔드포인트 (예: https://localhost:xxxxx/v1)
Transport = new HttpClientPipelineTransport(_httpClient)
}
).AsIChatClient();
return new ChatClientBuilder(innerChatClient)
.UseFunctionInvocation(_loggerFactory, options => options.AllowConcurrentInvocation = true)
.UseLogging(_loggerFactory)
.Build();
}
public bool IsEnabled()
{
// 디버그 세션이 없으면 비활성화
if (!DebugSessionHelpers.HasDebugSession(_dashboardOptions.CurrentValue.DebugSession,
out _, out _, out _))
{
_logger.LogInformation("AI is disabled because there isn't a debug session.");
return false;
}
return true;
}