使用大型语言模(LLM)构建系统(四):链式提示

news2024/11/27 22:35:09

 

今天我学习了DeepLearning.AI的 Building Systems with LLM 的在线课程,我想和大家一起分享一下该门课程的一些主要内容。

下面是我们访问大型语言模(LLM)的主要代码:

import openai
 
#您的openai的api key
openai.api_key ='YOUR-OPENAI-API-KEY' 
 
def get_completion_from_messages(messages, 
                                 model="gpt-3.5-turbo", 
                                 temperature=0, 
                                 max_tokens=500):
    response = openai.ChatCompletion.create(
        model=model,
        messages=messages,
        temperature=temperature, 
        max_tokens=max_tokens, 
    )
    return response.choices[0].message["content"]

实现具有多个提示的复杂任务

我们在之前的博客:"使用大型语言模(LLM)构建系统(三):思维链推理"中介绍了如何教会了大型语言模型LLM如何进行逻辑推理,今天我们来学习另外一种应对复杂任务的技巧:多个提示协同工作来完成复杂任务。下面我们来看一个例子,在这个例子中我们要LLM担任一家电子产品公司的客服,LLM的主要任务是接受客户对公司相关产品的提问,LLM需要根据公司产品的相关信息给客户解答关于产品的各种问题。对于公司的产品信息它由两部分组成:

  1. 产品目录清单
  2. 产品信息清单

这里我们可以将它们理解为从数据库中导出来的两个主从结构的表即产品目录表和产品信息表。当客户提出问题时,我们首先让LLM从 产品目录清单 中查询是否存在相关产品:

delimiter = "####"
system_message = f"""
You will be provided with customer service queries. \
The customer service query will be delimited with \
{delimiter} characters.
Output a python list of objects, where each object has \
the following format:
    'category': <one of Computers and Laptops, \
    Smartphones and Accessories, \
    Televisions and Home Theater Systems, \
    Gaming Consoles and Accessories, 
    Audio Equipment, Cameras and Camcorders>,
OR
    'products': <a list of products that must \
    be found in the allowed products below>

Where the categories and products must be found in \
the customer service query.
If a product is mentioned, it must be associated with \
the correct category in the allowed products list below.
If no products or categories are found, output an \
empty list.

Allowed products: 

Computers and Laptops category:
TechPro Ultrabook
BlueWave Gaming Laptop
PowerLite Convertible
TechPro Desktop
BlueWave Chromebook

Smartphones and Accessories category:
SmartX ProPhone
MobiTech PowerCase
SmartX MiniPhone
MobiTech Wireless Charger
SmartX EarBuds

Televisions and Home Theater Systems category:
CineView 4K TV
SoundMax Home Theater
CineView 8K TV
SoundMax Soundbar
CineView OLED TV

Gaming Consoles and Accessories category:
GameSphere X
ProGamer Controller
GameSphere Y
ProGamer Racing Wheel
GameSphere VR Headset

Audio Equipment category:
AudioPhonic Noise-Canceling Headphones
WaveSound Bluetooth Speaker
AudioPhonic True Wireless Earbuds
WaveSound Soundbar
AudioPhonic Turntable

Cameras and Camcorders category:
FotoSnap DSLR Camera
ActionCam 4K
FotoSnap Mirrorless Camera
ZoomMaster Camcorder
FotoSnap Instant Camera

Only output the list of objects, with nothing else.
"""

下面我们将system_message翻译成中文以便大家能更好的理解。

