Python SDK for creating, managing, and deploying AI agents in Salesforce
Project description
Salesforce AgentForce SDK
A Python SDK for creating, managing, and deploying AI agents in Salesforce.
Introduction
The Salesforce AgentForce SDK provides a programmatic interface to Salesforce's Agent infrastructure, allowing developers to define and interact with agents using Python code.
Installation
pip install agentforce-sdk
Documentation
Comprehensive documentation for the SDK is available in the docs directory:
- API Documentation: Detailed documentation for all SDK components, classes, and methods.
- JSON Schemas: JSON schemas for validating agent definitions in various formats.
Directory Structure Support
The SDK supports multiple formats for defining agents:
- Single JSON File: A complete agent definition in a single JSON file.
- Nested Directory Structure: A hierarchical directory structure with topics and actions in subdirectories.
- Modular Directory Structure: A flat directory structure with references between components.
For more information, see the Directory Structures section in the API documentation.
Examples
The examples directory contains sample code demonstrating how to use the SDK:
- Creating an agent programmatically
- Creating an agent from a JSON file
- Creating an agent from a nested directory
- Creating an agent from a modular directory
- Running an agent
- Exporting an agent
Quick Start
from agent_sdk import Agentforce
from agent_sdk.models import Agent, Topic, Action, Input, Output
# Initialize the client
client = Agentforce(username="your_username", password="your_password")
# Create a simple agent
agent = Agent(
name="Hello World Agent",
description="A simple agent that says hello",
agent_type="Bot",
company_name="Salesforce"
)
# Add a topic
topic = Topic(
name="Greetings",
description="Handle greetings",
scope="Handle greeting requests"
)
# Add an action
action = Action(
name="SayHello",
description="Say hello to the user",
inputs=[
Input(
name="name",
description="Name of the person to greet",
data_type="String",
required=True
)
],
example_output=Output(
status="success",
details={"message": "Hello, World!"}
)
)
# Add the action to the topic
topic.actions = [action]
# Add the topic to the agent
agent.topics = [topic]
# Create the agent in Salesforce
result = client.create(agent)
print(f"Agent created with ID: {result['id']}")
IDE Integration
The SDK includes JSON schema files that can help with IDE integration:
- VSCode: Use the schemas to validate your agent definition files
- Cursor: Leverage the detailed API documentation for intelligent code completion
- WindSurf: Use the schema files to provide structured editing experiences
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentforce_sdk-0.1.4.tar.gz.
File metadata
- Download URL: agentforce_sdk-0.1.4.tar.gz
- Upload date:
- Size: 64.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db6afef23d4980b923dbbdac315b1bf5bdfe3aa21c55003839544b9ca0f511c0
|
|
| MD5 |
90102a53d572ca8ae3ccf4dce8d6f329
|
|
| BLAKE2b-256 |
328dad1d54e647cef16f54e11ca42b4396dc191688349b2766b0bccd003a60d7
|
File details
Details for the file agentforce_sdk-0.1.4-py3-none-any.whl.
File metadata
- Download URL: agentforce_sdk-0.1.4-py3-none-any.whl
- Upload date:
- Size: 80.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e541fc445be74f7bf7c2cfb2fc48e3830d7807832f6a8e48d78f07e7597bd92d
|
|
| MD5 |
ee9b8292748e61c070deb537d6ce464f
|
|
| BLAKE2b-256 |
d26a1c071f1e25220fa2d7143a540811e163ef2644081815c2ba39a9a5bd57f8
|