반응형
블로그 이미지
개발자로서 현장에서 일하면서 새로 접하는 기술들이나 알게된 정보 등을 정리하기 위한 블로그입니다. 운 좋게 미국에서 큰 회사들의 프로젝트에서 컬설턴트로 일하고 있어서 새로운 기술들을 접할 기회가 많이 있습니다. 미국의 IT 프로젝트에서 사용되는 툴들에 대해 많은 분들과 정보를 공유하고 싶습니다.
솔웅

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함

카테고리

Get Started - Libraries

2023. 1. 4. 23:55 | Posted by 솔웅


반응형

We provide Python bindings, which you can install as follows:

다음과 같이 하면 Python bindig을 해서 인스톨 할 수 있습니다.

$ pip install openai

 

Once installed, you can use the bindings and your secret key to run the following:

인스톨이 완료되면 binding을 사용할 수 있습니다. 사용 하려면 자신의 secret key를 아래와 같이 설정해야 합니다.

import os
import openai

# Load your API key from an environment variable or secret management service
openai.api_key = os.getenv("OPENAI_API_KEY")

response = openai.Completion.create(model="text-davinci-003", prompt="Say this is a test", temperature=0, max_tokens=7)

The bindings also will install a command-line utility you can use as follows:

또한 이렇게 바인딩하면 코멘드라인 유틸리티도 같이 인스톨 되서 아래와 같이 사용할 수 있습니다.

$ openai api completions.create -m text-davinci-003 -p "Say this is a test" -t 0 -M 7 --stream

Node.js library

We also have a Node.js library, which you can install by running the following command in your Node.js project directory:

Node.js 라이브러리는 아래와 같이 설치 할 수 있습니다.

$ npm install openai

Once installed, you can use the library and your secret key to run the following:

설치 되면 다음과 같이 secret key를 사용해서 라이브러리를 사용할 수 있습니다.

const { Configuration, OpenAIApi } = require("openai");
const configuration = new Configuration({
  apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
const response = await openai.createCompletion({
  model: "text-davinci-003",
  prompt: "Say this is a test",
  temperature: 0,
  max_tokens: 7,
});

Community libraries

The libraries below are built and maintained by the broader developer community. If you'd like to add a new library here, please see this help article.

Please note that OpenAI does not verify the correctness or security of these projects.

 

아래 라이브러리는 광범위한 개발자 커뮤니티에서 구축하고 유지 관리합니다. 여기에 새 라이브러리를 추가하려면 이 도움말 문서를 참조하세요.

OpenAI는 이러한 프로젝트의 정확성이나 보안을 확인하지 않습니다.

C# / .NET

Crystal

Dart

Go

Java

Node.js

PHP

Python

R

Ruby

Unity

Unreal Engine

 

반응형

'Open AI > GET STARTED' 카테고리의 다른 글

Get Started - Data usage policies  (0) 2023.03.06
Get Started - Tutorials  (3) 2023.03.06
Get Started - Usage policies  (0) 2023.01.05
Get Started - Models (Added GPT-4 03/14/2023)  (1) 2023.01.05
Get Started - Quick Start Tutorial  (0) 2023.01.03
Get Started - Introduction  (0) 2023.01.03