Skip to content

nullrunio/nullrun-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

nullrun-examples

Working examples for the nullrun Python SDK.

Each example is a self-contained, runnable file. The intent is to show the smallest possible change to add enforcement to a common agent framework.

Prerequisites

pip install nullrun
export NULLRUN_API_KEY=nr_live_...

Get an API key from the NullRun dashboard.

Auto-instrumentation

nullrun.init(api_key=...) patches the underlying HTTP transport and any imported agent framework (openai, openai-agents, langgraph, autogen, …) automatically. You get cost tracking without changing your call sites; @protect is the gate layer (budget / kill / pause) that runs before the call.

For frameworks that ship an extra, you can install with the matching optional dependency (nullrun[langgraph], nullrun[agents], etc.).

Examples

File Framework What it shows
raw_openai_basic.py raw OpenAI @protect on a single LLM call
openai_agents_basic.py OpenAI Agents SDK @protect on a multi-step agent run
langgraph_basic.py LangGraph Auto-instrumented StateGraph
cost_cap_demo.py any Hard budget cap that halts the agent

Running

export NULLRUN_API_KEY=nr_live_...
python examples/raw_openai_basic.py

All examples are read-only — they do not modify org state, policies, or keys on your account. They do emit track events to the gateway (auto-instrumented HTTP traffic from init()), so a cost_attribution or examples tag in the dashboard will pick them up.

Contributing

PRs welcome. Keep each example under 80 lines. No external state beyond the NullRun API key.

About

No description, website, or topics provided.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors