Skip to main content

LangChain toolkit for Universal Commerce Protocol (UCP)

Project description

LangChain UCP

LangChain toolkit for Universal Commerce Protocol (UCP).

Overview

langchain-ucp provides LangChain tools and toolkit for building AI agents that can interact with UCP-compliant merchants.

Installation

pip install langchain-ucp

Quick Start

from langchain_ucp import UCPToolkit
from langchain_openai import ChatOpenAI
from langgraph.prebuilt import create_react_agent

# Create toolkit
toolkit = UCPToolkit(merchant_url="http://localhost:8000")

# Create agent
llm = ChatOpenAI(model="gpt-4o")
agent = create_react_agent(llm, toolkit.get_tools())

# Run agent
result = await agent.ainvoke({
    "messages": [{"role": "user", "content": "I want to buy some red roses"}]
})

Available Tools

Tool Description
search_shopping_catalog Search the product catalog
add_to_checkout Add products to cart
remove_from_checkout Remove products from cart
update_checkout Update product quantities
get_checkout View current cart
update_customer_details Add buyer info and address
start_payment Prepare checkout for payment
complete_checkout Complete purchase
cancel_checkout Cancel checkout
get_order Get order details

License

Apache License 2.0

Project details


Download files

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

Source Distribution

langchain_ucp-0.1.0.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

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

langchain_ucp-0.1.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: langchain_ucp-0.1.0.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for langchain_ucp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 917dccfa736c75ac49db0e2b87e86b2ffb13ae3ad3751ab32d926de815ea2c2b
MD5 12ccfcec0bf2088dc279c2a14ef33a11
BLAKE2b-256 deb416ad5b0ce0a5a95264a772be9173ffa1b14b6146c1062c1f44df391cc2ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_ucp-0.1.0.tar.gz:

Publisher: publish.yml on muzaffersenkal/langchain-ucp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: langchain_ucp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for langchain_ucp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 78063f626cfa91f8a62b541f046a6cb9efb08c224d56b0d8f19aedce527f7964
MD5 6a0ed9a898522e2c288535b8c22c7fae
BLAKE2b-256 d66f59fa1eba3e0eb35911361f2e9a9b90b3a7c02807eab3a983a3dba2827f34

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_ucp-0.1.0-py3-none-any.whl:

Publisher: publish.yml on muzaffersenkal/langchain-ucp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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