OpenAI-ChatGPT最新官方接口《聊天交互多轮对话》全网最详细中英文实用指南和教程,助你零基础快速轻松掌握全新技术(二)(附源码)

news2025/1/19 3:13:55

目录

  • Chat completions Beta 聊天交互
  • 前言
  • Introduction 导言
    • Response format 提示格式
    • Managing tokens
      • Counting tokens for chat API calls 为聊天API调用标记计数
  • Instructing chat models 指导聊天模型
  • Chat vs Completions 聊天与完成
  • FAQ 问与答
  • 其它资料下载

在这里插入图片描述

Chat completions Beta 聊天交互

Using the OpenAI Chat API, you can build your own applications with gpt-3.5-turbo and gpt-4 to do things like:
使用OpenAI Chat API,您可以使用 gpt-3.5-turbogpt-4 构建自己的应用程序,以执行以下操作:

  • Draft an email or other piece of writing
    起草一封电子邮件或其他书面材料
  • Write Python code 编写Python代码
  • Answer questions about a set of documents
    回答有关一组文档的问题
  • Create conversational agents 创建会话代理
  • Give your software a natural language interface
    给予你的软件一个自然语言界面
  • Tutor in a range of subjects
    一系列科目的导师
  • Translate languages 翻译语言
  • Simulate characters for video games and much more
    模拟视频游戏的角色等等

This guide explains how to make an API call for chat-based language models and shares tips for getting good results. You can also experiment with the new chat format in the OpenAI Playground.
本指南解释了如何为基于聊天的语言模型进行API调用,并分享了获得良好结果的提示。您还可以在OpenAI Playground中尝试新的聊天格式。

前言

ChatGPT的聊天交互是与用户进行交流并为他们提供创新体验的最强大工具。一句话可以概况:“将聊天交互发挥到极致,定制专属用户体验,以此解决用户痛点,是最佳创新之道。”它可以帮助用户快速定位问题并获得正确的答案,提升用户体验的同时,也能提高工作效率、减少耗时。此外,ChatGPT还可以根据用户特征和需求,提供个性化的服务,让使用者在交互中感受到独一无二的体验。

Introduction 导言

Chat models take a series of messages as input, and return a model-generated message as output.
聊天模型将一系列消息作为输入,并返回模型生成的消息作为输出。

Although the chat format is designed to make multi-turn conversations easy, it’s just as useful for single-turn tasks without any conversations (such as those previously served by instruction following models like text-davinci-003).
虽然聊天格式旨在使多轮对话变得容易,但它对于没有任何对话的单轮任务同样有用(例如以前由指令跟随模型(如 text-davinci-003 )提供的任务)。

An example API call looks as follows:
示例API调用如下所示:

# Note: you need to be using OpenAI Python v0.27.0 for the code below to work 
# 注意:下面的代码需要使用OpenAI Python v0.27.0才能工作
import openai

openai.ChatCompletion.create(
  model="gpt-3.5-turbo",
  messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Who won the world series in 2020?"},
        {"role": "assistant", "content": "The Los Angeles Dodgers won the World Series in 2020."},
        {"role": "user", "content": "Where was it played?"}
    ]
)

The main input is the messages parameter. Messages must be an array of message objects, where each object has a role (either “system”, “user”, or “assistant”) and content (the content of the message). Conversations can be as short as 1 message or fill many pages.
主输入是messages参数。消息必须是消息对象的数组,其中每个对象都有一个角色(“系统”、“用户”或“助理”)和内容(消息的内容)。对话可以短至1条消息或填写许多页面。

Typically, a conversation is formatted with a system message first, followed by alternating user and assistant messages.
通常,首先使用系统消息格式化对话,然后交替使用用户和助理消息。

The system message helps set the behavior of the assistant. In the example above, the assistant was instructed with “You are a helpful assistant.”
系统消息有助于设置助手的行为。在上面的示例中,助理被指示“你是一个有用的助理。”

gpt-3.5-turbo-0301 does not always pay strong attention to system messages.Future models will be trained to pay stronger attention to system messages.
GPT-3.5-turbo-0301并不总是特别关注系统消息。未来的模型将被训练为更加关注系统消息。

The user messages help instruct the assistant. They can be generated by the end users of an application, or set by a developer as an instruction.
用户消息帮助指示助理。它们可以由应用程序的最终用户生成,也可以由开发人员设置为指令。

The assistant messages help store prior responses. They can also be written by a developer to help give examples of desired behavior.
助理消息帮助存储先前的响应。它们也可以由开发人员编写,以帮助给予所需行为的示例。

