小智头像图片
AI教程 2025年01月15日
0 收藏 0 点赞 549 浏览 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写作-小说大纲在小说中的作用: 大纲主要讲两个部分: 一、大纲有什么用。 二、如何写大纲。 我上…

小智头像图片
143

AI写作-小说大纲的写法和新手常见的问题: 对于大纲的问题,相信大家深深浅浅的都有些了解。今天结…

小智头像图片
549

AI写作-小说的基础提纲结构: 很多的新作者在推出了大量的作品后,却是留给读者的是迷茫,包括作者…

小智头像图片
549

AI写作-小说大纲详解: 案例一:第 1-2 章(通过的大纲分章) 涵柔睁开眼睛,发现正被一个脑满肠肥的…

小智头像图片
549

AI写作-小说大纲格式与内容概述: 什么叫大纲?大纲是一本小说的根本。他为小说提供了精神主旨,主要…

小智头像图片
549

AI写作-如何利用日常生活写小说: 一、举例 1.身边之人是熟人,但是是关系平平的同事, 这种的大家…

小智头像图片
150

AI绘画-Liblibai简易上手教程​:prompt简易技巧: prompt简易技巧​ 认识prompt​ 好说,你就这么理…

小智头像图片
549

AI绘画-Liblibai简易上手教程​:简明操作流程: 简明操作流程​ 文生图​ 1.定主题:你需要生成一张…

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

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

助力原创内容

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

扫描二维码

手机访问本站

二维码
vip弹窗图片