Skip to main content

An integration package connecting Salesforce and LangChain

Project description

langchain-salesforce

PyPI version License: MIT Python Versions CI

LangChain integration for Salesforce CRM. Query data with SOQL, inspect schemas, and manage records (CRUD) directly from your LangChain applications.

Installation

pip install -U langchain-salesforce

Configuration

Set these environment variables:

Variable Description
SALESFORCE_USERNAME Your Salesforce username
SALESFORCE_PASSWORD Your Salesforce password
SALESFORCE_SECURITY_TOKEN Your Salesforce security token
SALESFORCE_DOMAIN login (production) or test (sandbox). Default: login

Quick Start

from langchain_salesforce import SalesforceTool

tool = SalesforceTool()

# Query contacts
result = tool.run({
    "operation": "query",
    "query": "SELECT Id, Name, Email FROM Contact LIMIT 5"
})

Operations

Operation Description Required Parameters
query Execute SOQL queries query
describe Get object schema object_name
list_objects List all SObjects
create Create a record object_name, record_data
update Update a record object_name, record_id, record_data
delete Delete a record object_name, record_id
get_field_metadata Get field details object_name, field_name

Examples

# Describe an object
tool.run({"operation": "describe", "object_name": "Account"})

# Create a record
tool.run({
    "operation": "create",
    "object_name": "Contact",
    "record_data": {"LastName": "Doe", "Email": "doe@example.com"}
})

# Update a record
tool.run({
    "operation": "update",
    "object_name": "Contact",
    "record_id": "003XXXXXXXXXXXXXXX",
    "record_data": {"Email": "updated@example.com"}
})

# Delete a record
tool.run({"operation": "delete", "object_name": "Contact", "record_id": "003XXXXXXXXXXXXXXX"})

Development

git clone https://github.com/colesmcintosh/langchain-salesforce.git
cd langchain-salesforce
uv sync --all-groups

make format  # Format code
make lint    # Run linters
make test    # Run tests

See CONTRIBUTING.md for guidelines.

License

MIT License. See LICENSE.

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_salesforce-0.2.2.tar.gz (223.3 kB view details)

Uploaded Source

Built Distribution

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

langchain_salesforce-0.2.2-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file langchain_salesforce-0.2.2.tar.gz.

File metadata

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

File hashes

Hashes for langchain_salesforce-0.2.2.tar.gz
Algorithm Hash digest
SHA256 a89ff4797bbb1d56141b6e72b54c637dc4b551fc7a92bfa3e06639c4544c0c2c
MD5 1b2e97a66a22d066c51e4f92a56a8e89
BLAKE2b-256 b4b81539b7caa507c86c0d680d09df87013cc473d4122c30ff0daa1ebc90f449

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_salesforce-0.2.2.tar.gz:

Publisher: release.yml on colesmcintosh/langchain-salesforce

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_salesforce-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_salesforce-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6995ba6cb5915fae12e33b9346cd7c302c8e91106aa000a7364ec8ece34de66a
MD5 e0c469240fd5fe51aaa4363f7158288c
BLAKE2b-256 40d808d912fe7c331e5e489f5cfc436f3de14ff449cb6ea3d6b4ee6f6adff4a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_salesforce-0.2.2-py3-none-any.whl:

Publisher: release.yml on colesmcintosh/langchain-salesforce

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