Including the conversation history helps when user instructions refer to prior messages. In the example above, the user’s final question of “Where was it played?” only makes sense in the context of the prior messages about the World Series of 2020. Because the models have no memory of past requests, all relevant information must be supplied via the conversation. If a conversation cannot fit within the model’s token limit, it will need to be shortened in some way.
包括对话历史有助于用户指示引用先前的消息。在上面的示例中,用户的最终问题“在哪里播放的?“只有在之前关于2020年世界大赛的信息中才有意义。因为模型没有过去请求的记忆,所有相关信息必须通过会话提供。如果一个对话不能满足模型的标记限制,它将需要以某种方式缩短。

Response format 提示格式

An example API response looks as follows:
API响应示例如下所示:

{
 'id': 'chatcmpl-6p9XYPYSTTRi0xEviKjjilqrWU2Ve',
 'object': 'chat.completion',
 'created': 1677649420,
 'model': 'gpt-3.5-turbo',
 'usage': {'prompt_tokens': 56, 'completion_tokens': 31, 'total_tokens': 87},
 'choices': [
   {
    'message': {
      'role': 'assistant',
      'content': 'The 2020 World Series was played in Arlington, Texas at the Globe Life Field, which was the new home stadium for the Texas Rangers.'},
    'finish_reason': 'stop',
    'index': 0
   }
  ]
}

In Python, the assistant’s reply can be extracted with response['choices'][0]['message']['content'].
在Python中,助手的回复可以用 response['choices'][0]['message']['content'] 提取。

Every response will include a finish_reason. The possible values for finish_reason are:
每个响应都将包含一个 finish_reasonfinish_reason 的可能值为:

  • stop: API returned complete model output
    stop :API返回完整模型输出
  • length: Incomplete model output due to max_tokens parameter or token limit
    length :由于 max_tokens 参数或标记限制,模型输出不完整
  • content_filter: Omitted content due to a flag from our content filters
    content_filter :由于我们的内容过滤器中的标记而忽略了内容
  • null: API response still in progress or incomplete
    null :API响应仍在进行中或未完成

Managing tokens

Language models read text in chunks called tokens. In English, a token can be as short as one character or as long as one word (e.g., a orapple), and in some languages tokens can be even shorter than one character or even longer than one word.
语言模型以称为标记的块读取文本。在英语中,标记可以短至一个字符或长至一个单词(例如, aapple ),并且在一些语言中,标记甚至可以比一个字符更短或者甚至比一个单词更长。

For example, the string "ChatGPT is great!" is encoded into six tokens: ["Chat", "G", "PT", " is", " great", "!"].
例如,字符串 "ChatGPT is great!" 被编码为六个标记: ["Chat", "G", "PT", " is", " great", "!"]

The total number of tokens in an API call affects:
API调用中的标记总数影响:

  • How much your API call costs, as you pay per token
    您的API调用成本是多少,按每个标记标记支付
  • How long your API call takes, as writing more tokens takes more time
    您的API调用需要多长时间,因为编写更多标记需要更多时间
  • Whether your API call works at all, as total tokens must be below the model’s maximum limit (4096 tokens for gpt-3.5-turbo-0301)
    您的API调用是否有效,会受到标记总数必须低于模型的最大限制( gpt-3.5-turbo-0301 为4096个标记)

Both input and output tokens count toward these quantities. For example, if your API call used 10 tokens in the message input and you received 20 tokens in the message output, you would be billed for 30 tokens.
输入和输出标记都计入这些数量。例如,如果您的API调用在消息输入中使用了10个标记,而您在消息输出中收到了20个标记,则您将收取30个标记的费用。

To see how many tokens are used by an API call, check the usage field in the API response (e.g., response['usage']['total_tokens']).
要查看API调用使用了多少标记,请检查API响应中的 usage 字段(例如,response['usage']['total_tokens'])。

Chat models like gpt-3.5-turbo and gpt-4 use tokens in the same way as other models, but because of their message-based formatting, it’s more difficult to count how many tokens will be used by a conversation.
gpt-3.5-turbogpt-4 这样的聊天模型使用标记的方式与其他模型相同,但由于它们基于消息的格式,因此更难以计算会话将使用多少标记。

Counting tokens for chat API calls 为聊天API调用标记计数

Below is an example function for counting tokens for messages passed to gpt-3.5-turbo-0301.
下面是一个示例函数,用于对传递到gpt-3.5-turbo-0301的消息的标记进行计数。

