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
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for integrail_sdk-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 646313c339580302be4bdf2e782136907635908f0b97f7f405b208967f659205 |
|
MD5 | 26f5b1686d8557988a7c42508c829e0d |
|
BLAKE2b-256 | 0692f85e436e06af21f4f3ab897fef5b0bed333ea8667cdd6d546d6ee09adf9b |