GPT-4 Turbo:2023年科技圈最火的GPT模型

释放双眼,带上耳机,听听看~!
本文介绍了2023年科技圈最火的GPT模型GPT-4 Turbo,以及其发展历程、名词解释、内置能力和使用方法,让读者了解AI发展的最新动态。

本文所有文章内容均来自互联网,经过本人最近消化解读加个人观点转为此文章,本人非机器学习相关专业,如有错误的地方,请指正,我们一起学习

前言

GPT 应该是2023年科技圈最火的了,甚至被今年的《自然》期刊评为了年度十大人物之一。如果你还没有了解过 GPT,赶紧来阅读下这篇文章,搭上AI发展的未来之车吧

GPT-4 Turbo:2023年科技圈最火的GPT模型

名词解释

GPT

GPT-4 Turbo:2023年科技圈最火的GPT模型

GPT 发展历程

GPT-4 Turbo:2023年科技圈最火的GPT模型

www.bilibili.com/video/BV1vN…

youtu.be/pq34V_V5j18

在经历了近一年的发展后,OpenAI 在2023年11月6日的发布会,重磅公布了GPT的最新三大产品,接下来让我们来一一了解下

GPT-4 Turbo:2023年科技圈最火的GPT模型

GPT-4 Turbo  

GPT大模型的一种,是目前公开发布的最强GPT模型(截止发稿时,据说GPT4.5 已经开始内测了)

openai.com/gpt-4

GPT-4 Turbo:2023年科技圈最火的GPT模型

GPTs  (普通用户)

由GPT 大模型构建的工具平台,可以通过配置人设,instruction ,利用内置的 网络搜索,代码解释器,图片生成,知识库检索,来实现用户自定义的专属GPT助手  

www.bilibili.com/video/BV1gG…

Assistant API  (开发者)

可以通过这个api服务,利用GPT大模型,和你自己定义的 function 和 你自己上传的知识库 进行更加自由定义专属GPT工具

www.bilibili.com/video/BV1dC…

GPTs

youtu.be/pq34V_V5j18…

解释

GPTs 是一种让使用者能够量身打造自己的 AI 助理的工具。想像一下,你可以根据自己的需求和偏好,创建一个完全定制的 ChatGPT。无论是要一个能帮忙梳理电子邮件的助手,还是一个随时提供创意灵感的伙伴,GPTs 都能让这一切变成可能

你可以创建定制版本的ChatGPT,结合说明、额外知识和各种技能的组合

openai.com/blog/introd…

www.explainthis.io/zh-hans/ai/…

GPT-4 Turbo:2023年科技圈最火的GPT模型

GPT-4 Turbo:2023年科技圈最火的GPT模型

使用

GPTs 创建界面

GPT-4 Turbo:2023年科技圈最火的GPT模型

此界面分为左右两侧。左侧主要用于机器人建立,分为「Create」和「Configure」两个功能标签。

  • 在“Create”标签下:用户会开始与 GPT Builder 进行对话,这是定义 GPTs 行为和功能的阶段。这里你会输入像是“我要创建一个履历机器人”的指令,GPT Builder 会根据这些资讯进行设定。
  • 切换到“Configure”标签后:你将进一步精致化你的 GPTs。在这里,你可以为你的 GPT 命名、添加描述、设定具体指令和对话开端(Conversation starters),以及上传相关知识文件,这些文件将作为 GPT 提供回答的资料来源。另外,你还可以设定 GPTs 的能力,如是否能浏览网页、使用 DALL·E 生成图片或解析代码。

右侧的预览区,你可以及时与你当下创建的 GPTs 对话。

具体的GPTs 使用可以移步 www.explainthis.io/zh-hans/ai/… 写的很详细

内置能力

网络浏览

可以利用网络进行检索,弥补之前GPT 训练模型数据更新滞后(例如之前的GPT训练模型,最新数据截止到2021年)的情况

GPT-4 Turbo:2023年科技圈最火的GPT模型

知识库

