Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
themeEmacs
titlesynapeditor.config.js
// URL과 API Key를 설정하는 경우
'aiWriteSupporter.config': {
    url: 'https://api.openai.com/v1/chat/completions',
    apiKey: 'sk-abc123...456xyz' // 브라우저에 노출되므로 안전하지 않음
}

// URL만 설정하는 경우
'aiWriteSupporter.config': {
    url: '/request'
}

Request Body 설정

API 요청 시 추가로 필요한 값들을 설정합니다. 설정할 수 있는 값들은 아래 링크에서 확인할 수 있습니다.


https://platform.openai.com/docs/api-reference/completions/create

Status
colourYellow
title릴리즈 2.8.0 이상

사용할 AI, OpenAI의 ChatGPT 또는 NAVER의 HyperCLOVA X를 URL, API Key 설정을 통해 지정할 수 있습니다.

OpenAI의 ChatGPT를 사용할 경우 아래와 같이 설정합니다.

Code Block
languagejs
themeEmacs
titlesynapeditor.config.js
// URL과 API Key를 설정하는 경우
'aiWriteSupporter.config': {
    ai: 'gpt',
    url: 'https://api.openai.com/v1/chat/completions',
    apiKey: 'sk-abc123...456xyz' // 브라우저에 노출되므로 안전하지 않음
}

// URL만 설정하는 경우
'aiWriteSupporter.config': {
	ai: 'gpt',
    url: '/request'
}


Naver의 HyperCLOVA X를 사용할 경우 아래와 같이 설정합니다.

Code Block
languagejs
themeEmacs
titlesynapeditor.config.js
// URL과 API Key를 설정하는 경우
'aiWriteSupporter.config': {
        ai: 'hcx',
        tokenUrl: 'https://api.hyperclova.ai/v1/tokens',
        url: 'https://api.hyperclova.ai/v1/chat-completions/HCX-001',
        clientID: '2029ae...97b72',
        clientSecret: '8gsetc...0bges3' // 브라우저에 노출되므로 안전하지 않음
}
 
// URL만 설정하는 경우
'aiWriteSupporter.config': {
        ai: 'hcx',
        url: '/request',
}

Request Body 설정

API 요청 시 추가로 필요한 값들을 설정합니다.

ChatGPT의 설정할 수 있는 값들은 아래 링크에서 확인할 수 있습니다.

HyperCLOVA X의 설정할 수 있는 값들은 아래와 같습니다.


  • 필드타입

    설명

    temperaturedouble생성 토큰에 대한 다양성 정도 (설정값이 높을수록 다양한 문장 생성 가능) - 0~1 (기본값: 0.5)
    topKint생성 토큰 후보군에서 확률이 높은 k 개를 후보로 지정하여 샘플링 - 0~128 (기본값: 0)
    topPdouble생성 토큰 후보군을 누적 확률을 기반으로 샘플링 - 0~1 (기본값: 0.8)
    repeatPenaltydouble같은 토큰을 생성하는 것에 대한 패널티 정도 (설정값이 높을수록 같은 결괏값을 반복 생성할 확률 감소) - 0~10 (기본값: 5)
    stopBeforestring토큰 생성 중단 문자 - [] (기본값)
    maxTokensint최대 생성 토큰 수 - 0~2048 (기본값: 2048)


Code Block
languagejs
themeEmacs
titlesynapeditor.config.js
// Request body 설정
'aiWriteSupporter.config': {
    url: 'url',
    apiKey: 'apiKey',
    requestBody: {
        temperature: 2,
        presence_penalty: 2, 
        ...
    }
}

...