使用 GPT-4-turbo+Streamlit+wiki+calculator构建Math Agents应用【Step by Step】

news/2024/5/19 23:26:39
  • 💖 Brief:大家好,我是Zeeland。Tags: 大模型创业、LangChain Top Contributor、算法工程师、Promptulate founder、Python开发者。
  • 📝 CSDN主页:Zeeland🔥
  • 📣 个人说明书:Zeeland
  • 📣 个人网站:https://me.zeeland.cn/
  • 📚 Github主页: Undertone0809 (Zeeland)
  • 🎉 支持我:点赞👍+收藏⭐️+留言📝 我会定期在博客、个人说明书、论坛中做一些技术分享。也欢迎大家阅读我的个人说明书,大家可以在这里快速了解我和我做过的事情,期待和你交个朋友,有机会我们一起做一些有意思的事情

Introduction

本文将介绍GPT-4-turbo+Streamlit+wiki+calculator+Promptulate构建Math Agents应用,使用 Agent 进行推理,解决数学问题。

如果你想直接获取代码,可以从https://github.com/Undertone0809/promptulate/tree/main/example/build-math-application-with-agent 获取。

也可以点击https://github.com/Undertone0809/promptulate/fork fork 更多 examples 到自己的仓库里学习。

Summary

本文详细介绍了如何结合GPT-4-turbo、Streamlit、Wikipedia API、计算器功能以及Promptulate框架,构建一个名为“Math Wiz”的数学辅助应用。这个应用旨在帮助用户解决数学问题或逻辑/推理问题。通过这个项目,我们展示了如何利用Promptulate框架中的Agent进行推理,以及如何使用不同的工具来处理用户的查询。

关键步骤总结:

  • 环境搭建:创建了一个新的conda环境,并安装了所有必要的库,包括Promptulate、Wikipedia和numexpr。
  • 应用流程:设计了一个应用流程,其中包含了一个能够利用不同工具(如Wikipedia工具、计算器工具和推理工具)来回答用户查询的Agent。这个Agent使用大型语言模型(LLM)作为其“大脑”,指导它的决策。
  • 理解Promptulate Agent:介绍了Promptulate Agent的概念,这是一个设计用来与语言模型进行更复杂和交互式任务的接口。

逐步实现:

  • 创建了chatbot.py脚本并导入了必要的依赖。
  • 定义了基于OpenAI的语言模型。
  • 创建了三个工具:Wikipedia工具、计算器工具和推理工具。
  • 初始化了Agent,并指定了LLM来帮助它选择使用哪些工具及其顺序。
  • 创建Streamlit应用:使用Streamlit框架来构建应用的前端界面,允许用户输入问题并接收Agent的回答。

测试案例:

  • 通过几个测试案例,展示了“Math Wiz”应用如何处理不同类型的数学和逻辑问题,包括算术运算、历史事实查询和逻辑推理等。

Building a Math Application with promptulate Agents

This demo is how to use promptulates agents to create a custom Math application utilising OpenAI’s GPT3.5 Model.
For the application frontend, there will be using streamlit, an easy-to-use open-source Python framework.
This generative math application, let’s call it “Math Wiz”, is designed to help users with their math or reasoning/logic questions.

Environment Setup

We can start off by creating a new conda environment with python=3.11:conda create -n math_assistant python=3.11

Activate the environment:conda activate math_assistant

Next, let’s install all necessary libraries:
pip install -U promptulate
pip install wikipedia
pip install numexpr

Sign up at OpenAI and obtain your own key to start making calls to the gpt model. Once you have the key, create a .env file in your repository and store the OpenAI key:

OPENAI_API_KEY="your_openai_api_key"

Application Flow

The application flow for Math Wiz is outlined in the flowchart below. The agent in our pipeline will have a set of tools at its disposal that it can use to answer a user query. The Large Language Model (LLM) serves as the “brain” of the agent, guiding its decisions. When a user submits a question, the agent uses the LLM to select the most appropriate tool or a combination of tools to provide an answer. If the agent determines it needs multiple tools, it will also specify the order in which the tools are used.

The application flow for Math Wiz is outlined below:

The agent in our pipeline will have a set of tools at its disposal that it can use to answer a user query. The Large Language Model (LLM) serves as the “brain” of the agent, guiding its decisions. When a user submits a question, the agent uses the LLM to select the most appropriate tool or a combination of tools to provide an answer. If the agent determines it needs multiple tools, it will also specify the order in which the tools are used.

