Vibeleaderboard
← All Intel
Intel / article

Introducing wrapture

Source
simonwillison.net
Date

Context

Wrapture is a Python library for observing or changing selected calls without rewriting the functions themselves. Its documentation says it reaches code by name and installs a wrapper around the real callable. By default the real call runs and is recorded; a developer can instead have the wrapper transform arguments or results, or return a value without running the real code.

Simon Willison's post introducing it quotes two test examples from creator Graham Dumpleton's follow-up: one replaces a payment method's result entirely, while the other runs the real method and changes only the returned . That gives developers a precise way to control the part of an interaction under test while retaining other real behavior.

Terms in this piece · Glossary
  • Function — A named block of instructions that takes inputs, called arguments, and hands back a result, called its return value.
  • Identifier — A value that names exactly one record within a stated system, such as S-003 in the committee's table.
  • Observation — The result the harness returns into the context after executing a tool: contents, a listing, a status or an error.
  • File — A named unit of stored data that keeps its contents while no program is using it.

Get the Brief

A cited digest of what matters for people building with AI, every morning. Unsubscribe anytime. See today’s edition

Read the source simonwillison.net
Recommended reads