Tools API.¶
The DeepOriginClient can be used to access the tools API using:
from deeporigin.platform.client import DeepOriginClient
client = DeepOriginClient()
Then, the following methods can be used, for example:
tools = client.tools.list()
src.platform.tools.Tools
¶
Tools API wrapper.
Provides access to tools-related endpoints through the DeepOriginClient.
Functions¶
get_by_key
¶
get_by_key(*, tool_key: str) -> list[dict]
Get all versions of a tool definition by tool key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tool_key
|
str
|
The key of the tool to get the definitions for. |
required |
Returns:
| Type | Description |
|---|---|
list[dict]
|
List of tool definition dictionaries for all versions of the tool. |
list
¶
list() -> dict
List all available tool definitions.
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary containing tool definitions from the API. |
run
¶
run(
*, tool_key: str, tool_version: str, data: dict
) -> dict
Run a tool with a specific version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tool_key
|
str
|
Key of the tool to run. |
required |
tool_version
|
str
|
Version of the tool to run. |
required |
data
|
dict
|
Data transfer object (DTO) containing tool execution parameters.
This is typically generated by the |
required |
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary containing the execution response from the API. |
Raises:
| Type | Description |
|---|---|
Exception
|
If the tool execution fails, with error details printed. |