The exact way that messages are converted into tokens may change from model to model. So when future model versions are released, the answers returned by this function may be only approximate. The ChatML documentation explains how messages are converted into tokens by the OpenAI API, and may be useful for writing your own function.
将消息转换为标记的确切方式可能因模型而异。因此,当未来的模型版本发布时,此函数返回的答案可能只是近似值。ChatML文档解释了OpenAI API如何将消息转换为标记,并且可能对编写您自己的函数很有用。

def num_tokens_from_messages(messages, model="gpt-3.5-turbo-0301"):
  """Returns the number of tokens used by a list of messages."""
  try:
      encoding = tiktoken.encoding_for_model(model)
  except KeyError:
      encoding = tiktoken.get_encoding("cl100k_base")
  if model == "gpt-3.5-turbo-0301":  # note: future models may deviate from this
      num_tokens = 0
      for message in messages:
          num_tokens += 4  # every message follows <im_start>{role/name}\n{content}<im_end>\n
          for key, value in message.items():
              num_tokens += len(encoding.encode(value))
              if key == "name":  # if there's a name, the role is omitted
                  num_tokens += -1  # role is always required and always 1 token
      num_tokens += 2  # every reply is primed with <im_start>assistant
      return num_tokens
  else:
      raise NotImplementedError(f"""num_tokens_from_messages() is not presently implemented for model {model}.
  See https://github.com/openai/openai-python/blob/main/chatml.md for information on how messages are converted to tokens.""")

Next, create a message and pass it to the function defined above to see the token count, this should match the value returned by the API usage parameter:
接下来,创建一条消息并将其传递给上面定义的函数以查看标记计数,这应该与API使用参数返回的值匹配:

messages = [
  {"role": "system", "content": "You are a helpful, pattern-following assistant that translates corporate jargon into plain English."},
  {"role": "system", "name":"example_user", "content": "New synergies will help drive top-line growth."},
  {"role": "system", "name": "example_assistant", "content": "Things working well together will increase revenue."},
  {"role": "system", "name":"example_user", "content": "Let's circle back when we have more bandwidth to touch base on opportunities for increased leverage."},
  {"role": "system", "name": "example_assistant", "content": "Let's talk later when we're less busy about how to do better."},
  {"role": "user", "content": "This late pivot means we don't have time to boil the ocean for the client deliverable."},
]

model = "gpt-3.5-turbo-0301"

print(f"{num_tokens_from_messages(messages, model)} prompt tokens counted.")
# Should show ~126 total_tokens

To confirm the number generated by our function above is the same as what the API returns, create a new Chat Completion:
要确认我们上面的函数生成的数字与API返回的数字相同,请创建一个新的聊天完成:

# example token count from the OpenAI API
import openai

response = openai.ChatCompletion.create(
    model=model,
    messages=messages,
    temperature=0,
)

print(f'{response["usage"]["prompt_tokens"]} prompt tokens used.')

To see how many tokens are in a text string without making an API call, use OpenAI’s tiktoken Python library. Example code can be found in the OpenAI Cookbook’s guide on how to count tokens with tiktoken.
要在不进行API调用的情况下查看文本字符串中有多少标记,请使用OpenAI的tiktoken Python库。示例代码可以在OpenAI Cookbook关于如何使用tiktoken进行标记计数的指南中找到。

Each message passed to the API consumes the number of tokens in the content, role, and other fields, plus a few extra for behind-the-scenes formatting. This may change slightly in the future.
传递给API的每条消息都会消耗内容、角色和其他字段中的标记数量,外加一些用于幕后格式化的额外标记。这在未来可能会略有变化。