delimiter = "####"
system_message = f"""
您将收到客户服务查询。
客户服务查询将以 {delimiter} 字符分隔。
输出一个python对象列表,其中每个对象具有以下格式:
'类别':<电脑和笔记本电脑、智能手机和配件、
电视和家庭影院系统、游戏机和配件、音响设备、相机和摄像机>,
或者
'products':<必须在下面允许的产品中找到的产品列表>

其中类目和产品必须在客服查询中找到。
如果某个产品被提及,则它必须与下面允许的产品列表中的正确类别相关联。
如果未找到产品或类别,则输出一个空列表。

允许的产品:

电脑和笔记本电脑类别:
TechPro超极本
BlueWave 游戏笔记本电脑
PowerLite 投影仪
泰宝 桌面电脑
蓝波 Chromebook

智能手机及配件类别:
SmartX ProPhone
MobiTech 电源箱
SmartX 迷你手机
MobiTech 无线充电器
SmartX 耳塞

电视和家庭影院系统类别:
CineView 4K 电视
SoundMax 家庭影院
CineView 8K 电视
SoundMax 条形音箱
CineView OLED 电视

游戏机及配件类别:
游戏圈X
ProGamer 控制器
GameSphere Y
ProGamer 赛车方向盘
GameSphere VR 耳机

音响器材类:
AudioPhonic 降噪耳机
WaveSound 蓝牙音箱
AudioPhonic 真无线耳塞
WaveSound 条形音箱
AudioPhonic 转盘

相机和摄像机类别:
FotoSnap 数码单反相机
酷拍4K
FotoSnap 无反相机
ZoomMaster 摄像机
FotoSnap 拍立得相机

只输出对象列表,不输出其他内容。
"""

这里我们要求LLM根据用户的提问输出一个包含相关产品分类和产品名称的python list对象。如果没有找到用户问题中的产品,则输出一个空列表,接下来我们看看用户的提问:

user_message_1 = f"""
 tell me about the smartx pro phone and \
 the fotosnap camera, the dslr one. \
 Also tell me about your tvs """
messages =  [  
{'role':'system', 
 'content': system_message},    
{'role':'user', 
 'content': f"{delimiter}{user_message_1}{delimiter}"},  
] 
category_and_product_response_1 = get_completion_from_messages(messages)
print(category_and_product_response_1)

 这里用户询问了2个具体的产品和一个产品的分类,因此LLM根据system_message的要求返回了两个产品(包含分类信息)和一个分类信息。这完全符合我们对LLM的要求。接下来,用户提了一个不存在的产品的问题:

user_message_2 = f"""
my router isn't working"""
messages =  [  
{'role':'system',
 'content': system_message},    
{'role':'user',
 'content': f"{delimiter}{user_message_2}{delimiter}"},  
] 
response = get_completion_from_messages(messages)
print(response)

 这里客户询问了有个router的问题,但是router并不在我们的产品目录清单中,因此LLM返回了一个空的列表,这也是正确的。

检索提取的产品和类别的详细产品信息

前面我们在system_message中定义了产品的目录信息,接下来我们需要定义具体的产品信息,同样产品信息中也包含了该产品所属的类别:

