8000 GitHub - xiawei2/chatgpt-java: chatgpt java. Lightweight package for interacting with ChatGPT's API by OpenAI. Uses reverse engineered official API.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chatgpt java. Lightweight package for interacting with ChatGPT's API by OpenAI. Uses reverse engineered official API.

License

Notifications You must be signed in to change notification settings

xiawei2/chatgpt-java

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatGPT Java Api

stable Maven Central

English Doc.

OpenAI ChatGPT 的逆向工程SDK。可扩展用于聊天机器人等。觉得不错请右上角Star

感谢 revChatGPT.

功能

image

image

可以写代码,写小说,写作文、演讲稿、工作报告、读书笔记、合同等

使用

maven

<dependency>
    <groupId>com.github.plexpt</groupId>
    <artifactId>chatgpt</artifactId>
    <version>1.0.1</version>
</dependency>

gradle

implementation group: 'com.github.plexpt', name: 'chatgpt', version: '1.0.1'

然后

  Chatbot chatbot = new Chatbot("sessionToken");
  Map<String, Object> chatResponse = chatbot.getChatResponse("hello");
  System.out.println(chatResponse.get("message"));

sessionToken获取

https://github.com/acheong08/ChatGPT/wiki/Setup#token-authentication

  1. 通过 https://chat.openai.com/chat 注册并登录。
  2. 打开浏览器开发者工具,切换到 Application 标签页。
  3. 在左侧的 Storage - Cookies 中找到 __Secure-next-auth.session-token 一行并复制其值

注册教程

https://juejin.cn/post/7173447848292253704

https://mirror.xyz/boxchen.eth/9O9CSqyKDj4BKUIil7NC1Sa1LJM-3hsPqaeW_QjfFBc

也可以控制台直接使用

  1. 下载
  2. 编辑 config.json 里的sessionToken
  3. 运行 run.bat

Awesome ChatGPT

My list

If you have a cool project you want added to the list, open an issue.

Disclaimers

这不是官方的 OpenAI 产品。这是一个个人项目,与 OpenAI 没有任何关联。

This is a library and not intended for direct CLI use

CLI 功能仅用于演示和测试。不支持验证码(对于不干净的 IP 地址)

CLI use

@rawandahmad698 has a much better CLI tool at

PyChatGPT supports captcha!

Star History

Star History Chart

About

chatgpt java. Lightweight package for interacting with ChatGPT's API by OpenAI. Uses reverse engineered official API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%
0