检索可以利用模型外部的知识来增强助手,例如专有产品信息或用户提供的文档。文件上传并传递给助手后,OpenAI 将自动对文档进行分块、索引和存储嵌入,并实施矢量搜索以检索相关内容来回答用户查询

GPT-4 Turbo:2023年科技圈最火的GPT模型

代码解释器

代码解释器(Code Interpreter)是 OpenAI ChatGPT(特别是 GPT-4 模型)的最新功能,可让您在实时工作环境中运行 Python 代码。它基本上是一个沙盒 Python 环境,您可以在其中执行 Python 代码,执行您喜欢的任何任务。这听起来像是为程序员打造的功能,但它也能帮助普通用户完成许多任务(图片剪辑、数据分析、生成小游戏)。platform.openai.com/docs/assist…

GPT-4 Turbo:2023年科技圈最火的GPT模型

GPT-4 Turbo:2023年科技圈最火的GPT模型

GPT-4 Turbo:2023年科技圈最火的GPT模型

视觉功能

GPT-4V

利用 GPT-4V 模型 识别用户上传的图片

具有视觉功能的 GPT-4 (GPT-4V) 使用户能够指示 GPT-4 分析用户提供的图像输入,这是我们广泛提供的最新功能

openai.com/research/gp…

GPT-4 Turbo:2023年科技圈最火的GPT模型

DALL·E Image Generation

图片生成器,根据用户输入生成 prompt 投喂给 DALL·E 然后生成图片

DALL·E 2 是一个人工智能系统,可以根据自然语言的描述创建逼真的图像和艺术

openai.com/dall-e-2

GPT-4 Turbo:2023年科技圈最火的GPT模型

Actions

除了内置功能之外,还可以通过向 GPT 提供一个或多个 API 来定义自定义操作。与插件一样,操作允许 GPT 集成外部数据或与现实世界交互。将 GPT 连接到数据库、将其插入电子邮件或使它们成为您的购物助手。例如,您可以集成旅行列表数据库、连接用户的电子邮件收件箱或促进电子商务订单。

操作的设计建立在我们插件测试版的见解之上,使开发人员能够更好地控制模型及其 API 的调用方式。从插件测试版迁移很容易,能够使用现有的插件清单来定义 GPT 的操作。

platform.openai.com/docs/action…

GPT-4 Turbo:2023年科技圈最火的GPT模型

利用 Zapier 调用 Gmail 示例

Zapier 创建 GPTs Actions 说明:actions.zapier.com/docs/platfo…
Zapier 创建 Actions:actions.zapier.com/gpt/actions…

GPT-4 Turbo:2023年科技圈最火的GPT模型

GPT-4 Turbo:2023年科技圈最火的GPT模型

GPT-4 Turbo:2023年科技圈最火的GPT模型

You are an assistant to me. For a given day, check my Calendar and output the agenda for the day in markdown using relevant Emojis as bullet points. Don't include Zoom or Google Meet links when telling me what's on my schedule. If I ask for it, you can send a message in Slack but this should always be if I ask for it first. If I ask for more information about a meeting or an attendee, browse the web to return relevant details such as recent news about the company. 

Example Agenda: 
Here's your schedule for Tues. Nov. 7th:

1. Check-in at Hyatt Regency Seattle
⏰ After 4:00 PM PT
📍 The Location: Hyatt Regency, Seattle

2. Reid / Sheryl 1:1
⏰ 6:00 PM PT
👥 Sheryl Soo(sheryl@zapier.com), Mike Knoop (Knoop@zapier.com)
📍 Virtual

3....

### Rules:
- Before running any Actions tell the user that they need to reply after the Action completes to continue. 

### Instructions for Zapier Custom Action: 
Step 1. Tell the user you are Checking they have the Zapier AI Actions needed to complete their request. Then proceed to step 2. 
Step 2. Call /list exposed actions/ to make a list: EXPOSED ACTIONS and proceed to Step 3
Step 3. Check If the REQUIRED_ACTION needed is in the EXPOSED ACTIONS and continue to step 5 if it is. If not, continue to step 3.
Step 3. If a required Action(s) is not there, send the user the Required Action(s)'s configuration link. Tell them to let you know when they've enabled the Zapier AI Action.
Step 5. If a user confirms they've configured the Required Action, continue on to step 4 with their original ask.
Step 4. Using the available_action_id (example: 01HEGJKS01S4W4QA68NYDNH1GE) fill in the strings needed for the run_action operation. Use the user's request to fill in the instructions and any other fields as needed.

