For Developers
In today's fast-paced digital landscape, the ability to build intelligent, automated, and seamlessly integrated applications is no longer a luxury, but a necessity. Enter agentic workflows – powerful, autonomous processes that can revolutionize how your applications interact with data, AI, and complex tasks. The .do platform empowers you to create these workflows, and now, with the .do SDK, you can effortlessly bring that power directly into your applications.
This post will guide you through the fundamental steps of getting started with the .do SDK, unlocking a new realm of possibilities for your software.
The @dot-do/sdk is a Software Development Kit specifically designed to help you integrate and interact with .do Agentic Workflows directly within your applications. Think of it as your bridge to intelligent automation, allowing you to trigger workflows, pass data, and receive results using simple API calls and SDK methods.
Whether you're looking to automate tedious tasks, integrate advanced AI capabilities, or deliver "services-as-software," the .do SDK provides the tools you need to do it efficiently.
At its core, the .do SDK empowers you to leverage existing .do agentic workflows within your own codebase. Imagine an AI agent trained to summarize text, process customer inquiries, or even generate code. With the SDK, you can call upon these agents with ease, making your applications smarter and more capable.
The simplicity of integrating these workflows is a game-changer. No need to build complex AI models from scratch or manage intricate automation pipelines. The .do SDK abstracts away the complexity, allowing you to focus on building amazing user experiences.
Getting started with the .do SDK is remarkably straightforward.
You can install the SDK using popular package managers like npm or yarn:
Once installed, the core of the SDK is the Agent class. This class allows you to call .do workflows by name and pass in any necessary parameters. The SDK handles all the underlying communication, ensuring your application receives the results from the workflow efficiently.
Let's look at a practical example – summarizing text using a hypothetical .do agentic workflow:
In this example:
One of the great advantages of the .do SDK is its versatility. It's designed to be used in both backend (Node.js) and frontend (browser) environments. This means you can integrate agentic workflows into your server-side logic for complex data processing or directly into your client-side applications for real-time AI-powered interactions.
The "summarize" example is just the tip of the iceberg. With the .do SDK, you can integrate:
The .do SDK is your gateway to building more powerful, intelligent, and automated applications. By seamlessly integrating agentic workflows, you can deliver unparalleled value to your users and streamline your development process.
Head over to sdk.do to learn more, explore the documentation, and start building smarter today!
npm install @dot-do/sdk
# or
yarn add @dot-do/sdk
import { Agent } from "@dot-do/sdk";
// Initialize the Agent with your API key
const agent = new Agent("your-api-key");
/**
* Asynchronously summarizes a given text using a .do agentic workflow.
* @param text The long text to be summarized.
*/
async function summarizeText(text: string) {
try {
// Call the "summarize" workflow with the text as a parameter
const response = await agent.do("summarize", { text });
console.log("Summarized Text:", response.data);
} catch (error) {
console.error("Error summarizing text:", error);
}
}
// Call the function with your text
summarizeText("Your long text here, which could be a news article, a document, or any string you want to condense into a shorter summary.");