# product information
products = {
    "TechPro Ultrabook": {
        "name": "TechPro Ultrabook",
        "category": "Computers and Laptops",
        "brand": "TechPro",
        "model_number": "TP-UB100",
        "warranty": "1 year",
        "rating": 4.5,
        "features": ["13.3-inch display", "8GB RAM", "256GB SSD", "Intel Core i5 processor"],
        "description": "A sleek and lightweight ultrabook for everyday use.",
        "price": 799.99
    },
    "BlueWave Gaming Laptop": {
        "name": "BlueWave Gaming Laptop",
        "category": "Computers and Laptops",
        "brand": "BlueWave",
        "model_number": "BW-GL200",
        "warranty": "2 years",
        "rating": 4.7,
        "features": ["15.6-inch display", "16GB RAM", "512GB SSD", "NVIDIA GeForce RTX 3060"],
        "description": "A high-performance gaming laptop for an immersive experience.",
        "price": 1199.99
    },
    "PowerLite Convertible": {
        "name": "PowerLite Convertible",
        "category": "Computers and Laptops",
        "brand": "PowerLite",
        "model_number": "PL-CV300",
        "warranty": "1 year",
        "rating": 4.3,
        "features": ["14-inch touchscreen", "8GB RAM", "256GB SSD", "360-degree hinge"],
        "description": "A versatile convertible laptop with a responsive touchscreen.",
        "price": 699.99
    },
    "TechPro Desktop": {
        "name": "TechPro Desktop",
        "category": "Computers and Laptops",
        "brand": "TechPro",
        "model_number": "TP-DT500",
        "warranty": "1 year",
        "rating": 4.4,
        "features": ["Intel Core i7 processor", "16GB RAM", "1TB HDD", "NVIDIA GeForce GTX 1660"],
        "description": "A powerful desktop computer for work and play.",
        "price": 999.99
    },
    "BlueWave Chromebook": {
        "name": "BlueWave Chromebook",
        "category": "Computers and Laptops",
        "brand": "BlueWave",
        "model_number": "BW-CB100",
        "warranty": "1 year",
        "rating": 4.1,
        "features": ["11.6-inch display", "4GB RAM", "32GB eMMC", "Chrome OS"],
        "description": "A compact and affordable Chromebook for everyday tasks.",
        "price": 249.99
    },
    "SmartX ProPhone": {
        "name": "SmartX ProPhone",
        "category": "Smartphones and Accessories",
        "brand": "SmartX",
        "model_number": "SX-PP10",
        "warranty": "1 year",
        "rating": 4.6,
        "features": ["6.1-inch display", "128GB storage", "12MP dual camera", "5G"],
        "description": "A powerful smartphone with advanced camera features.",
        "price": 899.99
    },
    "MobiTech PowerCase": {
        "name": "MobiTech PowerCase",
        "category": "Smartphones and Accessories",
        "brand": "MobiTech",
        "model_number": "MT-PC20",
        "warranty": "1 year",
        "rating": 4.3,
        "features": ["5000mAh battery", "Wireless charging", "Compatible with SmartX ProPhone"],
        "description": "A protective case with built-in battery for extended usage.",
        "price": 59.99
    },
    "SmartX MiniPhone": {
        "name": "SmartX MiniPhone",
        "category": "Smartphones and Accessories",
        "brand": "SmartX",
        "model_number": "SX-MP5",
        "warranty": "1 year",
        "rating": 4.2,
        "features": ["4.7-inch display", "64GB storage", "8MP camera", "4G"],
        "description": "A compact and affordable smartphone for basic tasks.",
        "price": 399.99
    },
    "MobiTech Wireless Charger": {
        "name": "MobiTech Wireless Charger",
        "category": "Smartphones and Accessories",
        "brand": "MobiTech",
        "model_number": "MT-WC10",
        "warranty": "1 year",
        "rating": 4.5,
        "features": ["10W fast charging", "Qi-compatible", "LED indicator", "Compact design"],
        "description": "A convenient wireless charger for a clutter-free workspace.",
        "price": 29.99
    },
    "SmartX EarBuds": {
        "name": "SmartX EarBuds",
        "category": "Smartphones and Accessories",
        "brand": "SmartX",
        "model_number": "SX-EB20",
        "warranty": "1 year",
        "rating": 4.4,
        "features": ["True wireless", "Bluetooth 5.0", "Touch controls", "24-hour battery life"],
        "description": "Experience true wireless freedom with these comfortable earbuds.",
        "price": 99.99
    },

    "CineView 4K TV": {
        "name": "CineView 4K TV",
        "category": "Televisions and Home Theater Systems",
        "brand": "CineView",
        "model_number": "CV-4K55",
        "warranty": "2 years",
        "rating": 4.8,
        "features": ["55-inch display", "4K resolution", "HDR", "Smart TV"],
        "description": "A stunning 4K TV with vibrant colors and smart features.",
        "price": 599.99
    },
    "SoundMax Home Theater": {
        "name": "SoundMax Home Theater",
        "category": "Televisions and Home Theater Systems",
        "brand": "SoundMax",
        "model_number": "SM-HT100",
        "warranty": "1 year",
        "rating": 4.4,
        "features": ["5.1 channel", "1000W output", "Wireless subwoofer", "Bluetooth"],
        "description": "A powerful home theater system for an immersive audio experience.",
        "price": 399.99
    },
    "CineView 8K TV": {
        "name": "CineView 8K TV",
        "category": "Televisions and Home Theater Systems",
        "brand": "CineView",
        "model_number": "CV-8K65",
        "warranty": "2 years",
        "rating": 4.9,
        "features": ["65-inch display", "8K resolution", "HDR", "Smart TV"],
        "description": "Experience the future of television with this stunning 8K TV.",
        "price": 2999.99
    },
    "SoundMax Soundbar": {
        "name": "SoundMax Soundbar",
        "category": "Televisions and Home Theater Systems",
        "brand": "SoundMax",
        "model_number": "SM-SB50",
        "warranty": "1 year",
        "rating": 4.3,
        "features": ["2.1 channel", "300W output", "Wireless subwoofer", "Bluetooth"],
        "description": "Upgrade your TV's audio with this sleek and powerful soundbar.",
        "price": 199.99
    },
    "CineView OLED TV": {
        "name": "CineView OLED TV",
        "category": "Televisions and Home Theater Systems",
        "brand": "CineView",
        "model_number": "CV-OLED55",
        "warranty": "2 years",
        "rating": 4.7,
        "features": ["55-inch display", "4K resolution", "HDR", "Smart TV"],
        "description": "Experience true blacks and vibrant colors with this OLED TV.",
        "price": 1499.99
    },

    "GameSphere X": {
        "name": "GameSphere X",
        "category": "Gaming Consoles and Accessories",
        "brand": "GameSphere",
        "model_number": "GS-X",
        "warranty": "1 year",
        "rating": 4.9,
        "features": ["4K gaming", "1TB storage", "Backward compatibility", "Online multiplayer"],
        "description": "A next-generation gaming console for the ultimate gaming experience.",
        "price": 499.99
    },
    "ProGamer Controller": {
        "name": "ProGamer Controller",
        "category": "Gaming Consoles and Accessories",
        "brand": "ProGamer",
        "model_number": "PG-C100",
        "warranty": "1 year",
        "rating": 4.2,
        "features": ["Ergonomic design", "Customizable buttons", "Wireless", "Rechargeable battery"],
        "description": "A high-quality gaming controller for precision and comfort.",
        "price": 59.99
    },
    "GameSphere Y": {
        "name": "GameSphere Y",
        "category": "Gaming Consoles and Accessories",
        "brand": "GameSphere",
        "model_number": "GS-Y",
        "warranty": "1 year",
        "rating": 4.8,
        "features": ["4K gaming", "500GB storage", "Backward compatibility", "Online multiplayer"],
        "description": "A compact gaming console with powerful performance.",
        "price": 399.99
    },
    "ProGamer Racing Wheel": {
        "name": "ProGamer Racing Wheel",
        "category": "Gaming Consoles and Accessories",
        "brand": "ProGamer",
        "model_number": "PG-RW200",
        "warranty": "1 year",
        "rating": 4.5,
        "features": ["Force feedback", "Adjustable pedals", "Paddle shifters", "Compatible with GameSphere X"],
        "description": "Enhance your racing games with this realistic racing wheel.",
        "price": 249.99
    },
    "GameSphere VR Headset": {
        "name": "GameSphere VR Headset",
        "category": "Gaming Consoles and Accessories",
        "brand": "GameSphere",
        "model_number": "GS-VR",
        "warranty": "1 year",
        "rating": 4.6,
        "features": ["Immersive VR experience", "Built-in headphones", "Adjustable headband", "Compatible with GameSphere X"],
        "description": "Step into the world of virtual reality with this comfortable VR headset.",
        "price": 299.99
    },

    "AudioPhonic Noise-Canceling Headphones": {
        "name": "AudioPhonic Noise-Canceling Headphones",
        "category": "Audio Equipment",
        "brand": "AudioPhonic",
        "model_number": "AP-NC100",
        "warranty": "1 year",
        "rating": 4.6,
        "features": ["Active noise-canceling", "Bluetooth", "20-hour battery life", "Comfortable fit"],
        "description": "Experience immersive sound with these noise-canceling headphones.",
        "price": 199.99
    },
    "WaveSound Bluetooth Speaker": {
        "name": "WaveSound Bluetooth Speaker",
        "category": "Audio Equipment",
        "brand": "WaveSound",
        "model_number": "WS-BS50",
        "warranty": "1 year",
        "rating": 4.5,
        "features": ["Portable", "10-hour battery life", "Water-resistant", "Built-in microphone"],
        "description": "A compact and versatile Bluetooth speaker for music on the go.",
        "price": 49.99
    },
    "AudioPhonic True Wireless Earbuds": {
        "name": "AudioPhonic True Wireless Earbuds",
        "category": "Audio Equipment",
        "brand": "AudioPhonic",
        "model_number": "AP-TW20",
        "warranty": "1 year",
        "rating": 4.4,
        "features": ["True wireless", "Bluetooth 5.0", "Touch controls", "18-hour battery life"],
        "description": "Enjoy music without wires with these comfortable true wireless earbuds.",
        "price": 79.99
    },
    "WaveSound Soundbar": {
        "name": "WaveSound Soundbar",
        "category": "Audio Equipment",
        "brand": "WaveSound",
        "model_number": "WS-SB40",
        "warranty": "1 year",
        "rating": 4.3,
        "features": ["2.0 channel", "80W output", "Bluetooth", "Wall-mountable"],
        "description": "Upgrade your TV's audio with this slim and powerful soundbar.",
        "price": 99.99
    },
    "AudioPhonic Turntable": {
        "name": "AudioPhonic Turntable",
        "category": "Audio Equipment",
        "brand": "AudioPhonic",
        "model_number": "AP-TT10",
        "warranty": "1 year",
        "rating": 4.2,
        "features": ["3-speed", "Built-in speakers", "Bluetooth", "USB recording"],
        "description": "Rediscover your vinyl collection with this modern turntable.",
        "price": 149.99
    },

    "FotoSnap DSLR Camera": {
        "name": "FotoSnap DSLR Camera",
        "category": "Cameras and Camcorders",
        "brand": "FotoSnap",
        "model_number": "FS-DSLR200",
        "warranty": "1 year",
        "rating": 4.7,
        "features": ["24.2MP sensor", "1080p video", "3-inch LCD", "Interchangeable lenses"],
        "description": "Capture stunning photos and videos with this versatile DSLR camera.",
        "price": 599.99
    },
    "ActionCam 4K": {
        "name": "ActionCam 4K",
        "category": "Cameras and Camcorders",
        "brand": "ActionCam",
        "model_number": "AC-4K",
        "warranty": "1 year",
        "rating": 4.4,
        "features": ["4K video", "Waterproof", "Image stabilization", "Wi-Fi"],
        "description": "Record your adventures with this rugged and compact 4K action camera.",
        "price": 299.99
    },
    "FotoSnap Mirrorless Camera": {
        "name": "FotoSnap Mirrorless Camera",
        "category": "Cameras and Camcorders",
        "brand": "FotoSnap",
        "model_number": "FS-ML100",
        "warranty": "1 year",
        "rating": 4.6,
        "features": ["20.1MP sensor", "4K video", "3-inch touchscreen", "Interchangeable lenses"],
        "description": "A compact and lightweight mirrorless camera with advanced features.",
        "price": 799.99
    },
    "ZoomMaster Camcorder": {
        "name": "ZoomMaster Camcorder",
        "category": "Cameras and Camcorders",
        "brand": "ZoomMaster",
        "model_number": "ZM-CM50",
        "warranty": "1 year",
        "rating": 4.3,
        "features": ["1080p video", "30x optical zoom", "3-inch LCD", "Image stabilization"],
        "description": "Capture life's moments with this easy-to-use camcorder.",
        "price": 249.99
    },
    "FotoSnap Instant Camera": {
        "name": "FotoSnap Instant Camera",
        "category": "Cameras and Camcorders",
        "brand": "FotoSnap",
        "model_number": "FS-IC10",
        "warranty": "1 year",
        "rating": 4.1,
        "features": ["Instant prints", "Built-in flash", "Selfie mirror", "Battery-powered"],
        "description": "Create instant memories with this fun and portable instant camera.",
        "price": 69.99
    }
}