If a conversation has too many tokens to fit within a model’s maximum limit (e.g., more than 4096 tokens for gpt-3.5-turbo), you will have to truncate, omit, or otherwise shrink your text until it fits. Beware that if a message is removed from the messages input, the model will lose all knowledge of it.
如果对话具有太多标记而不能适应模型的最大限制(例如,超过4096个标记(对于 gpt-3.5-turbo ),您将不得不截断、省略或以其他方式缩小文本,直到它适合为止。请注意,如果从消息输入中删除了一条消息,则模型将丢失所有关于它的知识。

Note too that very long conversations are more likely to receive incomplete replies. For example, a gpt-3.5-turboconversation that is 4090 tokens long will have its reply cut off after just 6 tokens.
也要注意,很长的对话更有可能收到不完整的回复。例如,长度为4090个标记的 gpt-3.5-turbo会话将在仅6个标记之后切断其回复。

Instructing chat models 指导聊天模型

Best practices for instructing models may change from model version to version. The advice that follows applies to gpt-3.5-turbo-0301 and may not apply to future models.
指导模型的最佳实践可能因模型版本而异。以下建议适用于gpt-3. 5-turbo-0301,可能不适用于未来的模型。

Many conversations begin with a system message to gently instruct the assistant. For example, here is one of the system messages used for ChatGPT:
许多对话以系统消息开始,以温和地指示助理。例如,以下是用于ChatGPT的系统消息之一:

You are ChatGPT, a large language model trained by OpenAI. Answer as concisely as possible. Knowledge cutoff: {knowledge_cutoff} Current date: {current_date}
你是ChatGPT,一个由OpenAI训练的大型语言模型。尽可能简明扼要地回答。知识截止:{knowledge_cutoff} 当前日期: {current_date}

In general, gpt-3.5-turbo-0301 does not pay strong attention to the system message, and therefore important instructions are often better placed in a user message.
一般来说, gpt-3.5-turbo-0301 不太关注系统消息,因此重要的指令通常最好放在用户消息中。

If the model isn’t generating the output you want, feel free to iterate and experiment with potential improvements. You can try approaches like:
如果模型没有生成您想要的输出,请随意迭代并尝试潜在的改进。您可以尝试以下方法:

  • Make your instruction more explicit
    让你的指示更明确
  • Specify the format you want the answer in
    指定您希望答案采用的格式
  • Ask the model to think step by step or debate pros and cons before settling on an answer
    让模型一步一步地思考,或者在确定答案之前讨论利弊

For more prompt engineering ideas, read the OpenAI Cookbook guide on techniques to improve reliability.
有关更多快速工程想法,请阅读OpenAI Cookbook关于提高可靠性的技术指南。

Beyond the system message, the temperature and max tokens are two of many options developers have to influence the output of the chat models. For temperature, higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. In the case of max tokens, if you want to limit a response to a certain length, max tokens can be set to an arbitrary number. This may cause issues for example if you set the max tokens value to 5 since the output will be cut-off and the result will not make sense to users.
除了系统消息之外, temperaturemax tokens是开发人员必须影响聊天模型输出的许多选项中的两个。对于temperature,较高的值(如0.8)将使输出更加随机,而较低的值(如0.2)将使其更加集中和确定。在max tokens的情况下,如果您希望将响应限制为特定长度,则可以将max tokens设置为任意数字。这可能会导致问题,例如,如果您将最大标记值设置为5,因为输出将被切断,结果对用户没有意义。

Chat vs Completions 聊天与完成

Because gpt-3.5-turbo performs at a similar capability to text-davinci-003 but at 10% the price per token, we recommend gpt-3.5-turbo for most use cases.
由于 gpt-3.5-turbo 的性能与 text-davinci-003 相似,但每个标记的价格为10%,因此我们建议在大多数用例中使用 gpt-3.5-turbo

For many developers, the transition is as simple as rewriting and retesting a prompt.
对于许多开发人员来说,转换就像重写和重新测试提示一样简单。

For example, if you translated English to French with the following completions prompt:
例如,如果您将英语翻译为法语,并出现以下完成提示:

Translate the following English text to French: "{text}"

An equivalent chat conversation could look like:
类似的聊天对话可能如下所示:

[
  {"role": "system", "content": "You are a helpful assistant that translates English to French."},
  {"role": "user", "content": 'Translate the following English text to French: "{text}"'}
]

Or even just the user message:
或者只是用户消息:

[
  {"role": "user", "content": 'Translate the following English text to French: "{text}"'}
]

FAQ 问与答

Is fine-tuning available for gpt-3.5-turbo?
gpt-3.5-turbo 是否可进行微调?

No. As of Mar 1, 2023, you can only fine-tune base GPT-3 models. See the fine-tuning guide for more details on how to use fine-tuned models.
不可以。自2023年3月1日起,您只能微调基本GPT-3模型。有关如何使用微调模型的更多详细信息,请参阅微调指南。

Do you store the data that is passed into the API?
您是否存储传递到API中的数据?

As of March 1st, 2023, we retain your API data for 30 days but no longer use your data sent via the API to improve our models. Learn more in our data usage policy.
自2023年3月1日起,我们将保留您的API数据30天,但不再使用您通过API发送的数据来改进我们的模型。在我们的数据使用政策中了解更多信息。

Adding a moderation layer 添加审核层
If you want to add a moderation layer to the outputs of the Chat API, you can follow our moderation guide to prevent content that violates OpenAI’s usage policies from being shown.
如果您想在Chat API的输出中添加审核层,您可以遵循我们的审核指南,以防止显示违反OpenAI使用策略的内容。

其它资料下载

如果大家想继续了解人工智能相关学习路线和知识体系,欢迎大家翻阅我的另外一篇博客《重磅 | 完备的人工智能AI 学习——基础知识学习路线,所有资料免关注免套路直接网盘下载》
这篇博客参考了Github知名开源平台,AI技术平台以及相关领域专家:Datawhale,ApacheCN,AI有道和黄海广博士等约有近100G相关资料,希望能帮助到所有小伙伴们。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/427983.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

27.Linux网络编程socket变成 tcp 高并发 线程池 udp

好&#xff0c;咱们开始上课了&#xff0c;从今天开始咱们连续讲 8 天的&#xff0c;网络编程这个还是在linux环境下去讲&#xff0c;咱们先看一下咱们这 8 天都讲什么东西&#xff0c;跟大家一块来梳理一下&#xff0c;你先有个大概的印象&#xff0c;这些你也不要记&#xff…

什么是以太坊

以太网是“世界的计算机”&#xff0c;这是以太坊平台的一种常见描述。这是什么意思呢&#xff1f;让我们首先从关注计算机科学的描述开始&#xff0c;然后对以太坊的功能和特性进行更实际的解读&#xff0c;并将其与比特币和其他分布式账本技术&#xff08;简单起见&#xff0…

【学习笔记】unity脚本学习(三)(向量 Vector3)

目录向量复习高中向量基础【数学】向量的四则运算、点积、叉积、正交基叉乘公式叉乘运算定理向量、坐标系点积叉积Vector3 三维向量静态变量变量变量normalized 与 Normalize() 方法静态方法ClampMagnitudeCrossDistanceDotMoveTowards其他变换类似Lerp 在两个点之间进行线性插…

走出至暗时刻,手机“冲高”仍有新故事

随着数十年的发展变迁&#xff0c;智能手机行业已进入平稳发展期&#xff0c;在格局重塑的同时&#xff0c;也引来外界的质疑&#xff1a;出货量下滑&#xff0c;是否意味着行业开始进入至暗时刻&#xff1f; 事实上&#xff0c;这种质疑只看到表层的数据变化&#xff0c;没有…

[Java]Cookie机制

1.Session机制&#xff1a; Session机制https://blog.csdn.net/m0_71229255/article/details/130138826?spm1001.2014.3001.5501 2. 什么是cookie HTTP协议本身是无状态的。什么是无状态呢&#xff0c;即服务器无法判断用户身份。Cookie实际上是一小段的文本信息&#xff0…

优维可观测轴心产品大观:HyperInsight超融合持续可观测解决方案

随着Kubernetes得到越来越广泛的采用&#xff0c;企业软件系统正在向复杂的云原生架构进行革命性转变。应用形式呈现有Web、APP、小程序等多种形式&#xff0c;访问的网络有4G、5G、Wi-Fi等。企业用云也从单一云时代&#xff0c;逐渐来到混合多云时代。在这些庞大复杂的多云环境…

【接口测试】从0不到1的心路历程

我是一名做了三年测试的tester&#xff0c;2020年以功能测试工程师的身份入职北京一家医疗培训公司&#xff0c;入职后为了提高测试效率&#xff0c;接触到接口测试&#xff0c;以下是从零到现在 (还有很大完善的空间&#xff0c;所以不能算是1) 的一些心路历程。 做接口测试的…

李宏毅教程系列——增强学习

目录 0. 强化学习wiki 1. 介绍 2. Exploration vs Exploitation 探索与开发 3. 各类最优化方法 3.1 Brute force猛兽蛮力法&#xff08;暴力搜索&#xff09; 3.2 Value function estimation&#xff08;价值函数估计&#xff09; 3.2.1 Monte Carlo methods 蒙特卡洛方…

linux安装南大通用数据库

linux安装南大通用数据库1、操作系统、数据库2、下载链接3、安装文档4、安装前准备4.1、以root用户创建 gbasedbt 组和用户4.2、创建 GBase 8s 数据库安装目录4.3、上传并解压安装包5、安装5.1、执行安装程序5.2、回车继续 直到接受许可条款5.3、输入安装目录绝对路径5.4、选择…

腾讯音乐笔试0414

介绍一 Triplet Loss的原理&#xff0c; 其中的样本分为哪几类?可以用于哪些场景? Triplet Loss是一种用于训练神经网络的损失函数&#xff0c;主要用于学习映射函数&#xff0c;将样本映射到低维空间中&#xff0c;使得同一类别的样本距离尽可能近&#xff0c;不同类别的样…

开发钉钉和企业微信微应用

钉钉应用开发流程&#xff1a; 1、登录钉钉后台管理 -- 应用管理 -- 工作台 -- 自建应用 2、上传内部应用logo和名字。注意需要添加可访问域名的配置。 3、配置首页可访问地址&#xff1a;打包到线上的路径&#xff08;注意配置正式环境和本地环境&#xff09; 4、在所在公司…

早有尔闻 | 低碳赋能,创新发展

01 2023中国管理科学大会 发布创新奖榜单 海尔位列第一 4月15日&#xff0c;2023中国管理科学大会暨第八届“管理科学奖”颁奖典礼在北京举行。大会发布了第八届中国管理科学学会“管理科学奖”获奖名单&#xff0c;海尔集团“基于用户端低碳升级的智慧能源管理体系建设”项…

[CVE漏洞复现系列]CVE2017_0147:永恒之蓝

Hi~ o(&#xffe3;▽&#xffe3;)ブ 文章目录前言一、永恒之蓝是什么&#xff1f;1.SMB协议介绍。二、准备工作1.Windows7 and kali linux2.テストを開始总结前言 这是新的系列&#xff0c;我能力有限有的漏洞实现不了&#xff0c;我尽力吧 &#x1f968;&#x1f968;&…

Deep Glow(AE辉光特效插件)中文版安装教程

deepglow比AE自带的辉光效果好很多&#xff0c;基于GPU运算&#xff0c;同时控制调节发光效果&#xff0c;有了这款插件&#xff0c;我们就可以非常轻松的模拟出非常真实非常漂亮的物理发光特效&#xff0c;支持各种参数的自定义&#xff0c;喜欢的欢迎下载使用。 安装教程 1…

营收、净利创新高,股价却“跌跌不休”,紫光国微怎么了?

‍数据智能产业创新服务媒体——聚焦数智 改变商业要问当前科技圈处于“风口浪尖”的&#xff0c;除了ChatGPT就应该是半导体了。近日&#xff0c;紫光国微发布2022年年报&#xff0c;实现营收和净利双创新高。作为一家在集成电路设计领域深耕二十余年的企业&#xff0c;紫光国…

快速精简软件,如何让软件缩小到原来的5%大小,从删除文件入手,到修改C++引用库,合规解决存储问题

Hi~大家好&#xff0c;今天制作一个简单的精简软件的教学~ 事先说明下&#xff0c;精简软件并不违反任何规定&#xff0c;尤其是开源软件&#xff0c;这里也仅讨论开源软件的修改&#xff0c;根据几乎所有开源软件的开源规则&#xff0c;精简软件&#xff0c;本质也就是修改软件…

如何通过python实现一个web自动化测试框架?

要实现一个web自动化测试框架&#xff0c;可以使用Python中的Selenium库&#xff0c;它是最流行的Web应用程序测试框架之一。以下是一个基本的PythonSelenium测试框架的示例&#xff1a; 如果你想学习更详细的web自动化测试教程&#xff0c;我这边给你推荐一个详细的视频教程 …

第二章 webpack基础用法

webpack核心概念之entry Entry用来指定webpack打包的入口&#xff0c;下图中webpack找到入口文件后&#xff0c;会将该文件所有的代码和非代码依赖都梳理出来&#xff0c;最终遍历完依赖树后生成打包后的静态资源。 单入口&#xff1a;entry是一个字符串 module.exports{ entry…

HCIP之MPLS

目录 MPLS MPLS --- 多协议标签交换 包交换 标签交换 包交换的变更 MPLS主要应用于三大领域 ​编辑 MPLS和包交换一样&#xff0c;其过程也可以分为控制层面和数据层面 标签交换过程&#xff08;数据层流量&#xff09; 标签解读 静态搭建LSP 创建路由条件 配置MPL…

arduino自用简单图形化编程仿真

傻瓜式编程真的很适合初学者 这边就不提fritzing和proteus的pcb设计了 就推荐几个简单的 1、linkboy 官方网址&#xff1a;http://linkboy.com.cn/index.html 也有官方教程点我 使用方法&#xff1a;官网下载软件 优点&#xff1a;元器库特别丰富&#xff0c;还具备语音识别、…