클라이언트 정보를 설정하는 경우
SDK 애플리케이션이 런타임 활동을 일관되게 특성화해야 하는 고유한 제품, 서비스 또는 통합을 나타내는 경우 클라이언트 정보를 설정합니다.
고유한 애플리케이션을 나타내지 않는 스크립트, 일회성 도구 및 작업에 대해 클라이언트 정보를 설정하지 않은 상태로 둡니다. 그런 다음 런타임은 기본 특성을 유지합니다.
클라이언트 정보에는 4개의 선택적 문자열 필드가 있습니다. 알고 있는 필드를 설정하고 나머지는 생략합니다. SDK는 하나 이상의 필드에 비어 있지 않은 값이 있는 경우에만 server.connect 핸드셰이크에 클라이언트 정보를 포함합니다.
| Field | Example | Meaning |
|---|---|---|
applicationName | "vscode" | SDK를 사용하는 애플리케이션의 이름 |
application | "1.124.2" | SDK를 사용하는 애플리케이션 버전 |
integrationName | "copilot-chat" | SDK를 사용하는 확장, 플러그 인 또는 기타 애플리케이션 하위 파트의 이름 |
integration | "0.54.0" | 해당 확장, 플러그 인 또는 애플리케이션 하위 부분의 버전 |
고유한 통합이 없는 독립 실행형 애플리케이션의 경우 애플리케이션 필드만 설정합니다. 예를 들어 개발자 포털은 applicationName을(를) applicationVersion로, "2.4.0"을(를) "acme-developer-portal"로 설정하고, 두 통합 필드는 모두 설정하지 않은 상태로 둘 수 있습니다.
SDK는 연결을 설정할 때 클라이언트 정보를 한 번 보냅니다. ID는 해당 연결의 수명 동안 적용됩니다.
클라이언트 정보 구성
클라이언트를 만들 때 클라이언트 정보를 전달합니다.
import { CopilotClient } from "@github/copilot-sdk";
const client = new CopilotClient({
clientInfo: {
applicationName: "vscode",
applicationVersion: "1.124.2",
integrationName: "copilot-chat",
integrationVersion: "0.54.0",
},
});
await client.start();
from copilot import CopilotClient
client = CopilotClient(
client_info={
"application_name": "vscode",
"application_version": "1.124.2",
"integration_name": "copilot-chat",
"integration_version": "0.54.0",
},
)
await client.start()
client := copilot.NewClient(&copilot.ClientOptions{
ClientInfo: &copilot.ClientInfo{
ApplicationName: "vscode",
ApplicationVersion: "1.124.2",
IntegrationName: "copilot-chat",
IntegrationVersion: "0.54.0",
},
})
if err := client.Start(ctx); err != nil {
return err
}
using GitHub.Copilot;
await using var client = new CopilotClient(new CopilotClientOptions
{
ClientInfo = new CopilotClientInfo
{
ApplicationName = "vscode",
ApplicationVersion = "1.124.2",
IntegrationName = "copilot-chat",
IntegrationVersion = "0.54.0",
},
});
await client.StartAsync();
var options = new CopilotClientOptions()
.setClientInfo(new ClientInfo()
.setApplicationName("vscode")
.setApplicationVersion("1.124.2")
.setIntegrationName("copilot-chat")
.setIntegrationVersion("0.54.0"));
var client = new CopilotClient(options);
client.start().get();
use github_copilot_sdk::{Client, ClientInfo, ClientOptions};
let client = Client::start(
ClientOptions::new().with_client_info(
ClientInfo::new()
.with_application_name("vscode")
.with_application_version("1.124.2")
.with_integration_name("copilot-chat")
.with_integration_version("0.54.0"),
),
)
.await?;
Notes
- 클라이언트 정보는 권고입니다. 런타임은 잘못된 버전 문자열과 같이 예상 형식과 일치하지 않는 값을 무시할 수 있습니다.
- 클라이언트 정보를 설정하면 런타임이 텔레메트리의 귀속 대상을 정하는 방식이 변경됩니다. 런타임이 기록하는 내용은 변경되지 않습니다.
- 모든 필드가 설정되지 않거나 비어 있으면 SDK는 핸드셰이크에서 클라이언트 정보를 생략하고 런타임은 기본 특성을 유지합니다.