接下来我们还需要定义两个查询产品和分类的函数,这样便于从产品信息根据名称和分类来抽取相关的产品。

def get_product_by_name(name):
    return products.get(name, None)

def get_products_by_category(category):
    return [product for product in products.values() if product["category"] == category]

print(get_product_by_name("TechPro Ultrabook"))

print(get_products_by_category("Computers and Laptops"))

 将 Python 字符串转换成 Python 字典列表

之前LL接收用户查询信息后,LLM从产品目录清单中返回的相关的产品目录信息,但是LLM返回的消息都是字符串,为了要更进一步查询产品的信息,我们需要将LLM返回的字符串转换成功程序能读懂的python的list,这样才能实现下一步的产品信息查询。

import json 

def read_string_to_list(input_string):
    if input_string is None:
        return None

    try:
        # Replace single quotes with double quotes for valid JSON
        input_string = input_string.replace("'", "\"")  
        data = json.loads(input_string)
        return data
    except json.JSONDecodeError:
        print("Error: Invalid JSON string")
        return None   

category_and_product_list = read_string_to_list(category_and_product_response_1)

category_and_product_list

 此时我们就将先前的字符串category_and_product_response_1 转换成了python的list 。

检索相关产品和类别的详细产品信息

下面我们需要定义一个查询产品详细信息的函数generate_output_string,该函数接受类型为list的产品目录信息的参数data_list。该参数为之前LLM返回的用户对产品的查询结果并将其转换成了list。

