Table of Contents
Registration
Function Experience
1. Front-end component
2. Optimization Weekly report
Node.js API interface
openai
chatgpt
WeChat Chat Assistant
WeChat GPT
WeChat Bot
Browser plug-in
ChatGPT for Google
ChatGPT Chrome Extension
Grease Monkey Script
Reverse Engineering
Mac software
Finally
Home Technology peripherals AI ChatGPT and related open source project experience

ChatGPT and related open source project experience

Apr 13, 2023 am 08:22 AM
project chatgpt Open source

At the beginning of this month, ChatGPT came out at an alarming rate, causing widespread discussion in the technology circle. Recently, a number of ChatGPT-related open source projects have been born on GitHub. The number is staggering. ChatGPT even dominates most of GitHub Trending. So, what kind of charm does it have that makes many developers so excited? Let’s explore it together.

Registration

Currently, ChatGPT cannot be registered directly in China. Access needs to be through an agent, and you need to use a mobile phone number in other countries to register. For the specific registration method, you can read this article [1 ]

Function Experience

ChatGPT can realize tasks such as intelligent chatting, poetry, writing, programming, bug correction, writing weekly reports, Zhihu Q&A, etc.

For example, I can use it to write

1. Front-end component

Use React hooks to write an echarts component

ChatGPT and related open source project experience

The above code implements basic components, but no sample code is given. We can continue to ask

give an example of options for a line chart

ChatGPT and related open source project experience

2. Optimization Weekly report

Optimize last week’s weekly report to make it richer

ChatGPT and related open source project experience

In the weekly report, not only did they help me optimize the content, but they also helped me arrange my work for next week. , what do you think of the organization of ChatGPT?

The author believes that although it is not perfect, the answers given within the given keywords are already very unexpected.

For more experience, you can explore it by yourself. Let’s take a look at the ChatGPT project on GitHub.

Node.js API interface

Front-end engineers are familiar with Nodejs, and the official website has a nodejs interface

openai

First install openai through npm

npm install openai
Copy after login

Then you can use the following code in any interface

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: "你好",
max_tokens: 255,
temperature: 0.5,
});

// 打印 API 返回的结果
console.log(response.data.choices[0].text);
Copy after login
  • createCompletion means automatic completion, which is consistent with the official website's reply method;
  • max_tokens The largest tokens The quantity can be understood as the number of characters returned. Most content is within 2048. Of course, max_tokens returns the interface slower.
  • temperature: Between 0-1, the temperature parameter represents the degree of randomness or unpredictability in the generated text. Higher temperature values ​​will produce more creative and varied output, while lower temperature values ​​will produce more predictable and repetitive text.
  • OPENAI_API_KEY can be generated through the View API keys page.

ChatGPT and related open source project experience

chatgpt

The other is a personal development project, which re-encapsulates the API of ChatGPT, making customized development easy. More convenient.

Install chatgpt via npm.

npm install chatgpt
Copy after login
import { ChatGPTAPI } from 'chatgpt'

async function example() {
// sessionToken is required; see below for details
const api = new ChatGPTAPI({
sessionToken: process.env.SESSION_TOKEN
})

// ensure the API is properly authenticated
await api.ensureAuth()

// send a message and wait for the response
const response = await api.sendMessage(
'Write a python version of bubble sort.'
)

// response is a markdown-formatted string
console.log(response)
}
Copy after login

SESSION_TOKEN value needs to be copied through the chome console after logging in to the account.

ChatGPT and related open source project experience

GitHub: https://github.com/transitive-bullshit/chatgpt-api

  • chatgpt simulates the ChatGPT web version, which requires Using node server (generally overseas) and stream, the current attempt cannot be deployed to vercel
  • openai is an officially provided package and can be deployed to the vercel environment, but the return is subject to time limits and word count Limitation, you need to set the max_tokens value smaller, which will lead to incomplete replies.

WeChat Chat Assistant

WeChat GPT

This project is based on wechaty, allowing you to quickly initiate a conversation with ChatGPT through the WeChat chat window.

Before using it, you need to configure OpenAI’s Session Token information and the corresponding “keyword” trigger.

ChatGPT and related open source project experience

Function and Features

ChatGPT and related open source project experience

Access to the public account

GitHub: https://github. com/fuergaosi233/wechat-chatgpt

WeChat Bot

A WeChat bot based on chatgpt wechaty, which can be used to help you automatically reply to WeChat messages, or manage WeChat groups/friends. It is simple, easy to use, and can be played in 2 minutes.

Execute npm install after git cloning the project, modify the env related configuration,

