Skip to main content

duetmachines

Send your AI agent's production conversations and business outcomes to Duet Machines, which grades them against your expert's standard, builds tests from them and proves cheaper models on them.

pip install duetmachines

The client posts from a background thread and never raises into your code: if Duet Machines is unreachable, your agent keeps working and the conversation is logged as not sent.

Conversations

from duetmachines import DuetMachines

duet = DuetMachines(api_key=os.environ["DUET_API_KEY"], agent="<agent id from Traffic › Connect>")

convo = duet.conversation(
    ticket.id,                      # your id; posting again replaces the conversation
    user_id=customer.id,            # links outcomes that arrive later
    version="2026.11.1",            # your release, to compare versions
    config={"instructions": SYSTEM_PROMPT, "tools": TOOLS, "model": "gpt-5.4-mini"},
)
convo.customer(user_message)
convo.tool("lookup_order", {"order_id": "A123"}, {"status": "shipped"}, duration_seconds=0.4)
convo.agent(reply, usage={"input_tokens": 812, "output_tokens": 64, "model": "gpt-5.4-mini"})
convo.end()

usage on agent turns prices what each conversation costs, so savings can be projected. config lets graders and tests judge each conversation against the instructions and tools it ran with.

Outcomes

Send business outcomes whenever they happen, from your billing system, CRM or help desk:

duet.outcome("payment_received", id=payment.id, user_id=customer.id, value=149.00, currency="USD")
duet.outcome("ticket_reopened", id=f"reopen-{ticket.id}", conversation=ticket.id)

Declare each outcome name on the agent's Traffic › Outcomes page first.

OpenAI Agents SDK

pip install "duetmachines[openai-agents]"
from agents import add_trace_processor
from duetmachines.openai_agents import DuetMachinesProcessor

add_trace_processor(DuetMachinesProcessor(duet, version="2026.11.1"))

Every agent run is posted as a conversation with no other code.

Docs: https://platform.duetmachines.com/docs

Metadata

Release files for duetmachines 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for duetmachines 0.1.0
File Size Uploaded Provenance Actions
duetmachines-0.1.0.tar.gz 12.5 kB With provenance Details for duetmachines-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for duetmachines 0.1.0
File Interpreter ABI Platform Actions
duetmachines-0.1.0-py3-none-any.whl Python 3 none any Details for duetmachines-0.1.0-py3-none-any.whl

Total release size: 20.6 kB

Release files / duetmachines-0.1.0.tar.gz

Download URL duetmachines-0.1.0.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
bc41ad96cfe788fd7a96749dd418385265bad92bc10b05c3643d904947602149
BLAKE2b-256 checksum
How to use checksums
ad36eccd66e95eb7bb4512f302e100aac231be6db9793ae7b88119a4d7f87f6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / duetmachines-0.1.0-py3-none-any.whl

Download URL duetmachines-0.1.0-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
463b67c5e05f08612dc7264b8331ea02aa4cfccff3ea36f0ee15f06593b9eefd
BLAKE2b-256 checksum
How to use checksums
5db798f740ab14f02e82a94fdb54a932ff66c105377e073c877c793ee48e7a56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Security for duetmachines 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for duetmachines-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page