
- How to invoke a model (model calls).
- How to craft prompts that get reliable outputs (prompt engineering).
- How to format, parse, and transform model responses to suit your app.

Use the exact package versions listed to match the code and APIs in this lesson. Version mismatches are a common source of errors.
Never commit API keys to source control. Store secrets in environment variables or a secrets manager. If you use a
.env file during development, load it securely (for example with python-dotenv) and ensure the file is excluded from version control.OPENAI_API_KEY environment variable is set before running the examples:
- If the command prints a value, your key is already set and you can continue.
- If it prints nothing, run the
exportcommand above (or set the key in your environment management tool).
- If you see import errors, confirm you installed the pinned versions.
- If you receive authentication or rate-limit errors from OpenAI, confirm your API key is valid and has sufficient quota.
- Build prompt-driven interactions using LangChain.
- Make model calls and inspect raw outputs.
- Parse, validate, and transform model responses for use in downstream application code.