Skip to content

Commit 5dbf781

Browse files
committed
Define 5600 kind
1 parent adb8d83 commit 5dbf781

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

kinds/5600.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
layout: default
3+
title: Wasm Execution
4+
description: Execute WebAssembly (Wasm) code.
5+
---
6+
7+
# Input
8+
9+
Clients must provide the Wasm code in the `i` tag field. The Wasm code must be directly accessible at the provided URL.
10+
It must also provide the input data and the provided function name to be executed.
11+
12+
The input should be a stringified JSON object with the following fields:
13+
14+
- `url` (string): The URL of the Wasm binary.
15+
- `function` (string): The name of the function to be executed.
16+
- `input` (string): The input data for the function.
17+
- `time` (number): The maximum time in milliseconds to execute the function.
18+
- `checksum` (string): The sha256 hash of the Wasm binary in hex.
19+
20+
# Output
21+
22+
The result of the execution is returned in the `content` field.
23+
24+
# Example
25+
26+
## Count number of vowels in a string.
27+
28+
#### Request
29+
30+
```json
31+
{
32+
"content": "",
33+
"kind": 5600,
34+
"tags": [["i", "{\"url\":\"https://github.com/extism/plugins/releases/download/v0.5.0/count_vowels.wasm\",\"function\":\"count_vowels\",\"input\":\"Hello World\",\"time\": 1000, \"checksum\": \"93898457953d30d016f712ccf4336ce7e9971db5f7f3aff1edd252764f75d5d7\"}", "text"]]
35+
}
36+
```
37+
38+
#### Response
39+
40+
```json
41+
{
42+
"content": "{\"count\":3,\"total\":3,\"vowels\":\"aeiouAEIOU\"}",
43+
"kind": 6600
44+
}
45+
```

0 commit comments

Comments
 (0)