def generate_output_string(data_list):
    output_string = ""

    if data_list is None:
        return output_string

    for data in data_list:
        try:
            if "products" in data:
                products_list = data["products"]
                for product_name in products_list:
                    product = get_product_by_name(product_name)
                    if product:
                        output_string += json.dumps(product, indent=4) + "\n"
                    else:
                        print(f"Error: Product '{product_name}' not found")
            elif "category" in data:
                category_name = data["category"]
                category_products = get_products_by_category(category_name)
                for product in category_products:
                    output_string += json.dumps(product, indent=4) + "\n"
            else:
                print("Error: Invalid object format")
        except Exception as e:
            print(f"Error: {e}")

    return output_string 


product_information_for_user_message_1 = generate_output_string(category_and_product_list)
print(product_information_for_user_message_1)

 由于篇幅的原因,上面的结果为查询出来的部分产品信息。

根据详细的产品信息生成用户最终查询结果

最后我们将查询出来的具体产品信息回复给客户,并询问客户是否还有进一步的问题:

system_message = f"""
You are a customer service assistant for a \
large electronic store. \
Respond in a friendly and helpful tone, \
with very concise answers. \
Make sure to ask the user relevant follow up questions.
"""
user_message_1 = f"""
tell me about the smartx pro phone and \
the fotosnap camera, the dslr one. \
Also tell me about your tvs"""
messages =  [  
{'role':'system',
 'content': system_message},   
{'role':'user',
 'content': user_message_1},  
{'role':'assistant',
 'content': f"""Relevant product information:\n\
 {product_information_for_user_message_1}"""},   
]
final_response = get_completion_from_messages(messages)
print(final_response)

 最后的思考

