AI教程 2025年01月15日
0 收藏 0 点赞 460 浏览 4155 个字
摘要 :

面向开发者的LLM入门课程-处理输入英文版: 英文版 1.思维链提示 delimiter = “####” system_message = f””” Follow these steps to ans……

哈喽!伙伴们,我是小智,你们的AI向导。欢迎来到每日的AI学习时间。今天,我们将一起深入AI的奇妙世界,探索“面向开发者的LLM入门课程-处理输入英文版”,并学会本篇文章中所讲的全部知识点。还是那句话“不必远征未知,只需唤醒你的潜能!”跟着小智的步伐,我们终将学有所成,学以致用,并发现自身的更多可能性。话不多说,现在就让我们开始这场激发潜能的AI学习之旅吧。

面向开发者的LLM入门课程-处理输入英文版

面向开发者的LLM入门课程-处理输入英文版:

英文版

1.思维链提示

delimiter = “####”
system_message = f”””
Follow these steps to answer the customer queries.
The customer query will be delimited with four hashtags,
i.e. {delimiter}.
Step 1:{delimiter} First decide whether the user is
asking a question about a specific product or products.
Product cateogry doesn’t count.
Step 2:{delimiter} If the user is asking about
specific products, identify whether
the products are in the following list.
All available products:
1. Product: 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
2. Product: 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
3. Product: 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
4. Product: 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
5. Product: 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
Step 3:{delimiter} If the message contains products
in the list above, list any assumptions that the
user is making in their
message e.g. that Laptop X is bigger than
Laptop Y, or that Laptop Z has a 2 year warranty.
Step 4:{delimiter}: If the user made any assumptions,
figure out whether the assumption is true based on your
product information.
Step 5:{delimiter}: First, politely correct the
customer’s incorrect assumptions if applicable.
Only mention or reference products in the list of
5 available products, as these are the only 5
products that the store sells.
Answer the customer in a friendly tone.
Use the following format:
Step 1:{delimiter}
Step 2:{delimiter}
Step 3:{delimiter}
Step 4:{delimiter}
Response to user:{delimiter}
Make sure to include {delimiter} to separate every step.
“””

user_message = f”””
by how much is the BlueWave Chromebook more expensive
than the TechPro Desktop”””
messages = [
{‘role’:’system’,
‘content’: system_message},
{‘role’:’user’,
‘content’: f”{delimiter}{user_message}{delimiter}”},
]
response = get_completion_from_messages(messages)
print(response)

Step 1:#### The user is asking about the price difference between the BlueWave
Chromebook and the TechPro Desktop.
Step 2:#### Both the BlueWave Chromebook and the TechPro Desktop are available
products.
Step 3:#### The user assumes that the BlueWave Chromebook is more expensive than
the TechPro Desktop.
Step 4:#### Based on the product information, the price of the BlueWave
Chromebook is $249.99, and the price of the TechPro Desktop is $999.99.
Therefore, the TechPro Desktop is actually more expensive than the BlueWave
Chromebook.
Response to user:#### The BlueWave Chromebook is actually less expensive than the
TechPro Desktop. The BlueWave Chromebook is priced at $249.99, while the TechPro
Desktop is priced at $999.99.

user_message = f”””
do you sell tvs”””
messages = [
{‘role’:’system’,
‘content’: system_message},
{‘role’:’user’,
‘content’: f”{delimiter}{user_message}{delimiter}”},
]
response = get_completion_from_messages(messages)
print(response)

Step 1:#### The user is asking if the store sells TVs, which is a question about
a specific product category.
Step 2:#### TVs are not included in the list of available products. The store
only sells computers and laptops.
Response to user:#### I’m sorry, but we currently do not sell TVs. Our store
specializes in computers and laptops. If you have any questions or need
assistance with our available products, feel free to ask.

2.内心独白

try:
final_response = response.split(delimiter)[-1].strip()
except Exception as e:
final_response = “Sorry, I’m having trouble right now, please try asking
another question.”
print(final_response)

I’m sorry, but we currently do not sell TVs. Our store specializes in computers and laptops. If you have any questions or need assistance with our available products, feel free to ask.

面向开发者的LLM入门课程-处理输入:提取产品和类别
面向开发者的LLM入门课程-处理输入:提取产品和类别:处理输入-链式 链式提示是将复杂任务分解为多个简单Prompt的策略。在本教程中,...

嘿,伙伴们,今天我们的AI探索之旅已经圆满结束。关于“面向开发者的LLM入门课程-处理输入英文版”的内容已经分享给大家了。感谢你们的陪伴,希望这次旅程让你对AI能够更了解、更喜欢。谨记,精准提问是解锁AI潜能的钥匙哦!如果有小伙伴想要了解学习更多的AI知识,请关注我们的官网“AI智研社”,保证让你收获满满呦!

微信扫一扫

支付宝扫一扫

版权: 转载请注明出处:https://www.ai-blog.cn/2566.html

相关推荐
01-15

面向开发者的LLM入门课程-路由链: 路由链 到目前为止,我们已经学习了大语言模型链和顺序链。但是…

215
01-15

面向开发者的LLM入门课程-顺序链: 顺序链 当只有一个输入和一个输出时,简单顺序链(SimpleSequen…

460
01-15

面向开发者的LLM入门课程-简单顺序链: 简单顺序链 顺序链(SequentialChains)是按预定义顺序执行…

460
01-15

面向开发者的LLM入门课程-大语言模型链: 模型链 链(Chains)通常将大语言模型(LLM)与提示(Pro…

460
01-15

面向开发者的LLM入门课程-对话储存英文版提示: 英文版提示 1.对话缓存储存 from langchain.chains…

460
01-15

面向开发者的LLM入门课程-对话摘要缓存储存: 对话摘要缓存储存 对话摘要缓存储存,使用 LLM 对到…

460
01-15

面向开发者的LLM入门课程-对话字符缓存储存: 对话字符缓存储存 使用对话字符缓存记忆,内存将限制…

460
01-15

面向开发者的LLM入门课程-对话缓存窗口储存: 对话缓存窗口储存 随着对话变得越来越长,所需的内存…

460
发表评论
暂无评论

还没有评论呢,快来抢沙发~

助力原创内容

快速提升站内名气成为大牛

扫描二维码

手机访问本站