Para desbloquear todo o potencial dos modelos de chat com suporte a visão, adapte os prompts às suas necessidades específicas. As diretrizes a seguir podem ajudá-lo a melhorar a precisão e a eficiência de seus prompts.
Nota
Essas técnicas de engenharia de resposta rápida se aplicam a modelos com visão computacional, incluindo o GPT-4 Turbo com Visão, o GPT-4o e o GPT-4o-mini. Para implantar um modelo com capacidade de visão, consulte Implantar modelos.
Conceitos básicos da redação de um prompt de imagem
-
Especificidade contextual: Adicionar contexto ao cenário fornece ao modelo uma melhor compreensão de uma saída apropriada. Esse nível de especificidade ajuda a se concentrar em aspectos relevantes e evitar detalhes desnecessários.
-
Instruções orientadas para tarefas: concentrar-se em uma tarefa específica ajuda o modelo a desenvolver a saída levando em consideração essa perspectiva.
-
Como lidar com recusas: Quando o modelo indicar que não consegue executar uma tarefa, tente aperfeiçoar o prompt. Prompts mais específicos podem orientar o modelo para uma compreensão mais clara e uma execução melhor da tarefa. Solicite explicações para respostas geradas, coloque a imagem antes do texto para prompts de imagem única e peça ao modelo para descrever a imagem em detalhes primeiro antes de concluir sua tarefa específica.
-
Adicione exemplos: Adicione exemplos que representam o tipo de respostas que você está procurando.
-
Divida as solicitações em partes: Tente dividir solicitações complexas em etapas para criar subobjetivos gerenciáveis.
-
Definir o formato de saída: Mencione claramente o formato desejado para a saída, como markdown, JSON, HTML e assim por diante. Você também pode sugerir uma estrutura específica, comprimento ou atributos específicos sobre a resposta.
Você pode criar prompts do sistema de várias maneiras para adaptar a saída especificamente às suas necessidades. As entradas e saídas de exemplo a seguir mostram como ajustar os seus comandos pode fornecer respostas diferentes. Experimente o modelo por conta própria usando essas imagens e ajustando o prompt do sistema no playground do Microsoft Foundry.
Especificidade contextual
O contexto pode ajudar a melhorar os comentários do modelo. Por exemplo, se você estiver trabalhando em descrições de imagem para um catálogo de produtos, verifique se o prompt reflete isso de forma clara e concisa. Um prompt como "Descrever imagens para um catálogo de produtos de caminhada ao ar livre, com foco no entusiasmo e no profissionalismo" orienta o modelo a gerar respostas precisas e contextualmente ricas.
| Prompt básico |
Saída do modelo |
O que há nessa imagem? |
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. |
| Prompt atualizado |
Saída do modelo |
Descreva imagens para um catálogo de produtos de caminhada ao ar livre, focando no entusiasmo e no profissionalismo. |
"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!" |
Prompts orientados a tarefas
Dar ao modelo uma tarefa específica a seguir é uma maneira de aprimorar a resposta. Neste exemplo, o prompt orienta o modelo a se concentrar em elementos cruciais para avaliações de seguro, o que melhora a precisão e a relevância.
| Prompt básico |
Saída do modelo |
O que há nessa imagem? |
The image shows a silver sedan that was 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's 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. |
| Prompt atualizado |
Saída do modelo |
Analise este vídeo dos danos em um carro para o relatório de um seguro de automóvel, focando em identificar e detalhar danos |
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. |
Tratamento de recusas
Ao receber uma saída de recusa de um modelo, você pode ajustar a entrada para gerar uma resposta mais apropriada. O exemplo a seguir mostra como lidar com uma recusa e avançar.
| Prompt básico |
Saída do modelo |
Planeje esta refeição |
Sorry, I can't provide that information. |
| Prompt de acompanhamento |
Saída do modelo |
| Quais informações você precisa? |
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 (for example, vegetarian, gluten-free, allergies).
The occasion or type of meal being planned (for example, 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. |
Adicionando exemplos
| Prompt básico |
Saída do modelo |
O que é essa raça de cães e qual é o seu peso médio e altura? |
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. |
| Prompt atualizado |
Saída do modelo |
P: O que é essa raça de cães e qual é o seu peso médio &altura?
R: Raça: Pomerânia; peso médio: 3-7 lbs; altura média: 8-14 polegadas
R: Raça: Buldogue Inglês; peso médio: 22,68-24,95 kg; altura média: 35,56-40,64 cm
|
A: Breed: Border Collie; average weight: 30-45 lbs; average height: 18-22 inches |
Decomposição de solicitações
| Prompt básico |
Saída do modelo |
O que há nessa imagem? |
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, peeled 1 9-inch pie crust 3/4 cups sugar 1/2 teaspoon cinnamon A dash of salt 3 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 |
| Prompt atualizado |
Saída do modelo |
Você é um assistente de IA que ajuda a criar listas de compras e instruções para preparar alimentos com base em receitas. Forneça uma lista de ingredientes para comprar e forneça uma lista de instruções para preparar os ingredientes com base no cartão de receita. |
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.
|
| Prompt básico |
Saída do modelo |
Descrever esta imagem |
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. |
| Prompt atualizado |
Saída do modelo |
Você é um assistente de IA que grava listagens detalhadas para propriedades de aluguel de férias. Resumir em três frases os recursos ideais da listagem, com base apenas no que está visível na imagem. Conclua com uma frase sobre por que o cliente deve reservar hoje. |
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! |
Essas diretrizes e exemplos demonstram como os prompts de sistema personalizados podem melhorar significativamente o desempenho de modelos com capacidade de visão, garantindo que as respostas não sejam apenas precisas, mas também perfeitamente adequadas ao contexto específico da tarefa em questão.
Próximas etapas
Agora que você entende as técnicas de engenharia de imagens, experimente-as na prática:
- Abra o playground Microsoft Foundry e implante um modelo com recursos de visão.
- Carregue uma imagem e experimente a especificidade contextual.
- Compare instruções básicas com instruções orientadas a tarefas para observar a diferença na qualidade da saída.
Conteúdo relacionado