(For Developers)
In today's fast-paced digital landscape, the ability to automate tasks, integrate AI, and deliver services efficiently is paramount. Enter the .do platform, with its powerful Agentic Workflows, designed to streamline complex processes. But what if you want to bring the power of these workflows directly into your own applications?
That's where the .do SDK (@dot-do/sdk) comes in. This Software Development Kit is your key to unlocking the full potential of .do Agentic Workflows within your applications, allowing you to easily automate tasks, integrate AI, and deliver services-as-software with simple API calls.
The @dot-do/sdk is a Software Development Kit that allows you to easily integrate and interact with .do Agentic Workflows directly within your applications using simple APIs and SDKs. It bridges the gap between your custom code and the powerful capabilities of the .do platform. Think of it as a translator that lets your application "speak" to and leverage .do workflows effortlessly.
The process is refreshingly straightforward.
You can install the SDK using popular package managers like npm or yarn:
npm install @dot-do/sdk
# or
yarn add @dot-do/sdk
The core of the SDK revolves around the Agent class. This class allows you to call .do workflows by name and pass in necessary parameters. The SDK handles all the underlying communication, making it incredibly simple to trigger and receive results from your workflows.
Here’s a quick example in TypeScript:
import { Agent } from "@dot-do/sdk";
// Initialize the Agent with your API key
const agent = new Agent("your-api-key");
async function summarizeText(text: string) {
try {
// Call a .do workflow named "summarize" and pass "text" as a parameter
const response = await agent.do("summarize", { text });
console.log(response.data); // Log the data returned by the workflow
} catch (error) {
console.error("Error summarizing text:", error);
}
}
// Example usage:
summarizeText("Your long text here that you want to be summarized by a .do workflow. This could be any document, article, or user input.");
In this example, agent.do("summarize", { text }) makes a call to a .do workflow named "summarize", passing the provided text as an argument. The response response.data will contain the output from that workflow. Imagine the possibilities: summarizing lengthy articles, generating reports, processing user queries, or triggering complex multi-step automations!
The .do SDK opens up a world of possibilities for developers:
Q: What is the @dot-do/sdk?
A: The @dot-do/sdk is a Software Development Kit that allows you to easily integrate and interact with .do Agentic Workflows directly within your applications using simple APIs and SDKs.
Q: How do I install the SDK?
A: You can install the SDK using popular package managers like npm or yarn:
npm install @dot-do/sdk or yarn add @dot-do/sdk
Q: How do I use the SDK to interact with .do workflows?
A: The core of the SDK is the Agent class, which allows you to call .do workflows by name and pass in necessary parameters. The SDK handles the communication and returns the results from the workflow.
Q: Can I use the SDK in both backend and frontend applications?
A: Yes, the SDK is designed to be used in both backend (Node.js) and frontend (browser) environments.
The sdk.do SDK empowers you to build smarter, more automated, and more intelligent applications. By seamlessly embedding .do workflow triggers directly into your app, you can focus on your core product while leveraging the robust capabilities of the .do platform for complex operations.
Ready to transform your applications? Get started with the .do SDK today and unlock a new realm of possibilities!
Start building smarter with the .do SDK!