简单易用的 OpenAI Java SDK 1.5.0 发布

推荐一套基于 SpringBoot 开发的全平台数据 (数据库管理工具) 功能比较完善,建议下载使用: https://github.com/EdurtIO/datacap 目前已经支持 40+ 多种数据源。国内首个应用 ChatGPT 到数据管理系统中项目。

推荐一套基于 SpringBoot 开发的简单、易用的开源权限管理平台,建议下载使用: https://github.com/devlive-community/authx。

OpenAI Java SDK 主要 为 Java 开发人员提供方便易用的 SDK 来与 OpenAI 的 API 进行交互。

支持创建翻译

String file=this.getClass().getResource("/hello.mp3").getFile();
AudioEntity configure = AudioEntity.builder()
        .file(new File(file))
        .build();
client.audioTranscriptions(configure);
 

支持创建审核

ModerationEntity configure = ModerationEntity.builder()
        .inputs(Lists.newArrayList("Hello OpenAi Java SDK"))
        .build();
client.moderations(configure);
 

如何使用?

<properties>
    <openai.version>LATEST</openai.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.devlive.sdk</groupId>
        <artifactId>openai-java-sdk</artifactId>
        <version>${openai.version}</version>
    </dependency>
</dependencies>
 

LATEST 默认情况下将使用最新版本。

猜你喜欢

转载自www.oschina.net/news/249330/openai-java-sdk-1-5-0-released