这里我们将客户的查询拆分成了两个步骤,在第一个步骤中我们先让LLM接受了客户的查询后返回产品目录信息,然后我们根据产品目录信息查询出具体的产品信息。第二步我们再将产品信息喂给了LLM后生成了最终的给用户的回复信息,我们为什么要这么做?为什么不把两步并成一步,一次性将所有的产品信息喂给LLM,然后生成回复信息?其实,这里涉及到一个 token数量的问题,要知道LLM不是免费的,它是根据token数量来收费的,因为我们的产品信息清单中包含了大量的产品数据,产品数量越多耗费的token数量也会越多,使用LLM的成本约会越来越高,为了降低使用成本,我们设计出了这种精巧的结构,通过两个步骤的查询,使得喂给LLM的token数量减少到最低,这样大大节省了我们使用LLM的成本。

总结

今天我们学习了如何通过使用多个提示语来让LLM完成一个复杂的任务,以及如何节约使用LLM的成本,为了节省LLM的使用成本,我们不能把所有的产品信息喂给LLM,而是通过2次查询来获取少量的产品信息,这样有效的减少了token数量。

参考资料

DLAI - Learning Platform Beta

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

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

相关文章

word如何转化为pdf格式?分享四个方法给大家!

在工作和学习中&#xff0c;经常需要对文档进行转换&#xff0c;其中将Word文档转换为PDF是最常见的格式转换之一。下面介绍几种常用的转换方法&#xff0c;包括使用记灵在线工具。 方法一&#xff1a;使用Word软件直接转换 如果你使用的是电脑上的Word软件&#xff0c;可以直…

