- Python library(Python库)
- Node.js library(Node.js库)
-
Community libraries 社区图书馆
- C# / .NET
- Crystal
- Go
- Java
- Kotlin
- Node.js
- PHP
- Python
- R
- Ruby
- Scala
- Swift
- Unity
- Unreal Engine
- 其它资料下载
Python library(Python库)
我们提供了一个Python库,您可以按如下方式安装:
$ pip install openai
Once installed, you can use the bindings and your secret key to run the following:
安装后,您可以使用绑定和您的密钥运行以下命令:
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(Node.js库)
We also have a Node.js library, which you can install by running the following command in your Node.js project directory:
我们还有一个Node.js库,您可以通过在Node.js项目目录中运行以下命令来安装它:
$ npm install openai
Once installed, you can use the library and your secret key to run the following:
安装后,您可以使用库和密钥运行以下命令:
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 follow the instructions in our help center article on adding community libraries.
下面的库是由更广泛的开发人员社区构建和维护的。如果您想在此添加新库,请按照帮助中心文章中有关添加社区库的说明进行操作。
请注意,OpenAI不会验证这些项目的正确性或安全性。
C# / .NET
Crystal
openai-crystal by sferik
Go
Java
openai-java by Theo Kanning
Kotlin
Node.js
openai-api by Njerschow
openai-api-node by erlapso
gpt-x by ceifa
gpt3 by poteat
gpts by thencc
@dalenguyen/openai by dalenguyen
tectalic/openai by tectalic
PHP
tectalic/openai by tectalic
Python
R
rgpt3 by ben-aaron188
Ruby
ruby-openai by alexrudall
Scala
Swift
OpenAIKit by dylanshine
Unity
Unreal Engine
OpenAI-Api-Unreal by KellanM
其它资料下载
这篇博客参考了Github知名开源平台,AI技术平台以及相关领域专家:Datawhale,ApacheCN,AI有道和黄海广博士等约有近100G相关资料,希望能帮助到所有小伙伴们。