Skip to main content

langchain-oneshot

Your LangChain agent can think. This lets it act: send email, make calls, research, buy, build sites. 54 tools plus the lookup tools, each a LangChain BaseTool. It pays per action and spends nothing you did not allow.

Install

pip install langchain-oneshot

Start

from langchain_oneshot import OneShotToolkit
from langchain_openai import ChatOpenAI
from langgraph.prebuilt import create_react_agent

toolkit = OneShotToolkit.from_private_key("0x...")
agent = create_react_agent(ChatOpenAI(model="gpt-4o"), toolkit.get_tools())

agent.invoke({"messages": [("user", "Research the latest AI agent frameworks")]})

get_tools() returns every tool on one client. One tool alone:

from langchain_oneshot import OneShotClient, ResearchTool

ResearchTool(client=OneShotClient(private_key="0x...")).invoke({"topic": "AI agents"})

Access tokens

For code that must not hold the key: a hosted runner, someone else's platform.

import os
from langchain_oneshot import OneShotToolkit

toolkit = OneShotToolkit.from_access_token(os.environ["ONESHOT_ACCESS_TOKEN"])

# Already inside an event loop:
toolkit = await OneShotToolkit.afrom_access_token(os.environ["ONESHOT_ACCESS_TOKEN"])
  • A token spends prepaid credits only. It never signs a payment.
  • Short of credits, it raises InsufficientCreditsError. Top up from a wallet session with OneShotClient.top_up_credits(amount).
  • A token reads budgets but cannot change them, and cannot manage tokens. Hosted setup.

What it does

Area Tools (oneshot_ prefix)
Talk email voice sms inbox_list inbox_get sms_inbox_list sms_inbox_get notifications mark_notification_read
Send from your domains list_domains pause_domain resume_domain
Find people person_find person_profile person_email person_email_status person_dossier person_social_accounts person_articles person_posts person_interests person_followers
Think research solve predict
Web and buying web_search web_read product_find commerce_buy
Physical mail physical_mail_upload physical_mail_preview physical_mail_approve physical_mail_send
Connected systems connections_list, then ledger_* crm_* tax_* shipping_* procurement_* meetings_* field_service_*
Browser browser browser_create_profile browser_list_profiles browser_delete_profile
LinkedIn linkedin_connect linkedin_accounts linkedin_sync linkedin_conversations linkedin_messages linkedin_reply linkedin_message linkedin_invite linkedin_withdraw_invitation linkedin_invitation linkedin_invitations linkedin_view_profile linkedin_react
Build build update_build
Money get_balance budget_status
Lookup One tool per entry in the lookup manifest, built for you

Money

Paid tools pay in USDC on Base mainnet, signed on your machine. A call costs what the quote says, or it does not run. Fund the wallet first. The money rules live in the core client.

Spend budget. Pass budgets={"daily": 50, "per_transaction": 5} to from_private_key. The server enforces it and raises BudgetExceededError past the cap. The agent reads it with oneshot_budget_status; it cannot change it.

Tool notes

  • Phone lookup is off by default. include_phone=True on oneshot_person_find, oneshot_person_profile or oneshot_person_dossier is charged for each person you ask for, found or not; a failed job is refunded.
  • Stored records. A person, company or business record looked up recently may come from OneShot's store of earlier lookups, at the same price; the result says cached and fetched_at. fresh=True on any person, company or business tool asks again and refreshes the copy.
  • Physical mail. Look at the proof and the price, then approve the quote yourself (oneshot_physical_mail_preview, oneshot_physical_mail_approve). Nothing approves it for you. Persist the idempotency key before oneshot_physical_mail_send.

LinkedIn recovery

  • No active account, or one that is connection_deleted or revoked: the human uses oneshot_linkedin_connect and grants access again.
  • reconnect_required: the owning application reconnects the account. Reconnect and revoke are deliberately not agent tools.
  • Never open a new connection on its own after an auth failure or a timeout.
  • A LinkedIn write held for approval has an approval_id. Once it is approved, call the same tool again with the same arguments, including any idempotency_key, plus that approval_id.

Requirements

Python 3.10 or later. pip brings langchain-core, oneshot-python and pydantic.

Discover tools

The toolkit exposes oneshot_discover_tools for free public tool search. Optional query, category and cursor arguments mirror OneShotClient.discover_tools. With no arguments it lists category counts; searches return public MCP names, purposes and required inputs, filtered by the caller's grants.

License

MIT

Metadata

Release files for langchain-oneshot 0.26.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 langchain-oneshot 0.26.0
File Size Uploaded Provenance Actions
langchain_oneshot-0.26.0.tar.gz 178.9 kB Without provenance Details for langchain_oneshot-0.26.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-oneshot 0.26.0
File Interpreter ABI Platform Actions
langchain_oneshot-0.26.0-py3-none-any.whl Python 3 none any Details for langchain_oneshot-0.26.0-py3-none-any.whl

Total release size: 216.6 kB

Release files / langchain_oneshot-0.26.0.tar.gz

Download URL langchain_oneshot-0.26.0.tar.gz
Size 178.9 kB
Tags Source
SHA-256 checksum
How to use checksums
55eb93f0d3999071d52e2114748b958fbd675b02177599c6be1ed52c468c474e
BLAKE2b-256 checksum
How to use checksums
e57b3b6e329e8bc17017aff0ba924f0519390fc95f1d9a11cae443b22096abea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / langchain_oneshot-0.26.0-py3-none-any.whl

Download URL langchain_oneshot-0.26.0-py3-none-any.whl
Size 37.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6da4ccc1928af0d85193a702e1b6ead29b4a162a36b6e5e911911021a7e653a1
BLAKE2b-256 checksum
How to use checksums
8ae9cdcbe72dd710733955106c0396b68b36b68f85e6562d0f2aacf3671937ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for langchain-oneshot 0.26.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.26.0 This release

2 release files No 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