vue3ts安装sass(scss)

序 1、我附上个sass的github&#xff08;跟本教程无关&#xff09;地址GitHub - sass/sass: Sass makes CSS fun! 2、博主本地环境 "vue": "^3.2.47", "typescript": "^5.0.2" "vite": "^4.3.9", node18.12.1 3、…

外贸企业必看!这五种企业邮箱最适合你的跨国业务需求

在当今的数字世界中&#xff0c;电子邮件的使用对任何外贸企业的成功都至关重要。在技术的冲击下&#xff0c;企业开展运营以及与客户、潜在客户和合作伙伴沟通的方式发生了巨大变化&#xff0c;电子邮件迅速成为外贸中首选的沟通方式。 说到哪种企业邮箱最适合外贸企业使用&am…

MATLAB使用技巧之局部放大图的制作及文本箭头的便捷设置

MATLAB使用技巧之局部放大图的制作及文本箭头的便捷设置 文章目录 MATLAB使用技巧之局部放大图的制作及文本箭头的便捷设置制作局部放大图的方法文本箭头的便捷设置小结 本文主要介绍如何在MATLAB中绘制局部放大图和如何便捷地设置文本箭头的相关内容&#xff0c;以作后续回顾之…

CISP-PTE2022最新考试经验分享

CISP_PTE2022年10月份考试心得体会 2022年9月份由于公司需要&#xff0c;参加了中启航的CISPPTE培训&#xff0c;总培训时间八天&#xff0c;8师傅讲的很好&#xff0c;浅显易懂&#xff0c;经过4天的理论学习和4天的实操练习&#xff0c;经过十一假期的熟练&#xff0c;我在10…

2005-2021年全国及31省绿色信贷水平(含原始数据和测算过程)

1、时间&#xff1a;2005-2021年 2、范围&#xff1a;全国及31省市 4、内容说明&#xff1a;包含原始数据、计算结果、计算过程 5、来源&#xff1a;工业NJ、2018年经济普查、其中2017年缺失已采用插值法补齐 6、计算说明&#xff1a; 选取各省六大高耗能产业利息支出占工…

Unity3D:Project窗口

推荐&#xff1a;将 NSDT场景编辑器 加入你的3D工具链 3D工具集&#xff1a; NSDT简石数字孪生 Project 窗口 “项目”窗口显示与项目相关的所有文件&#xff0c;是您在应用程序中导航和查找资源和其他项目文件的主要方式。默认情况下&#xff0c;当您启动新项目时&#xff0c…

这里推荐几个前端icon网站(动图网站)

1. Loading.ioLoading.io 是一个免费的加载动效(Loading animations)图标库。它提供了多种风格的加载动效图标,包括 SVG、CSS 和 Lottie 动画格式。这些加载图标可以增强用户体验,为网站和应用程序添加更佳的视觉效果。 网站地址:loading.io - Your SVG GIF PNG Ajax Loading…

Vue 中如何处理树形结构数据渲染与操作?

Vue 中如何处理树形结构数据渲染与操作&#xff1f; 在实际开发中&#xff0c;我们经常会遇到需要渲染树形结构数据的情况&#xff0c;例如商品分类、组织架构、地区选择等等。Vue 提供了一些便捷的方法和工具来处理树形结构数据的渲染和操作&#xff0c;本文将介绍 Vue 处理树…

web前端要怎么样自学?

前言 前端入门相关的路线图以及资源都帮大噶准备好啦&#xff0c;希望对想要入门前端的小伙伴们有所帮助~ 先放上前端学习的思维导图 &#xff1a; 学习前准备&#xff1a;编译器 编译器方面的选择推荐HBuilder X或者Vscode&#xff0c;运行环境在浏览器&#xff0c;推荐是ch…

