本文内容

  1. 编写图像提示的基础知识
  2. 输入和输出提示示例

要解锁已启用视觉的聊天模型(如 GPT-4 Turbo with Vision 和 GPT-4o)的全部潜力,必须根据特定需求定制提示。 下面是提高提示准确性和效率的一些准则。

编写图像提示的基础知识

  • 上下文具体性:将上下文添加到当前场景可让模型更好地理解适当的输出。 这种具体程度有助于专注于相关方面,并避免多余的细节。
  • 面向任务的提示:专注于具体任务有助于模型在考虑该观点的同时开发输出。
  • 处理拒绝:当模型指示无法执行任务时,优化提示可能是一种有效的解决方案。 提示越具体,模型对任务的理解就越清楚,执行效果也就越好。 请记住以下提示:
    • 请求对生成的答复进行解释,以提高模型输出的透明度
    • 如果使用单图像提示,请将图像放在文本前面
    • 让模型先详细描述图像,然后再根据描述完成具体任务
  • 添加示例:添加表示要寻找的答复类型的示例
  • 分解请求:尝试分解复杂的请求以创建可管理子目标
  • 定义输出格式:明确提及输出所需的格式,例如 Markdown、JSON、HTML 等。此外,还可提供有关答复的具体结构、长度或具体属性方面的建议。

输入和输出提示示例

有多种方法可以制作系统提示,以专门根据需求定制输出。 以下示例输入和输出展示了如何通过调整提示来产生不同的结果。 通过在 Azure AI Foundry 操场中使用这些图像并调整系统提示来自行试用模型。

上下文具体性

上下文可以帮助改进来自模型的反馈。 例如,如果你正在处理产品目录的图像描述,请确保提示以清晰简洁的方式反映这一点。 像“描述户外远足产品目录的图像,并侧重于热情和专业精神”这样的提示会指导模型生成准确且上下文丰富的答复。展开表

基本提示模型输出
 此图像中有什么?The image shows a camping setup in a forest area. There is a yellow tent, two folding camping chairs—one red and one blue—and a portable camping table. The surrounding area is densely populated with trees, indicating that the campsite is in a wooded region.

展开表

更新后的提示模型输出
 描述户外远足产品目录的图像,并侧重于热情和专业精神。"Embark on your next outdoor adventure with our premium hiking and camping essentials! Featured here is our vibrant, spacious tent, designed to be your home away from home amidst the serenity of nature. Crafted with top-notch materials, it promises durability and comfort in any weather. Complementing the tent are our ultra-comfortable, lightweight folding chairs, available in eye-catching red and serene blue, perfect for those moments of relaxation after a day of exploration. Don't forget our sturdy, portable table, ideal for a delightful outdoor meal or a game of cards under the stars. Elevate your camping experience with our reliable products, where quality meets the great outdoors!"

任务导向的提示

为模型指定要遵循的具体任务是增强答复的一种方法。 在此示例中,此提示引导模型专注于对保险评估至关重要的元素,从而提高准确性和相关性。展开表

基本提示模型输出
 此图像中有什么?The image shows a silver sedan that has been in an accident. The front end of the car is damaged, with the hood crumpled, and the bumper partially detached. The car is resting against a utility pole on the sidewalk, and there is visible smoke coming from the engine area, indicating a recent crash. The setting appears to be a residential street, as indicated by the presence of houses in the background, a neatly trimmed hedge, and a sidewalk.

展开表

更新后的提示模型输出
 分析这辆车损坏视频以获取汽车保险报告,重点是查明并详细说明损坏情况In the image provided, we observe a silver sedan that has sustained significant front-end damage. The vehicle's hood is notably crumpled, and the front bumper has suffered substantial deformation, partially detaching from the chassis. The right headlamp assembly appears to be damaged or dislodged. There is also visible damage to the front grille area. The car is in contact with a utility pole, suggesting a frontal collision with the pole at a relatively low or moderate speed. Smoke is emanating from the engine compartment, suggesting potential mechanical or electrical damage that may need further inspection for a comprehensive assessment. The airbags do not appear to be deployed in this image. The vehicle will require a detailed inspection to evaluate the full extent of structural and mechanical damage for a complete insurance report.

处理拒绝

当你收到模型的拒绝输出时,可以通过多种方法调整输入以生成更合适的答复。 下面的示例演示了如何处理拒绝和进展。展开表

基本提示模型输出
 安排这顿饭Sorry, I can't provide that information.

展开表