The agent for our Math Wiz app will be using the following tools:

  1. Wikipedia Tool: this tool will be responsible for fetching the latest information from Wikipedia using the Wikipedia API. While there are paid tools and APIs available that can be integrated inside Promptulate, I would be using Wikipedia as the app’s online source of information.

  2. Calculator Tool: this tool would be responsible for solving a user’s math queries. This includes anything involving numerical calculations. For example, if a user asks what the square root of 4 is, this tool would be appropriate.

  3. Reasoning Tool: the final tool in our application setup would be a reasoning tool, responsible for tackling logical/reasoning-based user queries. Any mathematical word problems should also be handled with this tool.

Now that we have a rough application design, we can begin thinking about building this application.

Understanding promptulate Agents

Promptulate agents are designed to enhance interaction with language models by providing an interface for more complex and interactive tasks. We can think of an agent as an intermediary between users and a large language model. Agents seek to break down a seemingly complex user query, that our LLM might not be able to tackle on its own, into easier, actionable steps.

In our application flow, we defined a few different tools that we would like to use for our math application. Based on the user input, the agent should decide which of these tools to use. If a tool is not required, it should not be used. Promptulate agents can simplify this for us. These agents use a language model to choose a sequence of actions to take. Essentially, the LLM acts as the “brain” of the agent, guiding it on which tool to use for a particular query, and in which order. This is different from Proptulate chains where the sequence of actions are hardcoded in code. Promptulate offers a wide set of tools that can be integrated with an agent. These tools include, and are not limited to, online search tools, API-based tools, chain-based tools etc. For more information on Promptulate agents and their types, see this.

Step-by-Step Implementation

Step 1

Create a chatbot.py script and import the necessary dependencies:

from promptulate.llms import ChatOpenAI
from promptulate.tools.wikipedia.tools import wikipedia_search
from promptulate.tools.math.tools import calculator
import promptulate as pne

Step 2

Next, we will define our OpenAI-based Language Model.The architectural design of promptulate is easily compatible with different large language model extensions. In promptulate, llm is responsible for the most basic part of content generation, so it is the most basic component.By default, ChatOpenAI in promptulate uses the gpt-3.5-turbo model.

llm = pne.LLMFactory.build(model_name="gpt-4-turbo", model_config={"temperature": 0.5})

We would be using this LLM both within our math and reasoning process and as the decision maker for our agent.

Step 3

When constructing your own agent, you will need to provide it with a list of tools that it can use. Difine a tool, the only you need to do is to provide a function to Promptulate. Promptulate will automatically convert it to a tool that can be used by the language learning model (LLM). The final presentation result it presents to LLM is an OpenAI type JSON schema declaration.

Actually, Promptulate will analysis function name, parameters type, parameters attribution, annotations and docs when you provide the function. We strongly recommend that you use the official best practices of Template for function writing. The best implementation of a function requires adding type declarations to its parameters and providing function level annotations. Ideally, declare the meaning of each parameter within the annotations.

We will now create our three tools. The first one will be the online tool using the Wikipedia API wrapper:

# Wikipedia Tool
def wikipedia_tool(keyword: str) -> str:"""search by keyword in web.A useful tool for searching the Internet to find information on world events,issues, dates,years, etc. Worth using for general topics. Use precise questions.Args:keyword: keyword to searchReturns:str: search result"""return wikipedia_search(keyword)

Next, let’s define the tool that we will be using for calculating any numerical expressions. Promptulate offers the calculator which uses the numexpr Python library to calculate mathematical expressions. It is also important that we clearly define what this tool would be used for. The description can be helpful for the agent in deciding which tool to use from a set of tools for a particular user query.

# calculator tool for arithmetics
def math_tool(expression: str):"""Useful for when you need to answer questions about math. This tool is onlyfor math questions and nothing else. Only input math expressions.Args:expression: A mathematical expression, eg: 18^0.43Attention:Expressions can not exist variables!eg: (current age)^0.43 is wrong, you should use 18^0.43 instead.Returns:The result of the evaluation."""return calculator(expression)

Finally, we will be defining the tool for logic/reasoning-based queries. We will first create a prompt to instruct the model with executing the specific task. Then we will create a simple AssistantMessage for this tool, passing it the LLM and the prompt.

