0.9.4:Updated transformers documentation, added rest call documentation, added datetime logic explanation, and return none not supported

This commit is contained in:
Lee, Kean-Yew
2025-03-03 13:23:43 +01:00
parent 81da96e120
commit ed448191fb
164 changed files with 231 additions and 136 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 832ae3f5fbd60e9a282218d0c0888c28
config: e13c37ea2174a69bc11e19007ba7825e
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 453 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 496 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 442 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 8.9 KiB

+2 -2
View File
@@ -5,7 +5,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Overview: module code &mdash; Hansken Extraction Plugins for plugin developers 0.9.3 documentation</title>
<title>Overview: module code &mdash; Hansken Extraction Plugins for plugin developers 0.9.5 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=d75fae25" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=e59714d7" />
<link rel="stylesheet" type="text/css" href="../_static/wider_pages.css?v=32ad70ab" />
@@ -13,7 +13,7 @@
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=0e439607"></script>
<script src="../_static/documentation_options.js?v=61b282d3"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
@@ -9,7 +9,7 @@ are important to plugin developers. For a full list of changes per version, plea
.. ## |version|
## 0.9.3
## 0.9.4
* This release supports providing all types of transformer arguments when using the `execute_transformer` script.
+21 -4
View File
@@ -47,14 +47,14 @@ However, there are some limitations on which methods can be turned into a decora
- Transformer may not be static methods.
- All parameters and the return type must be annotated with type hints (except the `self` parameter).
- Parameters may not be positional-only or contain variable parameters like `*args` or `**kwarg`.
- Parameters and return types may only be of the following:
- Parameters and return types may only be of the following (returning None is not supported):
- bool
- int
- float
- str
- bytes
- bytearray
- datetime.datetime
- datetime.datetime (The datetime will be converted to unix time and then converted to datetime with the zone "UTC". So the zone id is always("UTC"))
- hansken.util.GeographicLocation
- hansken.util.Vector
- typing.Sequence
@@ -71,5 +71,22 @@ debugging purposes.
## Testing transformers
For more information on testing transformers, see the 'Testing Transformers' section on the [page on testing plugins](testing.md).
## Calling Transformers
TODO HANSKEN-21414: This should be implemented once we decide on how we design the REST API.
## Calling transformer with /tools/transformers
This REST Call calls a specified transformer method on a given tool/plugin with supplied arguments.
This endpoint allows a transformer to be executed on demand, outside an extraction. The transformer call can be used to transform user input to an output. A tool/plugin can have multiple transformer methods.
To use /tools/transformers REST CALL you need to know the following (see extractions tool or use the rest call/tools to get the information below):
- The name of the plugin/tool
- The transformer name
- The names of the parameters (arguments)
Example JSON request body for the transformer above:
```JSON
{
"arguments": {
"text": "value1",
"language": "value2"
},
"tool": "ExampleTool",
"transformer": "translate_text"
}
```
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = {
VERSION: '0.9.3',
VERSION: '0.9.5',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More