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 = {
"apiToken": "your_api_key",
}
cloud_api = IntegrailCloudApi(options)
Using agent.execute
import asyncio
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}")
async def main():
await cloud_api.agent.execute(
"agent123",
"account123",
CloudAgentExecuteStreamingRequest(
inputs={"param1": "value1"},
stream=True,
),
on_event,
on_finish
)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()
Using agent.execute_multipart
import asyncio
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}")
async def main():
await cloud_api.agent.execute_multipart(
"agent123",
"account123",
CloudAgentExecuteStreamingRequest(
inputs={"param1": "value1"},
stream=True,
),
{"file1": open("data.csv", "rb")},
on_event,
on_finish
)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()
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.1.tar.gz
(11.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file integrail_sdk-0.1.1.tar.gz.
File metadata
- Download URL: integrail_sdk-0.1.1.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e201514549425f720ea355f7e14845b766bc06b4b57942f0a622374eb175f13
|
|
| MD5 |
62887fe5635007475ec4b81f64761aeb
|
|
| BLAKE2b-256 |
795bf9824c77da8e43870c4028ce05a8d2ffe86308dd1b610730158af937cacf
|
File details
Details for the file integrail_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: integrail_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0e7e0f096032b7de0590961cb2ca791a99e5d455e1083fd5634fb5b982a8b85
|
|
| MD5 |
88403390ac2d04a330752ff0a5db6616
|
|
| BLAKE2b-256 |
6fc63b217077d2603310a10fa8415c9879080aabbb1503cbc1d3fa00b3600ddd
|