GithubHelp home page GithubHelp logo

stalitsa / chatgpt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lilittlecat/chatgpt

0.0 0.0 0.0 240 KB

A Java client for the ChatGPT API. ChatGPT 的一个 Java 客户端。

License: MIT License

Java 100.00%

chatgpt's Introduction

ChatGPT Java

Maven Central

A Java client for the ChatGPT API.

Change Log

1.0.2 - 2023-04-24

  • Support message history

1.0.1

  • Support GPT-4
  • Add custom API host

1.0.0

  • Use official API with model gpt-3.5-turbo
  • Support proxy

0.1.0

  • Initial release
  • Use unofficial API

Download

Download the latest JAR or grab via Maven:

<dependency>
  <groupId>com.lilittlecat</groupId>
  <artifactId>chatgpt</artifactId>
  <version>1.0.2</version>
</dependency>

or Gradle:

implementation 'com.lilittlecat:chatgpt:1.0.2'

Usage

import com.lilittlecat.chatgpt.offical.ChatGPT;

public class Main {
   public static void main(String[] args) {
      ChatGPT chatGPT = new ChatGPT("YOUR API KEY");
      String hello = chatGPT.ask("hello");
      System.out.println(hello); // will be "\n\nHello! How may I assist you today?"
   }
}

More examples can be found in the test.

Happy coding

chatgpt's People

Contributors

lilittlecat avatar dxssucuk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.