Skip to main content

NeuForge Pay for LangChain (neuforge-langchain)

A LangChain callback handler that natively implements the Bounded Overshoot x402 token metering protocol.

Usage

from neuforge_langchain import NeuForgeCallbackHandler
from langchain_openai import ChatOpenAI

handler = NeuForgeCallbackHandler(daily_budget_usd=5.0)
llm = ChatOpenAI(callbacks=[handler])

# If this generation pushes you over the $5.00 limit, a PaymentRequiredException is thrown!
response = llm.invoke("Write a very long story.")

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neuforge_langchain-0.1.0.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neuforge_langchain-0.1.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file neuforge_langchain-0.1.0.tar.gz.

File metadata

  • Download URL: neuforge_langchain-0.1.0.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.14

File hashes

Hashes for neuforge_langchain-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6462fa36ecbb8bdfc1c8797c4d1e787ffbda96623a8b0b77e656b420804322b9
MD5 443516ad7dbb90302398b2995e4d24d1
BLAKE2b-256 5832bd17e90fc8619e48138c96542a05f7eedb50a45ce94d7b8055ad95ee7f84

See more details on using hashes here.

File details

Details for the file neuforge_langchain-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for neuforge_langchain-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e0659fe1ed3bd0b97ab1a816be3a30f3b12a18aebf3c67ae66faa342183e794
MD5 e3edbccf1c134267e96b2aba05057dcc
BLAKE2b-256 0ae63b2546a75ef22c1bd025f1dc572a574a9a47c45982104eca2b1394d2122c

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.1

2 files

1.0.0

2 files

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page