""" Step 8 - Chat with a model. This is the core building block of any AI app: send input, get a response. """ import os from dotenv import load_dotenv from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient load_dotenv() PROJECT_ENDPOINT = os.getenv("AZURE_AI_PROJECT_ENDPOINT", "your_project_endpoint") MODEL_DEPLOYMENT = os.getenv("MODEL_DEPLOYMENT", "gpt-5.1-mini") project = AIProjectClient(endpoint=PROJECT_ENDPOINT, credential=DefaultAzureCredential()) openai = project.get_openai_client() response = openai.responses.create( model=MODEL_DEPLOYMENT, input="What is the size of France in square miles?", ) print(f"Model used: {MODEL_DEPLOYMENT}") print(f"Response output: {response.output_text}")