Skip to content

leap-ai/leap-workflows-swift-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Visit Leap Workflows

The Leap Workflows API allows developers to run workflows, fetch workflow runs, and provide other utility functions related to workflow runs. Please use the X-Api-Key for authenticated requests.

CocoaPods More Info

Table of Contents

Installation

Swift Package Manager

  1. In Xcode, select File > Add Packages… and enter https://github.com/leap-ai/leap-workflows-swift-sdk as the repository URL.
  2. Select the latest version number from our tags page.
  3. Add the Leap product to the target of your app.

Carthage

  1. Add this line to your Cartfile:
github "leap-ai/leap-workflows-swift-sdk"
  1. Follow the Carthage installation instructions.
  2. In the future, to update to the latest version of the SDK, run the following command: carthage update leap-workflows-swift-sdk

CocoaPods

  1. Add source 'https://github.com/CocoaPods/Specs.git' to your Podfile
  2. Add pod 'Leap', '~> 0.1.0' to your Podfile

Your Podfile should look like:

# Podfile
source 'https://github.com/CocoaPods/Specs.git'

target 'Example' do
  pod 'Leap', '~> 0.1.0'
end
  1. Run pod install
❯ pod install
Analyzing dependencies
Downloading dependencies
Installing Leap 0.1.0
Generating Pods project
Integrating client project
Pod installation complete! There is 1 dependency from the Podfile and 2 total pods installed.
  1. In the future, to update to the latest version of the SDK, run: pod update Leap

Getting Started

import Leap

let leap = LeapClient(
    apiKey: "X_API_KEY"
    // Defining the base path is optional and defaults to https://api.workflows.tryleap.ai
    // basePath: "https://api.workflows.tryleap.ai"
)

let bulkRunId = "bulkRunId_example"
let getBulkResponse = try await leap.bulkWorkflowRuns.getBulk(
    bulkRunId: bulkRunId
)

Reference

leap.bulkWorkflowRuns.getBulk

This endpoint retrieves the details of a specific bulk workflow run using its bulk_run_id.

πŸ› οΈ Usage

let bulkRunId = "bulkRunId_example"
let getBulkResponse = try await leap.bulkWorkflowRuns.getBulk(
    bulkRunId: bulkRunId
)

βš™οΈ Parameters

bulkRunId: String

The ID of the bulk run to retrieve.

πŸ”„ Return

BulkRunSchema

🌐 Endpoint

/v1/runs/bulk/{bulk_run_id} GET

πŸ”™ Back to Table of Contents


leap.bulkWorkflowRuns.runBulk

This endpoint lets the user run a specified workflow with the provided csv in bulk.

πŸ› οΈ Usage

let workflowId = "workflowId_example"
let inputCsvUrl = "inputCsvUrl_example"
let webhookUrl = "webhookUrl_example"
let runBulkResponse = try await leap.bulkWorkflowRuns.runBulk(
    workflowId: workflowId,
    inputCsvUrl: inputCsvUrl,
    webhookUrl: webhookUrl
)

βš™οΈ Parameters

workflow_id: String

The ID of the workflow to be run in bulk.

input_csv_url: String

A CSV file containing the input data for the bulk run. Each row should contain the input data for a single run.

webhook_url: String

The URL to which the bulk run results should be sent to on completion.

πŸ”„ Return

BulkRunSchema

🌐 Endpoint

/v1/runs/bulk POST

πŸ”™ Back to Table of Contents


leap.workflowRuns.getWorkflowRun

This endpoint retrieves the details of a specific workflow run using its workflow_run_id.

πŸ› οΈ Usage

let workflowRunId = "workflowRunId_example"
let getWorkflowRunResponse = try await leap.workflowRuns.getWorkflowRun(
    workflowRunId: workflowRunId
)

βš™οΈ Parameters

workflowRunId: String

The ID of the workflow run to retrieve.

πŸ”„ Return

WorkflowRunSchema

🌐 Endpoint

/v1/runs/{workflow_run_id} GET

πŸ”™ Back to Table of Contents


leap.workflowRuns.workflow

This endpoint lets the user run a specified workflow with the provided workflow definition.

πŸ› οΈ Usage

let workflowId = "workflowId_example"
let webhookUrl = "webhookUrl_example"
let input = "TODO"
let workflowResponse = try await leap.workflowRuns.workflow(
    workflowId: workflowId,
    webhookUrl: webhookUrl,
    input: input
)

βš™οΈ Parameters

workflow_id: String

The ID of the workflow to be run.

webhook_url: String

The URL to which the workflow results should be sent to on completion.

input: [String: AnyCodable]

Variables that the workflow can use globally and their values.

πŸ”„ Return

WorkflowRunSchema

🌐 Endpoint

/v1/runs POST

πŸ”™ Back to Table of Contents


Author

This TypeScript package is automatically generated by Konfig

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published