← All projects

Applied AI · LangChain basics

LangChain · OpenAI · LangSmith

A first LangChain application that sends a prompt to an OpenAI model and traces the run in LangSmith.

01What it is

A prompt, a chain, a trace.

  • 01A chainThe pipe operator joins prompt, model and output into one chain, run with invoke.
  • 02ObservabilityLangSmith shows the input, output and timing of every run.
  • 03Keys kept out of codeAPI keys live in an environment file, outside the Python code.

02How it works

The flow.

  1. Prompt
  2. LangChain chain
  3. OpenAI model
  4. Output
  5. LangSmith trace

03Where it stands

A short assignment.

It is where seeing inside an LLM application started. Retrieval concepts were studied alongside but not used here.