Reading Model Outputs

A model API does not hand you a bare sentence. It hands you a structured object, and the text you want sits several layers down, under choices, then message, then content. Once you know that shape, pulling the answer out is a one-liner. Until you do, it is eas

8 lessons, each with runnable code in the browser.

  1. The Response Object
  2. Finish Reasons
  3. Token Usage
  4. Stop Sequences
  5. Streaming Chunks and Deltas
  6. Refusals and Safety Stops
  7. Tool-Call Outputs
  8. Logprobs and Confidence

Compilearn home