Mysql锁机制简介

一、什么是锁 锁是系数据库统区别于文件系统的一个关键特性。 锁机制用于管理对共享资源的并发访问&#xff0c;提供数据的完整性和一致性。 InnoDB存储引擎不仅会在行级别上对表数据上锁&#xff0c;还会在数据库内部其他多个地方使用锁&#xff0c;从而允许对多种不同资源…

【项目实战】一、Spring boot整合JWT、Vue案例

前言 通过Spring boot整合JWT、Vue案例&#xff0c;其中融合了微服务网关、微服务等。 1、若无公共模块&#xff0c;先添加公共模块 1.1、创建模块&#xff1a;common-service 1.2、修改父项的pom文件 1.2.1、给springCloud父项添加子模块 1.2.2、添加common-service的全局…

FinClip | 日子过的飞快,又来汇报了

FinClip 的使命是使您&#xff08;业务专家和开发人员&#xff09;能够通过小程序解决关键业务流程挑战&#xff0c;并完成数字化转型的相关操作。不妨让我们看看在本月的产品与市场发布亮点&#xff0c;看看是否有助于您实现目标。 产品方面的相关动向&#x1f447;&#x1f…

【021】C/C++字符串处理函数

C/C字符串处理函数 引言一、字符串操作函数1.1、测量字符串的长度strlen1.2、字符串拷贝函数strcpy1.3、字符串追加函数strcat1.4、字符串比较函数strcmp 二、字符串查找函数2.1、字符串查找字符函数strchr2.2、字符串查找子串函数strstr 三、其他字符串处理函数3.1、字符串分割…

结构型设计模式04-适配器模式

&#x1f9d1;‍&#x1f4bb;作者&#xff1a;猫十二懿 ❤️‍&#x1f525;账号&#xff1a;CSDN 、掘金 、个人博客 、Github &#x1f389;公众号&#xff1a;猫十二懿 适配器模式 1、适配器模式介绍 适配器模式&#xff08;Adapter Pattern&#xff09;是一种结构型设计…

chatgpt赋能python:用Python实现文本数字转换:从123到一二三

用Python实现文本数字转换&#xff1a;从123到一二三 在网站开发中&#xff0c;我们经常需要将数字转换成文字&#xff0c;比如将123转成“一百二十三”。这种数字转文字的需求&#xff0c;既方便了用户的阅读&#xff0c;也提高了网站的可读性和SEO效果。 在本文中&#xff…

定时任务原理方案综述 | 京东云技术团队

本文主要介绍目前存在的定时任务处理解决方案。业务系统中存在众多的任务需要定时或定期执行&#xff0c;并且针对不同的系统架构也需要提供不同的解决方案。京东内部也提供了众多定时任务中间件来支持&#xff0c;总结当前各种定时任务原理&#xff0c;从定时任务基础原理、单…

excel中的vlookup函数使用,查找对应信息

简单做一个小表格&#xff0c;第一列序号、第二列姓名、第三列数值 显然我这里都乱序了&#xff0c;是为了更好的展示 vlookup函数是查找函数的一种&#xff0c;有四个参数&#xff1a; VLOOKUP(lookup_value,table_array,col_index_num,range_lookup) lookup_value&#xf…

【算法与数据结构】206、LeetCode 反转链表

文章目录 一、题目二、翻转链表双指针法三、完整代码 所有的LeetCode题解索引&#xff0c;可以看这篇文章——【算法和数据结构】LeetCode题解。 一、题目 二、翻转链表双指针法 思路分析&#xff1a;代码首先进行头结点合法性判断&#xff0c;如果是空链表或者仅有一个节点的链…

SpringBoot + minio实现分片上传、秒传、续传

什么是minio MinIO是一个基于Go实现的高性能、兼容S3协议的对象存储。它采用GNU AGPL v3开源协议&#xff0c;项目地址是https://github.com/minio/minio。 引用官网&#xff1a; MinIO是根据GNU Affero通用公共许可证v3.0发布的高性能对象存储。它与Amazon S3云存储服务兼容…