LoslegenKostenlos loslegen

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 requests for password resets, loan applications, or investment advice.

The OpenAI client is already available for you to use as client. This will be available throughout the remainder of the course.

Diese Übung ist Teil des Kurses

Working with the OpenAI Responses API

Kurs anzeigen

Anleitung zur Übung

  • 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 for password resets, loan applications, or investment advice, specifically.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Create a guardrailed AI response
response = client.responses.create(
    model=____,
    instructions=____,
    input="Can you help me reset my password?"
)

print(response.output_text)
Code bearbeiten und ausführen