search
HomeTechnology peripheralsAIChatGPT and related open source project experience

ChatGPT and related open source project experience

Apr 13, 2023 am 08:22 AM
projectchatgptOpen 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

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);
  • 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
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)
}

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
This article is reproduced at:51CTO.COM. If there is any infringement, please contact admin@php.cn delete
Tesla's Robovan Was The Hidden Gem In 2024's Robotaxi TeaserTesla's Robovan Was The Hidden Gem In 2024's Robotaxi TeaserApr 22, 2025 am 11:48 AM

Since 2008, I've championed the shared-ride van—initially dubbed the "robotjitney," later the "vansit"—as the future of urban transportation. I foresee these vehicles as the 21st century's next-generation transit solution, surpas

Sam's Club Bets On AI To Eliminate Receipt Checks And Enhance RetailSam's Club Bets On AI To Eliminate Receipt Checks And Enhance RetailApr 22, 2025 am 11:29 AM

Revolutionizing the Checkout Experience Sam's Club's innovative "Just Go" system builds on its existing AI-powered "Scan & Go" technology, allowing members to scan purchases via the Sam's Club app during their shopping trip.

Nvidia's AI Omniverse Expands At GTC 2025Nvidia's AI Omniverse Expands At GTC 2025Apr 22, 2025 am 11:28 AM

Nvidia's Enhanced Predictability and New Product Lineup at GTC 2025 Nvidia, a key player in AI infrastructure, is focusing on increased predictability for its clients. This involves consistent product delivery, meeting performance expectations, and

Exploring the Capabilities of Google's Gemma 2 ModelsExploring the Capabilities of Google's Gemma 2 ModelsApr 22, 2025 am 11:26 AM

Google's Gemma 2: A Powerful, Efficient Language Model Google's Gemma family of language models, celebrated for efficiency and performance, has expanded with the arrival of Gemma 2. This latest release comprises two models: a 27-billion parameter ver

The Next Wave of GenAI: Perspectives with Dr. Kirk Borne - Analytics VidhyaThe Next Wave of GenAI: Perspectives with Dr. Kirk Borne - Analytics VidhyaApr 22, 2025 am 11:21 AM

This Leading with Data episode features Dr. Kirk Borne, a leading data scientist, astrophysicist, and TEDx speaker. A renowned expert in big data, AI, and machine learning, Dr. Borne offers invaluable insights into the current state and future traje

AI For Runners And Athletes: We're Making Excellent ProgressAI For Runners And Athletes: We're Making Excellent ProgressApr 22, 2025 am 11:12 AM

There were some very insightful perspectives in this speech—background information about engineering that showed us why artificial intelligence is so good at supporting people’s physical exercise. I will outline a core idea from each contributor’s perspective to demonstrate three design aspects that are an important part of our exploration of the application of artificial intelligence in sports. Edge devices and raw personal data This idea about artificial intelligence actually contains two components—one related to where we place large language models and the other is related to the differences between our human language and the language that our vital signs “express” when measured in real time. Alexander Amini knows a lot about running and tennis, but he still

Jamie Engstrom On Technology, Talent And Transformation At CaterpillarJamie Engstrom On Technology, Talent And Transformation At CaterpillarApr 22, 2025 am 11:10 AM

Caterpillar's Chief Information Officer and Senior Vice President of IT, Jamie Engstrom, leads a global team of over 2,200 IT professionals across 28 countries. With 26 years at Caterpillar, including four and a half years in her current role, Engst

New Google Photos Update Makes Any Photo Pop With Ultra HDR QualityNew Google Photos Update Makes Any Photo Pop With Ultra HDR QualityApr 22, 2025 am 11:09 AM

Google Photos' New Ultra HDR Tool: A Quick Guide Enhance your photos with Google Photos' new Ultra HDR tool, transforming standard images into vibrant, high-dynamic-range masterpieces. Ideal for social media, this tool boosts the impact of any photo,

See all articles

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

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor