Guide to using the ChatGPT plug-in to unlock a new Internet experience
ChatGPT’s knowledge base was trained with data as of September 2021, but by using these plugins, ChatGPT is now able to search the web for the latest answers, thus removing the limitations of relying solely on its knowledge base.
Recently, OpenAI released a new feature of ChatGPT: plug-in system. ChatGPT can now be extended with functionality and perform new tasks, such as:
- Retrieve real-time information: for example, sports scores, stock prices, the latest news, etc.
- Retrieve knowledge base information: for example, company documents, personal notes, etc.
- performs actions on behalf of the user: for example, booking a flight, ordering food, etc.
ChatGPT’s knowledge base was trained with data as of September 2021, but by using these plugins, ChatGPT is now able to search the web for the latest answers , thus removing the limitation of relying solely on its knowledge base.
Create custom plugins
OpenAI also enables any developer to create their own plugins. Although developers currently need to join a waiting list (https://openai.com/waitlist/plugins), the files to create plugins are already available.
More information about the plug-in process can be found on this page (https://platform.openai.com/docs/plugins/introduction).
Example code can be found on this page (https://platform.openai.com/docs/plugins/examples).
The documentation only shows how the integration between the third-party API and ChatGPT works. The following article will explore the inner workings of this integration:
"How do large language models perform operations without receiving relevant training?"
LangChain Introduction
LangChain is a framework for creating chatbots, generative question answering, summaries, and more
LangChain is Harrison Chase (hwchase17) A tool developed in 2022 to assist developers in integrating third-party applications into large language models (LLM).
Borrow the example shown below to explain its working mode:
import os
os.environ["SERPAPI_API_KEY"] = "
os. environ["OPENAI_API_KEY"] = "
from langchain.agents import load_tools
from langchain.agents import initialize_agent
from langchain.llms import OpenAI
# First, load the language model you want to use to control the agent
llm = OpenAI(temperature=0)
# Next, load some tools to use. Note that the llm-math tool uses LLM, so you need to pass it in
tools = load_tools(["serpapi", "llm-math"], llm=llm)
# Finally, use the tools , language model and the agent type you want to use to initialize the agent
agent = initialize_agent(tools, llm, agent="zero-shot-react-description", verbose=True)
# Test now
agent.run("Who is Olivia Wilde's boyfriend? What is his current age raised to the 0.23 power?")
Three main parts can be seen from this example:
- LLM: LLM is a core component of LangChain, which helps the agent understand natural language. In this example, OpenAI’s default model is used. According to the source code (https://github.com/hwchase17/langchain/blob/master/langchain/llms/openai.py#L133), the default model is text-davinci-003.
- Agent: The agent uses LLM to decide which actions to take and in what order. An action can be using a tool and observing its output, or it can be returning a response to the user.
The 0-shot-react-description is used here. From its documentation, we can learn that "this agent uses the ReAct framework and decides which tool to use based entirely on the tool's description." This information will be used later.
- Tools: Functions that agents can use to interact with the world. In this example, two tools are used:
serpapi: a wrapper around the https://serpapi.com/ API. It is used for browsing the web.
llm-math: Enables the agent to answer math-related questions in prompts, such as "What is his current age raised to the power 0.23?".
When the script is run, the agent does several things, such as browsing who Olivia Wilde's boyfriend is, extracting his name, asking Harry Style's age, performing a search and using llm-math The tool calculates 29^0.23, which is 2.16.
The biggest advantage of LangChain is that it does not rely on a single provider, as documented (https://python.langchain.com/en/latest/modules/llms/ integrations.html).
Why can LangChain provide powerful functions for the ChatGPT plug-in system?
On March 21, OpenAI’s strongest partner Microsoft released MM-REACT, revealing ChatGPT’s multi-modal reasoning and actions (https://github.com/microsoft/MM-REACT).
When looking at the capabilities of this "system paradigm", you can see that each example involves an interaction between the language model and some external application.
By looking at the sample code provided (https://github.com/microsoft/MM-REACT/blob/main/sample.py), we can see , the implementation of de model tools interaction is done with LangChain. The README.md file (https://github.com/microsoft/MM-REACT/blob/main/README.md) also states that "MM-REACT's code is based on langchain".
Combining this evidence, plus the fact that the ChatGPT plug-in documentation mentions that “plug-in descriptions, API requests, and API responses are all inserted into conversations with ChatGPT.” it can be assumed that the plug-in system adds different plug-ins as proxies tool, in this case ChatGPT.
It is also possible that OpenAI turned ChatGPT into a proxy of type zero-shot-react-description to support these plug-ins (which is the type we saw in the previous example). Because the description of the API is inserted into the conversation, this matches the agent's expectations, as can be seen in the documentation excerpt below.
LangChain
Conclusion
Although the plug-in system is not yet open to users, it can be experienced using published documents and MM-REACT The powerful functions of ChatGPT plug-in system.
The above is the detailed content of Guide to using the ChatGPT plug-in to unlock a new Internet experience. For more information, please follow other related articles on the PHP Chinese website!

Introduction Mean squared error (MSE), a fundamental concept in statistics and machine learning, is a key metric for assessing model accuracy. It quantifies the discrepancy between a model's predictions and the actual values. MSE's simplicity and e

Introduction Mastering data formatting is essential for any data scientist or analyst. Well-formatted data enhances readability and user-friendliness, ensuring stakeholders can easily grasp insights. SQL Server's FORMAT() function offers powerful ca

SQL Data Control Language (DCL): Securing Your Database with GRANT and REVOKE Maintaining data security and integrity is critical in relational databases. SQL's Data Control Language (DCL) provides the tools to manage user access privileges, ensurin

The McCulloch-Pitts Neuron: A Foundation for Artificial Neural Networks Biological neurons, the fundamental building blocks of the brain, inspire much of artificial neural network (ANN) research. These biological units, comprising soma, axons, dendr

SQL's DESCRIBE (or DESC) Command: Your Database Table Detective Understanding relational database table structures is crucial. SQL's DESCRIBE command acts as your database detective, providing detailed insights into table composition. At a Glance:

Rajini , a whimsical programming language born from the iconic dialogues of Rajinikanth, blends coding with pop culture. This playful esoteric language, created by Aadhithya Sankar, isn't meant for serious software development, but offers a unique

This article provides a comprehensive guide to database management system (DBMS) interview questions, designed to prepare candidates for various DBMS-related roles. It covers fundamental concepts such as DBMS and RDBMS architectures, normalization t

Powerful tools in Excel data analysis and processing: Detailed explanation of TRANSPOSE function Excel remains a powerful tool in the field of data analysis and processing. Among its many features, the TRANSPOSE function stands out for its ability to reorganize data quickly and efficiently. This feature is especially useful for data scientists and AI professionals who often need to reconstruct data to suit specific analytics needs. In this article, we will explore the TRANSPOSE function of Excel in depth, exploring its uses, usage and its practical application in data science and artificial intelligence. Learn more: Microsoft Excel Data Analytics Table of contents In Excel


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version
Visual web development tools