Then modify the relevant logical files according to your needs

ChatGPT and related open source project experience

Modify the configuration

You can scan the QR code to log in

ChatGPT and related open source project experience

Scan the QR code to log in

This is the actual effect:

ChatGPT and related open source project experience

WeChat access demonstration

GitHub: https://github.com/wangrongding/wechat-bot

Browser plug-in

ChatGPT for Google

This plug-in supports Chrome / Edge / Firefox and other browsers.

After installation, in addition to the normal display of Google search content in the browser, ChatGPT feedback results will also be displayed on the right side, which can further improve search efficiency.

ChatGPT and related open source project experience

Search Demo

GitHub: https://github.com/wong2/chat-gpt-google-extension

ChatGPT Chrome Extension

This is a ChatGPT plug-in specially developed for Chrome users.

After installation, right-click in the text box on any page to pop up the "Ask ChatGPT" option.

ChatGPT will search based on the content in the current text box. This extension also includes a plugin system that provides greater control over the behavior of ChatGPT and the ability to interact with third-party APIs.

ChatGPT and related open source project experience

Plugin Demo

GitHub: https://github.com/gragland/chatgpt-chrome-extension

Grease Monkey Script

Will Baoge from Taiwan can turn ChatGPT into your voice assistant, realizing voice input and automatic reading functions. Let us say goodbye to typing mode through the Web Speech API that comes with the browser.

He has a video explanation at Station B [2], you can watch it, it is very interesting.

GitHub: https://github.com/doggy8088/TampermonkeyUserscripts

ChatGPT and related open source project experience

Reverse Engineering

Any project that makes engineers full of curiosity , cannot escape reversal, and ChatGPT is no exception in this regard.

Antonio Cheong, a developer from Malaysia on GitHub, reversed ChatGPT not long after its release and successfully extracted the API.

With these APIs, we can develop a fun chatbot, AI intelligent assistant, code assistance tool and other applications by ourselves.

ChatGPT and related open source project experience

GitHub: https://github.com/acheong08/ChatGPT

Mac software

is customized for Mac users A small tool: ChatGPT for desktop, supports M1 and Mac Intel. After installation, you can quickly launch ChatGPT in the system menu bar through the Cmd Shift G shortcut key.

ChatGPT and related open source project experience

GitHub: https://github.com/vincelwt/chatgpt-mac

Finally

For front-end engineers, we You can use the API to integrate ChatGPT into your own application, so it is necessary to understand nodejs and docker related knowledge.

Its advantage is that its language organization ability is very strong and it can be combined with context. But the answers it gives are not necessarily correct, and sometimes they are even wrong

As the official website says, it cannot be searched through the Internet.

Limited knowledge of world and events after 2021

There is limited knowledge about what will be gained after 2021. We can use it to strengthen our search capabilities. It is up to us to decide whether to adopt the answer.

The above is the entire content of this article. If it is helpful to you, you can give it a like. This is really important to me. I hope this article will be helpful to everyone. You can also refer to my previous articles. Or share your thoughts and experiences in the comment area. Welcome to explore the front end together.

[1]OpenAI launches the super powerful ChatGPT registration guide: https://juejin.cn/post/7173447848292253704

[2]ChatGPT Voice Monkey Script: https://www .bilibili.com/video/BV12P411K7gc/?vd_source=93efb77f3c9b0f1580f0a8d631b74ce2

The above is the detailed content of ChatGPT and related open source project experience. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Ten recommended open source free text annotation tools Ten recommended open source free text annotation tools Mar 26, 2024 pm 08:20 PM

Text annotation is the work of corresponding labels or tags to specific content in text. Its main purpose is to provide additional information to the text for deeper analysis and processing, especially in the field of artificial intelligence. Text annotation is crucial for supervised machine learning tasks in artificial intelligence applications. It is used to train AI models to help more accurately understand natural language text information and improve the performance of tasks such as text classification, sentiment analysis, and language translation. Through text annotation, we can teach AI models to recognize entities in text, understand context, and make accurate predictions when new similar data appears. This article mainly recommends some better open source text annotation tools. 1.LabelStudiohttps://github.com/Hu

ChatGPT now allows free users to generate images by using DALL-E 3 with a daily limit ChatGPT now allows free users to generate images by using DALL-E 3 with a daily limit Aug 09, 2024 pm 09:37 PM

DALL-E 3 was officially introduced in September of 2023 as a vastly improved model than its predecessor. It is considered one of the best AI image generators to date, capable of creating images with intricate detail. However, at launch, it was exclus

