0.1.47 • Published 3 months ago

integrail-sdk-cloud v0.1.47

Weekly downloads
-
License
-
Repository
-
Last release
3 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

3 months ago

0.1.45

4 months ago

0.1.44

4 months ago

0.1.43

4 months ago

0.1.42

4 months ago

0.1.41

4 months ago

0.1.40

4 months ago

0.1.39

4 months ago

0.1.38

5 months ago