Skip to main content

Cred LangChain integration — credential delegation tools for LangChain agents

Project description

cred-langchain

LangChain integration for Cred. OAuth2 credential delegation for AI agents.

Install

pip install cred-langchain

Quick Start

import os
from cred_langchain import CredToolkit
from cred import ConsentRequiredError

toolkit = CredToolkit(
    agent_token=os.environ["CRED_AGENT_TOKEN"],
    user_id="user_123",
)
tools = toolkit.get_tools()
# tools = [CredDelegateTool, CredStatusTool, CredRevokeTool]

# Use with any LangChain agent
from langchain.agents import AgentExecutor
agent = AgentExecutor(agent=..., tools=tools)

Tools

Tool Name Description
CredDelegateTool cred_delegate Get an OAuth access token for a service
CredStatusTool cred_status List user's connected services
CredRevokeTool cred_revoke Revoke a service connection

Handling Consent

When a user hasn't connected a service yet, CredDelegateTool raises ConsentRequiredError. Catch it and redirect the user to e.consent_url to complete the OAuth flow.

Cred Cloud (Coming Soon)

Managed cloud delegation is coming. Join the waitlist.

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

cred_langchain-0.1.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

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

cred_langchain-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cred_langchain-0.1.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for cred_langchain-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3d3bbef7c4c2e6f56af4c36669eaae8bd47da55495aa800882f3617bce0fa4bd
MD5 6021246167e4a7606e68538f0389ed02
BLAKE2b-256 e4624155c6e3a1680fba1236e21054e4ede206bbbc40f7c0f4d8ccd6e8114c90

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cred_langchain-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for cred_langchain-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6d4c28aff648cc05da0b8da909408fe47521e14cc9b4e663433b9528d2d7cfc1
MD5 a9e0523418195545079b9a9d6efdc634
BLAKE2b-256 309cd893a442cdb743d086c104786940c3895774783c682180de579bc7684436

See more details on using hashes here.

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