Prompt and response
Lesson 2 of 89 in AWS Certified AI Practitioner (AIF-C01) Exam Prep. Free to read, no account needed.
Prompts and responses
A prompt is the text you send to a foundation model, and a response is the text the model sends back. When a ChaiCart customer types a question into the support chat, that question becomes the prompt, and the answer shown on screen is the response.
The chat app sends the prompt to Amazon Bedrock, which passes it to the foundation model and returns what the model writes. Every support answer follows this exchange, so spotting its two halves is the first skill to learn.
Parts of a prompt
A prompt often has up to four parts. The instruction tells the model what job to do. The context gives background facts it needs. The user input is the customer’s actual question. An optional output format request says how the answer should look.
| Part | Job | ChaiCart example |
|---|---|---|
| Instruction | Says what to do | You are ChaiCart support. Answer politely. |
| Context | Supplies facts | Unopened tea can be returned within 7 days of delivery. |
| User input | The customer’s question | I got my ₹450 Assam order 3 days ago. Can I return it? |
| Output format | Shapes the layout | Reply in two short sentences. |
Often the instruction and context stay the same for every customer, and only the user input changes.
Vague vs clear prompts
The same customer question can be sent as a vague prompt or a clear one. A vague prompt leaves the model guessing what you want, so the response tends to be generic. A clear prompt names the job, gives the facts and asks for a specific shape.
Vague prompt: “Tell me about returns.”
Typical response: “Returns are possible under certain conditions. Please check the policy page for details.”
Clear prompt:
Instruction: You are ChaiCart support. Answer in two sentences.
Context: Unopened tea can be returned within 7 days of delivery.
User input: I got my ₹450 Assam order 3 days ago and it is unopened. Can I return it?
Typical response: “Yes, you can return it. Your unopened ₹450 Assam order arrived 3 days ago, which is within the 7-day window.”
The request-response cycle
Each exchange is one request-response cycle: one prompt goes in and one response comes out. Here is the path for a single ChaiCart question.
- The customer types a question in the support chat.
- The app builds a prompt from the instruction, context and question, and sends it to Amazon Bedrock.
- Bedrock passes the prompt to the foundation model.
- The model generates a response, and Bedrock returns it.
- The chat shows the response to the customer.
Amazon Bedrock is the service that accepts the prompt and returns the response from the foundation model.
Missing context in prompts
A model only works with what the prompt contains. If a customer asks “Can I return my tea?” and the policy is missing from the context, the model has no ChaiCart rules to use, so it fills the gap with a guess. The guess can sound confident and still be wrong.
| Prompt version | Typical response |
|---|---|
| No policy in the context | Yes, you can return it within 30 days of delivery. |
| Policy in the context | Only if it is unopened and returned within 7 days of delivery. |
The first answer invents a 30-day rule that ChaiCart never wrote. Putting the real policy in the context keeps the answer tied to ChaiCart’s actual rule.
Predicting the response
Predict first. A customer sends this prompt, and no policy is in the context: “Reply in one word: is my ₹450 order refundable?” What comes back?
The model will usually follow the format and reply with one short word, such as “Yes” or “Likely”. The format is respected, but the word is still a guess, because the model has no ChaiCart facts to check against. A clear prompt needs both a good output format and the right context.
Lessons in AI In One Support Chat
- One customer question answered by a foundation model
- Prompt and response
- Predicting vs generating
- Ai that assists human decisions
- Training data vs new inputs
89 lessons across 10 topics. See the full course