跟进提示模型输出
你需要什么信息?I apologize for the confusion earlier. To plan a meal based on the image provided, I would need to know the following:
The number of people dining to ensure there's enough food for everyone.
Any dietary restrictions or preferences to accommodate (e.g., vegetarian, gluten-free, allergies).
The occasion or type of meal being planned (e.g., casual lunch, dinner party).
Desired balance of the meal in terms of food groups and nutrition.
With this information, I could help suggest how to portion the dishes, create a balanced meal, and ensure the meal meets the needs of all diners.

添加示例

展开表

基本提示模型输出
 这只狗是什么品种?它的平均体重和身高是多少?The dog in the image appears to be a Border Collie. Border Collies are known for their intelligence, agility, and herding abilities.The average weight for a Border Collie is typically around 30-45 pounds (14-20 kilograms). As for height, Border Collies generally stand about 18-22 inches (46-56 centimeters) tall at the shoulder. These figures can vary based on the individual dog's genetics, diet, and level of activity. Border Collies are medium-sized dogs with a well-proportioned body and a high level of energy.

展开表

更新后的提示模型输出
问:这只狗是什么品种?它的平均体重和身高是多少? 
答:品种:博美犬;平均体重:3-7 磅;平均身高:8-14 英寸
 品种:英国斗牛犬;平均体重:50-55 磅;平均身高:14-16 英寸
A: Breed: Border Collie; average weight: 30-45 lbs; average height: 18-22 inches

分解请求

展开表

基本提示模型输出
 此图像中有什么?The image contains a recipe card titled Grandma's Apple Crumb Pie. It is noted as a Thanksgiving tradition. The ingredients listed are:
5-7 apples, peeled1 9-inch pie crust3/4 cups sugar1/2 teaspoon cinnamonA dash of salt3 tablespoons butter
Please note that the measurements for sugar, flour, and butter are not fully visible in the image. If needed, the standard measures for a crumb topping typically involve a combination of sugar, flour, and butter mixed together until crumbly

展开表

更新后的提示模型输出
 你是一个 AI 助手,可以帮助创建购物清单和根据食谱准备食物的说明。 请提供要购买的原料清单,然后提供根据食谱卡准备原料的说明清单。Sure, here's a shopping list based on the recipe card:
Shopping List:
5-7 apples (suitable for baking, such as Granny Smith or Honeycrisp)1 ready-made pie crust (9-inch)Sugar (ensure you have enough for 1/2 cup)All-purpose flour (ensure you have enough for 3/4 cup)Ground cinnamonSaltButter (ensure you have enough for 3 tablespoons)
Prepping Instructions:
Peel the apples: Using a vegetable peeler or a paring knife, remove the skin from 5 to 7 apples.Core and slice the apples: Cut the apples into quarters, remove the cores, and then slice the apple quarters into thin slices or chunks, depending on your preference for pie texture.Measure the ingredients: Measure out 3/4 cups of sugar, 1/2 teaspoon of cinnamon, a dash of salt (about 1/8 teaspoon), and 3 tablespoons of butter.Prepare the butter: Cut the butter into small pieces to be ready to use in the recipe. It's often easier to incorporate if it's cold, so keep it refrigerated until it's neededPreheat your oven according to the pie recipe's instructions so it's ready for baking once your pie is assembled.Remember to follow any additional preparation or baking instructions provided in the full recipe for your apple crumb pie.

定义输出格式

展开表

基本提示模型输出
 描述此图像The image shows a luxurious white villa with a traditional thatched roof on one section and a clear blue swimming pool in the foreground. There are sun loungers lined up along the poolside, inviting relaxation. The architecture includes elegant archways, a balcony with wooden railings, and large windows and doors that suggest a bright and airy interior. The villa is surrounded by lush tropical vegetation, including tall palm trees, which adds to the serene and exotic ambiance of the setting.

展开表

更新后的提示模型输出
 你是一个 AI 助手,可以帮助编写度假租赁房产的详细列表。 请仅根据图像中可见的内容,用三句话总结列表的最佳特征。 用一句话来说明为什么客户应该今天预订。This idyllic villa showcases an inviting private pool with steps for easy access, framed by a beautifully tiled sun deck and comfortable loungers ideal for soaking up the sun or enjoying a good book under the shade of tropical palms. Architectural charm is evident in the villa's design, featuring elegant archways, a thatched-roof gazebo, and balconies that promise serene views and a perfect spot to savor your morning or evening beverages. The lush greenery surrounding the property not only provides privacy but also enhances the sense of an exclusive paradise retreat. Don't miss the opportunity to secure this perfect blend of luxury and tranquility – book today for a tropical escape like no other!

这些指南和示例演示了定制的系统提示如何显著增强已启用视觉的模型的性能,从而确保响应不仅准确,而且完全适合当前任务的特定上下文。

Categorized in:

AI,

Last Update: 12 3 月, 2025

Tagged in: