Skip to main content

No project description provided

Project description

Integrail SDK

Usage

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

Initializing IntegrailCloudApi

from integrail_sdk import IntegrailCloudApi

# Initialize the API with options
options = {
    "api_key": "your_api_key",
}
cloud_api = IntegrailCloudApi(options)

Using agent.execute

from typing import Optional

from integrail_sdk.types import ExecutionEvent, AgentExecution
from integrail_sdk.api import CloudAgentExecuteStreamingRequest

def on_event(event: ExecutionEvent, execution: Optional[AgentExecution]):
    print(f"Event: {event}, Execution: {execution}")

def on_finish(execution: Optional[AgentExecution]):
    print(f"Finished: {execution}")

cloud_api.agent.execute(
    "agent123",
    "account123",
    CloudAgentExecuteStreamingRequest(
        inputs={"param1": "value1"},
        stream=True,
    ),
    on_event,
    on_finish
)

Using agent.execute_multipart

from typing import Optional

from integrail_sdk.types import ExecutionEvent, AgentExecution
from integrail_sdk.api import CloudAgentExecuteStreamingRequest

def on_event(event: ExecutionEvent, execution: Optional[AgentExecution]):
    print(f"Event: {event}, Execution: {execution}")

def on_finish(execution: Optional[AgentExecution]):
    print(f"Finished: {execution}")

cloud_api.agent.execute_multipart(
    "agent123",
    "account123",
    CloudAgentExecuteStreamingRequest(
        inputs={"param1": "value1"},
        stream=True,
    ),
    {"file1": open("data.csv", "rb")},
    on_event,
    on_finish
)

License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

integrail_sdk-0.1.0.tar.gz (11.0 kB view hashes)

Uploaded Source

Built Distribution

integrail_sdk-0.1.0-py3-none-any.whl (19.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page