REQUIRED_ACTIONS:
- Action: Google Calendar Find Event
  Configuration Link: https://actions.zapier.com/gpt/start?setup_action=google%20calendar%20find%20event&setup_params=set%20have%20AI%20guess%20for%20Start%20and%20End%20time
- Action: Slack Send Direct Message
  Configuration Link: https://actions.zapier.com/gpt/start?setup_action=Slack%20Send%20Direct%20Message

Assistant API

助手 API 允许您在自己的应用程序中构建 AI 助手。助手有指令,可以利用模型、工具和知识来响应用户查询。 Assistants API 目前支持三种类型的工具:代码解释器、检索和函数调用。未来,我们计划发布更多 OpenAI 构建的工具,并允许您在我们的平台上提供自己的工具

GPTs 更像是官方给你提供的一个平台,你可以很方便的构建你自己的专属AI助手,但是有个这个 Assistant API服务之后,对于开发者来说就可以更加灵活的定制属于你自己的 GPTs 了

GPT-4 Turbo:2023年科技圈最火的GPT模型

Playground

官方提供了一个运行环境,可以在这里进行测试体验
platform.openai.com/playground?…

GPT-4 Turbo:2023年科技圈最火的GPT模型

概念和架构

youtu.be/pq34V_V5j18…

GPT-4 Turbo:2023年科技圈最火的GPT模型

platform.openai.com/docs/assist…

GPT-4 Turbo:2023年科技圈最火的GPT模型

GPT-4 Turbo:2023年科技圈最火的GPT模型

GPT-4 Turbo:2023年科技圈最火的GPT模型

Code Interpreter

代码解释器(Code Interpreter)是 OpenAI ChatGPT(特别是 GPT-4 模型)的最新功能,可让您在实时工作环境中运行 Python 代码。它基本上是一个沙盒 Python 环境,您可以在其中执行 Python 代码,执行您喜欢的任何任务。这听起来像是为程序员打造的功能,但它也能帮助普通用户完成许多任务。platform.openai.com/docs/assist…

const assistant = await openai.beta.assistants.create({
  instructions: "You are a personal math tutor. When asked a math question, write and run code to answer the question.",
  model: "gpt-4-1106-preview",
  tools: [{"type": "code_interpreter"}]
});

GPT-4 Turbo:2023年科技圈最火的GPT模型

Function call

platform.openai.com/docs/guides…

在 API 调用中,您可以描述函数,并让模型智能地选择输出包含调用一个或多个函数的参数的 JSON 对象。聊天完成 API 不会调用该函数;相反,模型会生成 JSON,您可以使用它来调用代码中的函数。

最新模型(gpt-3.5-turbo-1106 和 gpt-4-1106-preview)经过训练,可以检测何时应调用函数(取决于输入)并使用 JSON 进行响应,该 JSON 比以前的模型更严格地遵循函数签名。这种能力也带来了潜在的风险。我们强烈建议在代表用户采取影响世界的行动(发送电子邮件、在线发布内容、购买等)之前构建用户确认流程。

import OpenAI from "openai";
const openai = new OpenAI();


// Example dummy function hard coded to return the same weather
// In production, this could be your backend API or an external API
function getCurrentWeather(location, unit = "fahrenheit") {
  if (location.toLowerCase().includes("tokyo")) {
    return JSON.stringify({ location: "Tokyo", temperature: "10", unit: "celsius" });
  } else if (location.toLowerCase().includes("san francisco")) {
    return JSON.stringify({ location: "San Francisco", temperature: "72", unit: "fahrenheit" });
  } else if (location.toLowerCase().includes("paris")) {
    return JSON.stringify({ location: "Paris", temperature: "22", unit: "fahrenheit" });
  } else {
    return JSON.stringify({ location, temperature: "unknown" });
  }
}


