0.1.47 • Published 10 months ago

integrail-sdk-cloud v0.1.47

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

Integrail SDK

Usage

Below is an example of how to initialize the IntegrailCloudApi and use streaming versions of its agent.execute and agent.executeMultipart methods.

Initializing IntegrailCloudApi

import { IntegrailCloudApi } from "integrail-sdk-cloud";

const cloudApi = new IntegrailCloudApi({
  apiToken: "...",
});

Using agent.execute

const agentId = "...";
const accountId = "...";

const onEvent = (event: ExecutionEvent, execution: AgentExecution | null) => {
  console.log(event);
};

const onFinish = (execution: AgentExecution | null) => {
  console.log(execution);
};

cloudApi.agent.execute(
  agentId,
  accountId,
  { inputs: { param1: "value1" }, stream: true },
  onEvent,
  onFinish,
);

Using agent.executeMultipart

const agentId = "...";
const accountId = "...";

const onEvent = (event: ExecutionEvent, execution: AgentExecution | null) => {
  console.log(event);
};

const onFinish = (execution: AgentExecution | null) => {
  console.log(execution);
};

const blob = await fetch("...").then(async (r) => await r.blob());

cloudApi.agent.executeMultipart(
  agentId,
  accountId,
  { inputs: { param1: "value1" }, stream: true },
  { param2: blob },
  onEvent,
  onFinish,
);

License

This project is licensed under the MIT License. See the LICENSE.txt file for more details.

0.1.47

10 months ago

0.1.45

11 months ago

0.1.44

11 months ago

0.1.43

11 months ago

0.1.42

11 months ago

0.1.41

11 months ago

0.1.40

11 months ago

0.1.39

11 months ago

0.1.38

11 months ago