小智头像图片
AI教程 2025年01月15日
0 收藏 0 点赞 520 浏览 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

相关推荐

AI写作-DeepSeek高阶提示词之自媒体爆款创作篇: 自媒体爆款创作篇 6.10W+标题生成器 “生成20个关…

小智头像图片
520

AI写作-DeepSeek高阶提示词之职场打工人必备篇: 职场打工人必备篇 1.会议纪要秒整理 “将以下会议…

小智头像图片
520

AI绘画-即梦3.0提示词示例之场景化种草型​: 场景化种草型​ 公式:产品+使用场景+氛围渲染+情感化…

小智头像图片
65

AI绘画-即梦3.0提示词示例之限时折扣型​: 限时折扣型​ 公式:产品+价格锚点+紧迫感元素+霓虹灯风…

小智头像图片
520

AI绘画-即梦3.0提示词示例之新品发布型: 新品发布型​ 公式:产品+核心卖点+高级质感+极简排版 ​ …

小智头像图片
520

AI绘画-即梦3.0提示词示例之节日促销型​: 节日促销型​ 公式:产品+节日主题+视觉元素+动态文字+风…

小智头像图片
520

AI绘画-即梦3.0提示词示例之暗黑哥特​: 暗黑哥特​ 提示词: 哥特体、烛光照明、高反差,荆棘十字…

小智头像图片
520

AI绘画-即梦3.0提示词示例之奶油治愈​: 奶油治愈​ 提示词: 奶乎乎、柔焦镜头、低对比,猫咪蜷缩…

小智头像图片
520
发表评论
暂无评论

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

助力原创内容

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

扫描二维码

手机访问本站

二维码
vip弹窗图片