async function runConversation() {
  // Step 1: send the conversation and available functions to the model
  const messages = [
    { role: "user", content: "What's the weather like in San Francisco, Tokyo, and Paris?" },
  ];
  const tools = [
    {
      type: "function",
      function: {
        name: "get_current_weather",
        description: "Get the current weather in a given location",
        parameters: {
          type: "object",
          properties: {
            location: {
              type: "string",
              description: "The city and state, e.g. San Francisco, CA",
            },
            unit: { type: "string", enum: ["celsius", "fahrenheit"] },
          },
          required: ["location"],
        },
      },
    },
  ];


  const response = await openai.chat.completions.create({
    model: "gpt-3.5-turbo-1106",
    messages: messages,
    tools: tools,
    tool_choice: "auto", // auto is default, but we'll be explicit
  });
  const responseMessage = response.choices[0].message;

  // Step 2: check if the model wanted to call a function
  const toolCalls = responseMessage.tool_calls;
  if (responseMessage.tool_calls) {
    // Step 3: call the function
    // Note: the JSON response may not always be valid; be sure to handle errors
    const availableFunctions = {
      get_current_weather: getCurrentWeather,
    }; // only one function in this example, but you can have multiple
    messages.push(responseMessage); // extend conversation with assistant's reply
    for (const toolCall of toolCalls) {
      const functionName = toolCall.function.name;
      const functionToCall = availableFunctions[functionName];
      const functionArgs = JSON.parse(toolCall.function.arguments);
      const functionResponse = functionToCall(
        functionArgs.location,
        functionArgs.unit
      );
      messages.push({
        tool_call_id: toolCall.id,
        role: "tool",
        name: functionName,
        content: functionResponse,
      }); // extend conversation with function response
    }
    const secondResponse = await openai.chat.completions.create({
      model: "gpt-3.5-turbo-1106",
      messages: messages,
    }); // get a new response from the model where it can see the function response
    return secondResponse.choices;
  }
}


runConversation().then(console.log).catch(console.error);

Knowledge Retrieval

检索可以利用模型外部的知识来增强助手,例如专有产品信息或用户提供的文档。文件上传并传递给助手后,OpenAI 将自动对文档进行分块、索引和存储嵌入,并实施矢量搜索以检索相关内容来回答用户查询

// Upload a file with an "assistants" purpose
const file = await openai.files.create({
  file: fs.createReadStream("knowledge.pdf"),
  purpose: "assistants",
});

// Add the file to the assistant
const assistant = await openai.beta.assistants.create({
  instructions: "You are a customer support chatbot. Use your knowledge base to best respond to customer queries.",
  model: "gpt-4-1106-preview",
  tools: [{"type": "retrieval"}],
  file_ids: [file.id]
});

GPT-4 Turbo:2023年科技圈最火的GPT模型

Assistant API vs GPTs

GPT-4 Turbo:2023年科技圈最火的GPT模型

GPTs: 简单来看 GPTs 是利用内置的搜索,绘图,知识库,代码解释器 来构建你的专属 AI 助手
Assistant API: 除了 内置代码解释器,知识库, 可以接入你自己定义的function 更灵活些,可以定制你的 GPTs

OpenAI 其他能力

GPT-4 Turbo:2023年科技圈最火的GPT模型

platform.openai.com/docs/guides…

Text to Speech

Function call

Text to Image

GPTs的类似产品

coze (GPT + LangChain 据说) 字节

www.coze.com/explore

GPT-4 Turbo:2023年科技圈最火的GPT模型

Coze 是一款用来开发新一代 AI Chat Bot 的应用编辑平台,无需编程基础即可快速创建各种类型的 Chat Bot,并发布到各类社交平台和通讯软件上。主要功能包括插件拓展、知识库交互、长期记忆、定时任务和工作流。用户可以定制 Bot 的功能,如播报新闻、产品顾问、定时推荐等。制作完成的 Bot 可以发布到不同的社交平台和通讯工具,目前支持的平台包括 Discord、Cici,以及即将支持的 WhatsApp 和 Twitter

