Define one task
Write one sentence describing the assistant. Example: 'The Campus Helper answers TIU course schedule questions in English.'
All labs · Lab 3 of 5 · 2-3 hours
Build a small assistant with clear instructions, a narrow task, and a demo scenario.
Write one sentence describing the assistant. Example: 'The Campus Helper answers TIU course schedule questions in English.'
Keep it short. State the role, the allowed scope, and what to refuse. Save it to a prompts/system.md file.
# Campus Helper — system instruction
You are Campus Helper for TIU. You only answer questions about course
schedule, room numbers, and registration deadlines. If a question is
outside that scope, reply with: "I only help with course schedule and
registration. Please ask the appropriate office for other topics."
Answers are short — at most two sentences. Move the chat call into a function that takes a user query and returns a string. This is the contract you will reuse from the UI.
from pathlib import Path
SYSTEM = Path("prompts/system.md").read_text()
def ask(user_query: str) -> str:
response = client.chat.completions.create(
model=os.environ["AZURE_OPENAI_DEPLOYMENT"],
messages=[
{"role": "system", "content": SYSTEM},
{"role": "user", "content": user_query},
],
max_tokens=200,
)
return response.choices[0].message.content Confirm the assistant answers an in-scope question and politely refuses an out-of-scope one. Save both transcripts as evidence.
Pick FastAPI + a single HTML page, or Streamlit, or a Jupyter notebook with input(). The UI is not graded heavily — focus on the assistant behavior.
When all three (or more) of these are true, you can mark the lab complete and move on.
Each test exchange costs roughly $0.001-$0.003. Iterate with short prompts; save long prompts for the demo run.
Add a closing line in every response that says 'For official information, contact the registrar's office.' This reduces over-reliance risk.
Hackathon connection
Sample repo — single-agent prototype