15 recommended open source free image annotation tools 15 recommended open source free image annotation tools Mar 28, 2024 pm 01:21 PM

Image annotation is the process of associating labels or descriptive information with images to give deeper meaning and explanation to the image content. This process is critical to machine learning, which helps train vision models to more accurately identify individual elements in images. By adding annotations to images, the computer can understand the semantics and context behind the images, thereby improving the ability to understand and analyze the image content. Image annotation has a wide range of applications, covering many fields, such as computer vision, natural language processing, and graph vision models. It has a wide range of applications, such as assisting vehicles in identifying obstacles on the road, and helping in the detection and diagnosis of diseases through medical image recognition. . This article mainly recommends some better open source and free image annotation tools. 1.Makesens

Can AI conquer Fermat's last theorem? Mathematician gave up 5 years of his career to turn 100 pages of proof into code Can AI conquer Fermat's last theorem? Mathematician gave up 5 years of his career to turn 100 pages of proof into code Apr 09, 2024 pm 03:20 PM

Fermat's last theorem, about to be conquered by AI? And the most meaningful part of the whole thing is that Fermat’s Last Theorem, which AI is about to solve, is precisely to prove that AI is useless. Once upon a time, mathematics belonged to the realm of pure human intelligence; now, this territory is being deciphered and trampled by advanced algorithms. Image Fermat's Last Theorem is a "notorious" puzzle that has puzzled mathematicians for centuries. It was proven in 1993, and now mathematicians have a big plan: to recreate the proof using computers. They hope that any logical errors in this version of the proof can be checked by a computer. Project address: https://github.com/riccardobrasca/flt

Recommended: Excellent JS open source face detection and recognition project Recommended: Excellent JS open source face detection and recognition project Apr 03, 2024 am 11:55 AM

Face detection and recognition technology is already a relatively mature and widely used technology. Currently, the most widely used Internet application language is JS. Implementing face detection and recognition on the Web front-end has advantages and disadvantages compared to back-end face recognition. Advantages include reducing network interaction and real-time recognition, which greatly shortens user waiting time and improves user experience; disadvantages include: being limited by model size, the accuracy is also limited. How to use js to implement face detection on the web? In order to implement face recognition on the Web, you need to be familiar with related programming languages ​​and technologies, such as JavaScript, HTML, CSS, WebRTC, etc. At the same time, you also need to master relevant computer vision and artificial intelligence technologies. It is worth noting that due to the design of the Web side

How to install chatgpt on mobile phone How to install chatgpt on mobile phone Mar 05, 2024 pm 02:31 PM

Installation steps: 1. Download the ChatGTP software from the ChatGTP official website or mobile store; 2. After opening it, in the settings interface, select the language as Chinese; 3. In the game interface, select human-machine game and set the Chinese spectrum; 4 . After starting, enter commands in the chat window to interact with the software.

Alibaba 7B multi-modal document understanding large model wins new SOTA Alibaba 7B multi-modal document understanding large model wins new SOTA Apr 02, 2024 am 11:31 AM

New SOTA for multimodal document understanding capabilities! Alibaba's mPLUG team released the latest open source work mPLUG-DocOwl1.5, which proposed a series of solutions to address the four major challenges of high-resolution image text recognition, general document structure understanding, instruction following, and introduction of external knowledge. Without further ado, let’s look at the effects first. One-click recognition and conversion of charts with complex structures into Markdown format: Charts of different styles are available: More detailed text recognition and positioning can also be easily handled: Detailed explanations of document understanding can also be given: You know, "Document Understanding" is currently An important scenario for the implementation of large language models. There are many products on the market to assist document reading. Some of them mainly use OCR systems for text recognition and cooperate with LLM for text processing.

Single card running Llama 70B is faster than dual card, Microsoft forced FP6 into A100 | Open source Single card running Llama 70B is faster than dual card, Microsoft forced FP6 into A100 | Open source Apr 29, 2024 pm 04:55 PM

FP8 and lower floating point quantification precision are no longer the "patent" of H100! Lao Huang wanted everyone to use INT8/INT4, and the Microsoft DeepSpeed ​​team started running FP6 on A100 without official support from NVIDIA. Test results show that the new method TC-FPx's FP6 quantization on A100 is close to or occasionally faster than INT4, and has higher accuracy than the latter. On top of this, there is also end-to-end large model support, which has been open sourced and integrated into deep learning inference frameworks such as DeepSpeed. This result also has an immediate effect on accelerating large models - under this framework, using a single card to run Llama, the throughput is 2.65 times higher than that of dual cards. one

See all articles