Name | integrail-sdk JSON |
Version |
0.1.0
JSON |
| download |
home_page | None |
Summary | None |
upload_time | 2024-10-04 12:27:04 |
maintainer | None |
docs_url | None |
author | Your Name |
requires_python | <4.0,>=3.12 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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
```python
from integrail_sdk import IntegrailCloudApi
# Initialize the API with options
options = {
"api_key": "your_api_key",
}
cloud_api = IntegrailCloudApi(options)
```
### Using `agent.execute`
```python
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`
```python
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.
Raw data
{
"_id": null,
"home_page": null,
"name": "integrail-sdk",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.12",
"maintainer_email": null,
"keywords": null,
"author": "Your Name",
"author_email": "you@example.com",
"download_url": "https://files.pythonhosted.org/packages/fc/97/2b4cb357e276f588844169131f9683d464e7e7f58dbdd0c2ee84de884b1d/integrail_sdk-0.1.0.tar.gz",
"platform": null,
"description": "# Integrail SDK\n\n## Usage\n\nBelow is an example of how to initialize the `IntegrailCloudApi` and use streaming versions of its `agent.execute` and `agent.execute_multipart` methods.\n\n### Initializing IntegrailCloudApi\n\n```python\nfrom integrail_sdk import IntegrailCloudApi\n\n# Initialize the API with options\noptions = {\n \"api_key\": \"your_api_key\",\n}\ncloud_api = IntegrailCloudApi(options)\n```\n\n### Using `agent.execute`\n\n```python\nfrom typing import Optional\n\nfrom integrail_sdk.types import ExecutionEvent, AgentExecution\nfrom integrail_sdk.api import CloudAgentExecuteStreamingRequest\n\ndef on_event(event: ExecutionEvent, execution: Optional[AgentExecution]):\n print(f\"Event: {event}, Execution: {execution}\")\n\ndef on_finish(execution: Optional[AgentExecution]):\n print(f\"Finished: {execution}\")\n\ncloud_api.agent.execute(\n \"agent123\",\n \"account123\",\n CloudAgentExecuteStreamingRequest(\n inputs={\"param1\": \"value1\"},\n stream=True,\n ),\n on_event,\n on_finish\n)\n```\n\n### Using `agent.execute_multipart`\n\n```python\nfrom typing import Optional\n\nfrom integrail_sdk.types import ExecutionEvent, AgentExecution\nfrom integrail_sdk.api import CloudAgentExecuteStreamingRequest\n\ndef on_event(event: ExecutionEvent, execution: Optional[AgentExecution]):\n print(f\"Event: {event}, Execution: {execution}\")\n\ndef on_finish(execution: Optional[AgentExecution]):\n print(f\"Finished: {execution}\")\n\ncloud_api.agent.execute_multipart(\n \"agent123\",\n \"account123\",\n CloudAgentExecuteStreamingRequest(\n inputs={\"param1\": \"value1\"},\n stream=True,\n ),\n {\"file1\": open(\"data.csv\", \"rb\")},\n on_event,\n on_finish\n)\n```\n\n## License\n\nThis project is licensed under the MIT License. See the `LICENSE.txt` file for more details.\n",
"bugtrack_url": null,
"license": null,
"summary": null,
"version": "0.1.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0692f85e436e06af21f4f3ab897fef5b0bed333ea8667cdd6d546d6ee09adf9b",
"md5": "26f5b1686d8557988a7c42508c829e0d",
"sha256": "646313c339580302be4bdf2e782136907635908f0b97f7f405b208967f659205"
},
"downloads": -1,
"filename": "integrail_sdk-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "26f5b1686d8557988a7c42508c829e0d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.12",
"size": 19011,
"upload_time": "2024-10-04T12:27:02",
"upload_time_iso_8601": "2024-10-04T12:27:02.552514Z",
"url": "https://files.pythonhosted.org/packages/06/92/f85e436e06af21f4f3ab897fef5b0bed333ea8667cdd6d546d6ee09adf9b/integrail_sdk-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fc972b4cb357e276f588844169131f9683d464e7e7f58dbdd0c2ee84de884b1d",
"md5": "99e66838f032fd5c580a8da4f29ed49f",
"sha256": "1e617cbe96a56dd27a2ff1fe075d8269f3824f0bed8aa120e5811a489bd9b61b"
},
"downloads": -1,
"filename": "integrail_sdk-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "99e66838f032fd5c580a8da4f29ed49f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.12",
"size": 11029,
"upload_time": "2024-10-04T12:27:04",
"upload_time_iso_8601": "2024-10-04T12:27:04.221788Z",
"url": "https://files.pythonhosted.org/packages/fc/97/2b4cb357e276f588844169131f9683d464e7e7f58dbdd0c2ee84de884b1d/integrail_sdk-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-04 12:27:04",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "integrail-sdk"
}