# reasoning based tool
def word_problem_tool(question: str) -> str:"""Useful for when you need to answer logic-based/reasoning questions.Args:question(str): Detail question, the description of the problem requires adetailed question context. Include a description of the problemReturns:question answer"""system_prompt: str = """You are a reasoning agent tasked with solving t he user's logic-based questions.Logically arrive at the solution, and be factual.In your answers, clearly detail the steps involved and give the final answer.Provide the response in bullet points."""  # noqallm = ChatOpenAI()return llm(f"{system_prompt}\n\nQuestion:{question}Answer:")

Step 4

We will now initialize our agent with the tools we have created above. We will also specify the LLM to help it choose which tools to use and in what order:

# agent
agent = pne.ToolAgent(tools=[wikipedia_tool, math_tool, word_problem_tool],llm=llm)resp: str = agent.run("I have 3 apples and 4 oranges.I give half of my oranges away and buy two dozen new ones,along with three packs of strawberries.Each pack of strawberry has 30 strawberries.How many total pieces of fruit do I have at the end?")
print(resp)
[31;1m[1;3m[Agent] Tool Agent start...[0m
[36;1m[1;3m[User instruction] I have 3 apples and 4 oranges.I give half of my oranges away and buy two dozen new ones,along with three packs of strawberries.Each pack of strawberry has 30 strawberries.How many total pieces of fruit do I have at the end?[0m
[33;1m[1;3m[Thought] I should break down the problem step by step and calculate the total number of fruits at the end.[0m
[33;1m[1;3m[Action] word_problem_tool args: {'question': 'I have 3 apples and 4 oranges. I give half of my oranges away and buy two dozen new ones, along with three packs of strawberries. Each pack of strawberry has 30 strawberries. How many total pieces of fruit do I have at the end?'}[0m
[33;1m[1;3m[Observation] To solve this problem, we can break it down into steps and calculate the total number of fruit pieces you have at the end:Initial fruits:
- 3 apples
- 4 orangesGiving away half of the oranges:
- You have 4 oranges, so you give away 4/2 = 2 oranges.
- After giving away 2 oranges, you have 4 - 2 = 2 oranges remaining.Buying new fruits:
- You buy 2 dozen new oranges, where 1 dozen is equal to 12.
- 2 dozen oranges is 2 * 12 = 24 oranges.
- You also buy 3 packs of strawberries, with each pack having 30 strawberries.
- Total strawberries bought = 3 * 30 = 90 strawberries.Calculating total fruit pieces at the end:
- After giving away half of your oranges, you have 2 oranges left.
- Adding the new oranges bought, you have a total of 2 + 24 = 26 oranges.
- You initially had 3 apples, so the total apples remain 3.
- You bought 90 strawberries.
- Total fruits at the end = Total oranges + Total apples + Total strawberries
- Total fruits = 26 oranges + 3 apples + 90 strawberries = 26 + 3 + 90 = 119 pieces of fruitTherefore, at the end of the scenario, you have a total of 119 pieces of fruit.[0m
[32;1m[1;3m[Agent Result] You have a total of 119 pieces of fruit at the end of the scenario.[0m
[38;5;200m[1;3m[Agent] Agent End.[0m
You have a total of 119 pieces of fruit at the end of the scenario.

The app’s response to a logic question is following:

Creating streamlit application

We will be using Streamlit, an open-source Python framework, to build our application. With Streamlit, you can build conversational AI applications with a few simple lines of code. Using streamlit to build the demo of application is demonstrated in the peer child file chabot.py of the notebook file. You can run the file directly with the command streamlit run chatbot.py to view the effect and debug the web page.

Let’s begin by importing the Streamlit package to our chatbot.py script: pip install Streamlit == 1.28

import streamlit as st

Then,let’s build a lifecycle class to display the intermediate state of the agent response on the chat page.If you want to learn more about the life cycle, please click here

from promptulate.hook import Hook, HookTableclass MidStepOutHook:@staticmethoddef handle_agent_revise_plan(*args, **kwargs):messages = f"[Revised Plan] {kwargs['revised_plan']}"st.chat_message("assistant").write(messages)@staticmethoddef handle_agent_action(*args, **kwargs):messages = f"[Thought] {kwargs['thought']}\n"messages += f"[Action] {kwargs['action']} args: {kwargs['action_input']}"st.chat_message("assistant").write(messages)@staticmethoddef handle_agent_observation(*args, **kwargs):messages = f"[Observation] {kwargs['observation']}"st.chat_message("assistant").write(messages)@staticmethoddef registry_hooks():"""Registry and enable stdout hooks. StdoutHook can print colorfulinformation."""Hook.registry_hook(HookTable.ON_AGENT_REVISE_PLAN,MidStepOutHook.handle_agent_revise_plan,"component",)Hook.registry_hook(HookTable.ON_AGENT_ACTION, MidStepOutHook.handle_agent_action, "component")Hook.registry_hook(HookTable.ON_AGENT_OBSERVATION,MidStepOutHook.handle_agent_observation,"component",)

Next,Let’s build a function,and We will be adding our LLM, tools and agent initialization code to this function.

def build_agent(api_key: str) -> pne.ToolAgent:MidStepOutHook.registry_hooks()# calculator tool for arithmeticsdef math_tool(expression: str):"""Useful for when you need to answer questions about math. This tool is onlyfor math questions and nothing else. Only input math expressions.Args:expression: A mathematical expression, eg: 18^0.43Attention:Expressions can not exist variables!eg: (current age)^0.43 is wrong, you should use 18^0.43 instead.Returns:The result of the evaluation."""return calculator(expression)# reasoning based tooldef word_problem_tool(question: str) -> str:"""Useful for when you need to answer logic-based/reasoning questions.Args:question(str): Detail question, the description of the problem requires adetailed question context. Include a description of the problemReturns:question answer"""system_prompt: str = """You are a reasoning agent tasked with solving t he user's logic-based questions.Logically arrive at the solution, and be factual.In your answers, clearly detail the steps involved and give the final answer.Provide the response in bullet points."""  # noqallm = ChatOpenAI(private_api_key=api_key)return llm(f"{system_prompt}\n\nQuestion:{question}Answer:")# Wikipedia Tooldef wikipedia_tool(keyword: str) -> str:"""search by keyword in web.A useful tool for searching the Internet to find information on world events,issues, dates,years, etc. Worth using for general topics. Use precise questions.Args:keyword: keyword to searchReturns:str: search result"""return wikipedia_search(keyword)llm = ChatOpenAI(model="gpt-4-1106-preview", private_api_key=api_key)return pne.ToolAgent(tools=[wikipedia_tool, math_tool, word_problem_tool], llm=llm)

Set the style of our application

# Create a sidebar to place the user parameter configuration
with st.sidebar:openai_api_key = st.text_input("OpenAI API Key", key="chatbot_api_key", type="password")"[Get an OpenAI API key](https://platform.openai.com/account/api-keys)""[View the source code](https://github.com/hizeros/llm-streamlit/blob/master/Chatbot.py)"  # noqa# Set title
st.title("💬 Math Wiz")
st.caption("🚀 Hi there! 👋 I am a reasoning tool by Promptulate to help you ""with your math or logic-based reasoning questions.")

Next, check our session state and render the user input and agent response to the chat page, so that we successfully build a simple math application using streamlit

# Determine whether to initialize the message variable
# otherwise initialize a message dictionary
if "messages" not in st.session_state:st.session_state["messages"] = [{"role": "assistant", "content": "How can I help you?"}]# Traverse messages in session state
for msg in st.session_state.messages:st.chat_message(msg["role"]).write(msg["content"])# User input
if prompt := st.chat_input():if not openai_api_key:st.info("Please add your OpenAI API key to continue.")st.stop()agent: pne.ToolAgent = build_agent(api_key=openai_api_key)# Add the message entered by the user to the list of messages in the session statest.session_state.messages.append({"role": "user", "content": prompt})# Display in the chat interfacest.chat_message("user").write(prompt)response: str = agent.run(prompt)st.session_state.messages.append({"role": "assistant", "content": response})st.chat_message("assistant").write(response)

Let’s try to run it:streamlit run chatbot.py
The running result is as follows:

Examples of other questions are given below for testing reference:

  1. Question 1
    • I have 3 apples and 4 oranges.I give half of my oranges away and buy two dozen new ones,along with three packs of strawberries.Each pack of strawberry has 30 strawberries.How many total pieces of fruit do I have at the end?
    • correct answer = 119
  2. Question 2
    • What is the cube root of 625?
    • correct answer = 8.5498
  3. Question 3
    • what is cube root of 81? Multiply with 13.27, and subtract 5.
    • correct answer = 52.4195
  4. Question 4
    • Steve’s sister is 10 years older than him. Steve was born when the cold war
      ended. When was Steve’s sister born?
    • correct answer = 1991 - 10 = 1981
  5. Question 5
    • Tell me the year in which Tom Cruise’s Top Gun was released, and calculate the square of that year.
    • correct answer = 1986**2 = 3944196

Summary

本项目展示了如何利用当前的AI技术和工具来构建一个实用的数学辅助应用。“Math Wiz”能够处理从简单的数学计算到复杂的逻辑推理问题,是一个结合了多种技术的创新示例。通过这个应用,用户可以得到快速准确的数学问题解答,同时也展示了人工智能在教育和日常生活中的潜力。

对于希望深入了解或自行构建此类应用的开发者,本文提供的详细步骤和代码示例是一个宝贵的资源。此外,通过提供的GitHub链接,读者可以直接访问完整的代码,进一步探索和修改以满足特定的需求或兴趣。


http://www.mrgr.cn/p/16562785

相关文章

极验4 一键解混淆

提示!本文章仅供学习交流,严禁用于任何商业和非法用途,未经许可禁止转载,禁止任何修改后二次传播,如有侵权,可联系本文作者删除! AST简介 AST(Abstract Syntax Tree)&a…

9.数字马力面试

9.1 Java基础9.1.1 volatile的概述和原理在Java中volatile是一个防止指令重排以及保证可见性的关键字。如果我们将变量声明为volatile,那么就指示JVM这个变量共享且不稳定,每次从主存中进行读取。AQS的status就是使用volatile修饰的。 借用Guide哥的图片:   如果将变量声明…

Python Dash库:一个Web应用只需几行代码

大家好,在数据科学领域,数据可视化是将数据以图形化形式展示出来,帮助我们更直观地理解数据。Python中有一个非常流行的数据可视化库叫做Dash,Dash以其简洁、高效和强大的功能而闻名,它允许开发者快速构建交互式Web应用…

mac nvm install node<version> error 404

mac m2芯片遇到的问题,估计m系列的应该也有这个问题,在这里记录一下 解决方案: ## 需要先处理一下兼容就OK了arch -x86_64 zsh nvm install returns curl: (22) The requested URL returned error: 404 Issue #2667 nvm-sh/nvm GitHub

传统汽车空调系统工作原理

1.首先讲一个概念 液体变成气体:吸热 气体变成液体:放热 2.在汽车空调系统中热量的传递的介质不是水,而是氟利昂,简称:“氟”。 3.传统式汽车空调结构如下 该三个部件位于车头进气口位置 该部位位于汽车驾驶车厢前方…

ubuntu 安装单节点HBase

下载HBase mkdir -p /home/ellis/HBase/ cd /home/ellis/HBase/ wget https://downloads.apache.org/hbase/2.5.8/hbase-2.5.8-bin.tar.gz tar -xvf hbase-2.5.8-bin.tar.gz安装java jdk sudo apt install openjdk-11-jdksudo vim /etc/profileexport JAVA_HOME/usr/lib/jvm/…

【vue3入门】-【21】 组件传递数据

组件传递数据_Props静态数据传递组件与组件之间不是完全独立的,而是有交集的,那就是组件与组件之间是可以传递数据的 传递数据的解决方案就是props app.vue <template><!--主要要生效Header中的样式,需要删除main.json中默认的main.css样式--><!--不需要再次…

shell脚本编写-测试同一网段内主机是否在线

除了可以使用ansible自动化运维工具判断主机是否在线以外&#xff0c;还可以通过编写Shell脚本来实现。 1、编写脚本 #! /bin/bash #测试192.168.81.0/24网段中哪些主机处于开机状态&#xff0c;哪些主机处于关机状态# #方法一&#xff1a;使用for循环判断 # for i in {1..25…

大学数据结构学不进去怎么办?

在开始前我有一些资料&#xff0c;是我根据网友给的问题精心整理了一份「数据结构的资料从专业入门到高级教程」&#xff0c; 点个关注在评论区回复“888”之后私信回复“888”&#xff0c;全部无偿共享给大家&#xff01;&#xff01;&#xff01;除了极少数的“算法天才”&a…

快讯! MySQL 8.4.0 LTS 发布(MySQL 第一个长期支持版本)

MySQL 第一个长期支持版本 8.4.0 LTS 发布&#xff0c;社区版下载地址&#xff1a; https://dev.mysql.com/downloads/mysql/ 功能变更 添加或更改的功能 组复制&#xff1a;与组复制相关的两个服务器系统变量的默认值已更改&#xff1a; 系统变量的默认值为 group_replication…

走过人生的复平面:个人信息学奥林匹克生涯回顾

从最开始到一切的结局,完整详细的个人回忆录。走过人生的复平面—— 个人信息学奥林匹克生涯回顾写在前面:一个简单的介绍 信息学奥林匹克竞赛,即 Olympiad in Informatics,AKA OI,而学习 OI 的人则自称为 OIer。通常来讲,一个中国大陆 OIer 的一个赛季是,参加 10 月份的…

计算机视觉——OpenCV Otsu阈值法原理及实现

算法简介 Otsu阈值法&#xff0c;也被称为大津算法&#xff0c;是一种在图像处理中广泛使用的自动阈值分割技术。这种方法由日本学者大津展之于1979年提出&#xff0c;旨在根据图像的灰度直方图来自动选择最佳全局阈值。Otsu阈值法的核心思想是最小化类内方差或最大化类间方差…

springboot项目组合定时器schedule注解实现定时任务

springboot项目组合定时器schedule注解实现定时任务&#xff01; 创建好springboot项目后&#xff0c;需要在启动类上增加注解开启定时器任务 下图所示&#xff1a; 增加这个注解&#xff0c;启动项目&#xff0c; package com.example.scheduledemo.util;import org.springf…

如何批量重命名,把文件(夹)名的内容位置调整(前后移动)

首先,需要用到的这个工具:度娘网盘 提取码:qwu2 蓝奏云 提取码:2r1z 情况是这样,把“中文[数字]”的名称,改为"中文 - 数字"打开工具,切换到 文件批量复制 模块,快捷键Ctrl+5找到右下角的“重命名”按钮,打开把那些文件拖入进去,也可以用右侧的导入按钮(如…

vue的template中访问不到变量

描述 源代码 <h4>&emsp;&emsp;{{hitokoto.hitokoto}}</h4>报错如下。解决 普通字符和变量之间加个空格就行了 <h4>&emsp;&emsp; {{hitokoto.hitokoto}}</h4>

Ryght 在 Hugging Face 专家助力下赋能医疗保健和生命科学之旅

本文是 Ryght 团队的客座博文。Ryght 是何方神圣? Ryght 的使命是构建一个专为医疗保健和生命科学领域量身定制的企业级生成式人工智能平台。最近,公司正式公开了 Ryght 预览版 平台。 当前,生命科学公司不断地从各种不同来源 (实验室数据、电子病历、基因组学、保险索赔、药…

如何搜索空文件夹_名称为(纯或含)中/英/数/符

首先,需要用到的这个工具:度娘网盘 提取码:qwu2 蓝奏云 提取码:2r1z 打开工具,切换到批量文件复制版块,快捷键Ctrl+5点击右侧的搜索添加设定要搜索的范围、指定为文件夹、包括子目录,勾选详细条件在过滤条件里,勾选“按命名”,“含有内容”,“仅文件夹名”,“任意”…

贪心问题 难度[普及-]一赏

目录 #小A的糖果 删数问题 陶陶摘苹果&#xff08;升级版&#xff09; P5019 NOIP2018 提高组 铺设道路 小A的糖果 原文链接: P3817 小A的糖果 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 题目描述 小 A 有 n 个糖果盒&#xff0c;第 i 个盒中有 a_i 颗糖果。 小 A 每…

认识linux内核(linux内核的作用)

目录认识linux内核Linux内核实现策略哪些地方用到了内核机制?Linux进程Linux内核源代码的目录结构Linux内核体系结构(就是Linux系统是怎么构成的)Linux体系结构和内核结构区别 认识linux内核 1.从技术层面讲,内核是硬件与软件之间的一个中间层。作用是将应用层序的请求传递…

1-1ARM开发环境搭建(GD32)

1:安装MDK最好是5.27以及以上版本&#xff0c;避免后续学习中出现相关错误 2&#xff1a;安装芯片支持包 双击安装即可&#xff0c;也可以是默认路径&#xff0c;也可以自己更改路径 3&#xff1a;安装jlink下载器驱动&#xff08;下载调试器&#xff09; 具体安装步骤如下所示…