Skip to content
Michael.X edited this page Mar 8, 2023 · 2 revisions

Introduction

ChatGPT is an artificial intelligence chat service launched by OpenAI.
In order to satisfy everyone to experience the latest artificial intelligence, XX-Net has realized a one-stop solution:

  • No need to obtain a mobile phone number abroad
  • No need to find another tool to circumvent the wall
  • No foreign credit card is required to bind the account
  • You only need an XX-Net account to use ChatGPT

Play with ChatGPT:

Open XX-Net ChatGPT page, enter a question, and you can get the answer.
Please refer to Awesome ChatGPT Prompts for how to prompt

Call OpenAI API

The XX-Net client provides the function of accessing the ChatGPT API.
The method of use is very simple, just change the URL of openai to the local port 8085:

shell Example:

curl -v  http://localhost:8085/openai/v1/completions \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "text-davinci-003",
  "prompt": "Say this is a test",
  "max_tokens": 7,
  "temperature": 0
}'

Python Example:

import openai

openai.api_key = "abc"
openai.api_base = "http://localhost:8085/openai/v1"

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

Reference:

Clone this wiki locally