Adding Model Instructions
You're building a customer support AI system for a financial services company. For security and compliance reasons, the AI have clear guardrails to only answer questions about account balances and transaction history. It should politely decline any other requests, such as password resets.
The OpenAI client is already available for you to use as client. This will be available throughout the remainder of the course.
This exercise is part of the course
Working with the OpenAI Responses API
Exercise instructions
- Create a Responses API request to
"gpt-5-mini"that contains clear instructions to only respond to questions about account balances and transaction history, and not other requests such as password resets.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Create a guardrailed AI response
response = client.responses.create(
model=____,
instructions="You are a customer support AI that only answers questions about ____. Politely decline any other requests such as ____.",
input="Can you help me reset my password?"
)
print(response.output_text)