Skip to content

Commit a0a90e0

Browse files
committed
Define 5600 kind
1 parent adb8d83 commit a0a90e0

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

kinds/5600.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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 code.
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+
19+
# Output
20+
21+
The result of the execution is returned in the `content` field.
22+
23+
# Example
24+
25+
## Count number of vowels in a string.
26+
27+
#### Request
28+
29+
```json
30+
{
31+
"content": "",
32+
"kind": 5600,
33+
"tags": [["i", "{\"url\":\"https://github.com/extism/plugins/releases/download/v0.5.0/count_vowels.wasm\",\"function\":\"count_vowels\",\"input\":\"Hello World\",\"time\": 1000}", "text"]]
34+
}
35+
```
36+
37+
#### Response
38+
39+
```json
40+
{
41+
"content": "{\"count\":3,\"total\":3,\"vowels\":\"aeiouAEIOU\"}",
42+
"kind": 6600
43+
}
44+
```

0 commit comments

Comments
 (0)