A large language model (LLM) processes natural-language input and generates a response. It can summarize a document, extract information, classify text, answer a question, or generate code. In an application, the model is one component: the application prepares its input and decides what to do with its output. section 1.1 section 1.3
The same model capability supports different application shapes:
- An engine completes a bounded task, such as summarizing text, and stops. section 1.1
- A chatbot keeps conversational context across exchanges. section 1.1
- An agent uses model output to choose tools and carry out multi-step work, adjusting after intermediate results or errors. section 1.1
Make a first model call
A phishing-awareness reminder needs only a short prompt. With an OpenAI client, send a system message describing the assistant and a user message requesting the reminder to chat.completions.create, select gpt-5-nano, then read response.choices[0].message.content. Keep the API key out of the code; expect the wording to vary between runs. section 2.1.2
prompt_input = """Write a concise message to remind
users to be vigilant about phishing attacks."""
response = client.chat.completions.create(
model="gpt-5-nano",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": prompt_input}
]
)
print(response)
The minimal call shows how a model name and role-labeled messages fit into a working request. section 2.1.2
For questions about your own documents, do not rely on the model’s pretrained knowledge alone. Retrieval-Augmented Generation (RAG) finds relevant document chunks and adds them to the question before the model answers. This can reduce unsupported answers, but it does not make the model automatically reliable: missing information can still produce plausible-sounding errors. section 1.4.2
Choose a model for the task rather than assuming the largest is best. Compare accuracy, response speed, and per-token cost; also check whether its context window accommodates the intended input. A support chatbot may favor speed and cost, while legal document analysis may prioritize accuracy. section 1.5


































