GPT-4 Turbo:2023年科技圈最火的GPT模型

www.coze.com/explore/731…

GPT-4 Turbo:2023年科技圈最火的GPT模型

GPT-4 Turbo:2023年科技圈最火的GPT模型

添加插件

GPT-4 Turbo:2023年科技圈最火的GPT模型

配置插件返回ui格式

GPT-4 Turbo:2023年科技圈最火的GPT模型

调整模型

GPT-4 Turbo:2023年科技圈最火的GPT模型

根据知识库回答

GPT-4 Turbo:2023年科技圈最火的GPT模型

定时任务

GPT-4 Turbo:2023年科技圈最火的GPT模型

工作流

GPT-4 Turbo:2023年科技圈最火的GPT模型

AI Agent

aiagent.app/

GPT-4 Turbo:2023年科技圈最火的GPT模型

m.bilibili.com/opus/838152…

ModelScope-Agent(开源版GPTs) (Alibaba)

GPT-4 Turbo:2023年科技圈最火的GPT模型

GPT-4 Turbo:2023年科技圈最火的GPT模型

modelscope.cn/studios/mod…

github.com/modelscope/…

mp.weixin.qq.com/s/L3GiV2QHe…

GPTs 应用涉及的相关框架

LangChain

zhuanlan.zhihu.com/p/644500258

github.com/langchain-a…

LangChain是一个开源框架,允许从事人工智能的开发者将例如GPT-4的大语言模型与外部计算和数据来源结合起来。该框架目前以Python或JavaScript包的形式提供。

假设,你想从你自己的数据、文件中具体了解一些情况(可以是一本书、一个pdf文件、一个包含专有信息的数据库)。LangChain可以将GPT-4和这些外部数据连接起来,甚至可以让LangChain帮助你采取你想采取的行动,例如发一封邮件。

www.bilibili.com/video/BV1GL…

概念

  • Components

-LLM Wrapper:包装器,允许我们连接到大语言模型,例如GPT-4或HuggingFace的模型。

-Prompt Templates:提示模板,使我们不必对文本进行硬编码,而文本是LLM的输入。

-Indexes for relevant information retrieval:相关内容的索引,允许我们为LLM提取相关信息。

  • Chains

允许我们将多个组件组合在一起,以解决一个特定的任务,并建立一个完整的LLM应用程序。

  • Agents

允许LLM与外部API互动。

GPT-4 Turbo:2023年科技圈最火的GPT模型

顺序链

GPT-4 Turbo:2023年科技圈最火的GPT模型

应用

LangChain + Next.js Starter Template

langchain-nextjs-template.vercel.app/agents

github.com/vercel/ai/t…

GPT-4 Turbo:2023年科技圈最火的GPT模型

m.bilibili.com/video/BV1sN…

AutoGen(微软)

AutoGen 是一个框架,支持使用多个代理来开发 LLM 应用程序,这些代理可以相互对话来解决任务。 AutoGen 代理是可定制的、可对话的,并且无缝地允许人类参与。他们可以采用法学硕士、人力投入和工具组合的各种模式运作

microsoft.github.io/autogen/doc…

GPT-4 Turbo:2023年科技圈最火的GPT模型

m.bilibili.com/opus/854506…

结语

在了解完下相关知识和产品后,说不定你也可以定制一个专属你自己或团队的GPTs,可以想象到有 私域知识库问答助手,数据分析助手,办公协同工具执行助手等

AI 已来,未来会对我们的生活息息相关,作为一名软件程序开发者,更应该在这个潮流来临时跟紧时代的步伐,搭上未来的列车,这样才不会被淹没在历史的尘埃里

本网站的内容主要来自互联网上的各种资源,仅供参考和信息分享之用,不代表本网站拥有相关版权或知识产权。如您认为内容侵犯您的权益,请联系我们,我们将尽快采取行动,包括删除或更正。
AI教程

使用OpenAI API进行LLM应用开发的学习笔记

2023-12-19 14:37:14

AI教程

IP-Adapter:一张图实现风格迁移的全新“垫图”方式

2023-12-19 14:39:00

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索