You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30-31Lines changed: 30 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,13 @@
1
-
# AI documentation templates
1
+
# AI Act Implementation Tool
2
2
3
-
Open-source templates for model documentation. Based on AI Act requirements and soft law frameworks, such as the Research framework Algorithms of the Netherlands Executive Audit Agency, the Algorithm framework of the Dutch Ministry of the Interior and the Dutch Fundamental Rights Impact Assessment (IAMA).
4
-
5
-
The templates are available in JSON format and can be easily customized to fit the specific needs of an organization.
3
+
Opinionated implementation of [AI act questions](https://github.com/NGO-Algorithm-Audit/AI-Act-Questions) created by the Algorithm Audit team.
6
4
7
5
# How to run
8
6
9
-
Follow these steps to set up and run the application on your local machine.
7
+
This project includes a Git submodule that references the JSON Schemas repository (LINK), allowing us to keep schema definitions separate while using them within this project. Follow these steps to setup everything correctly.
10
8
11
9
## Prerequisites
10
+
12
11
Ensure the following are installed on your system:
13
12
14
13
Node.js (version 14 or later)
@@ -20,14 +19,24 @@ node -v
20
19
npm -v
21
20
```
22
21
23
-
First, clone the repository to your local machine. Open your terminal and run:
22
+
##### 1. Clone the repository to your local machine. Open your terminal and run:
Once inside the project directory, install the necessary packages by running:
29
+
##### 2. JSON Schemas Submodule
30
+
31
+
```bash
32
+
# If you’re cloning this repository for the first time, or if you haven't initialized the submodule yet
33
+
git submodule update --init --recursive
34
+
35
+
# To update the submodule from the remote.
36
+
git submodule update --remote --merge
37
+
```
38
+
39
+
##### 3. Once inside the project directory, install the necessary packages by running:
31
40
32
41
```bash
33
42
# If you use npm
@@ -37,31 +46,29 @@ npm install
37
46
yarn install
38
47
```
39
48
40
-
After the dependencies are installed, start the development server with:
49
+
##### 4. After the dependencies are installed, start the development server with:
41
50
42
51
```bash
43
52
# If using npm
44
-
npm start
53
+
npm run dev
45
54
46
55
# Or, if using yarn
47
-
yarn start
56
+
yarn dev
48
57
```
49
58
50
59
This command will compile and serve the application. By default, it should be accessible at http://localhost:5173 in your web browser.
51
60
52
61
# How it works.
53
62
54
-
This implementation extends the [React JSON Schema Form (RJSF) library](https://github.com/rjsf-team/react-jsonschema-form) to create a step-by-step wizard interface. Instead of displaying all form fields at once, it presents them one at a time, with validation and navigation controls.
63
+
The actual form schema's are specified in [AI act questions repository.](https://github.com/NGO-Algorithm-Audit/AI-Act-Questions) And this repository is used as a git sub module in this repository.
64
+
65
+
This rendering implementation extends the [React JSON Schema Form (RJSF) library](https://github.com/rjsf-team/react-jsonschema-form) to create a step-by-step wizard interface. Instead of displaying all form fields at once, it presents them one at a time, with validation and navigation controls.
55
66
56
67
The original specification is still applicable so please read the [RSJF documentation](https://rjsf-team.github.io/react-jsonschema-form/docs/) for information about how the forms work.
57
68
58
69
Changes we made to the original specification:
59
70
60
-
### 1. Multi form support
61
-
62
-
To show multiple forms on the starting page, we always place our form specifications inside an array. [See our forms](./src/assets/forms.json)
63
-
64
-
### 2. Output
71
+
### 1. Output
65
72
66
73
The templates should return an outcome after the questions, to show this result we trigger the results component when the question key is `output`. For example:
67
74
@@ -77,27 +84,19 @@ This allows us to have multiple different outcomes in one template that each are
77
84
78
85
In case a form ends without an `output` question we automatically trigger an error component.
79
86
80
-
### 3. uiSchema integration
81
-
82
-
To simplify importing the json templates into our front-end we specificy our [uiSchema](https://rjsf-team.github.io/react-jsonschema-form/docs/api-reference/uiSchema) inside the original [object properties](https://rjsf-team.github.io/react-jsonschema-form/docs/json-schema/objects)
87
+
### 2. Intermediate output
83
88
84
-
Example:
89
+
To show intermediate outputs or simple text messages to the user we trigger a classname on such elements, to prevent the content from rendering as an input. This is done by adding the following uiSchema definition:
85
90
86
91
```json
87
-
{
88
-
"title": "Hello World",
89
-
"type": "object",
90
-
"required": ["question1"],
91
-
"properties": {...},
92
-
"dependencies": {...},
93
-
"uiSchema": {
94
-
"question1": {
95
-
"ui:autofocus": true
96
-
}
97
-
}
92
+
"outputIntermediate": {
93
+
"ui:widget": "textarea",
94
+
"ui:classNames": "intermediate-output"
98
95
}
99
96
```
100
97
98
+
In this example we trigger this for the input element `outputIntermediate` but this mechanism can be used for any question.
99
+
101
100
# Styling overrides
102
101
103
102
With these css variables defined in the root where the frontend is injected the default theming can be overriden.
0 commit comments