Skip to content

Commit 3c8b217

Browse files
committed
add schema's directly in repository.
1 parent b6bd3e8 commit 3c8b217

File tree

3 files changed

+1329
-54
lines changed

3 files changed

+1329
-54
lines changed

README.md

Lines changed: 43 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,48 @@
1-
# AI Act Implementation Tool
1+
# AI Act Questions
22

3-
Opinionated implementation of [AI act questions](https://github.com/NGO-Algorithm-Audit/AI-Act-Questions) created by the Algorithm Audit team in collaboration with the muncipality of Amsterdam.
3+
AI Act questions based on AI Act defintions and the definition of High Impact Algorithm in the Algorithm Registery guidance by the Dutch Ministry of the Interior (https://algoritmes.pleio.nl/attachment/entity/f1a35292-7ea6-4e47-93fa-b3358e9ab2e0).
44

5-
# How to run
5+
The questions are developed in collaboration with the Muncipality of Amsterdam.
6+
7+
The templates are available in JSON format and can be easily customized to fit the specific needs of an organization.
8+
9+
# How it works
10+
11+
The JSON schema's use the [React JSON Schema Form (RJSF) library](https://github.com/rjsf-team/react-jsonschema-form), this library is built on top of: [Json schema's](https://json-schema.org/) which should make it easy to implement the schema's in your own tech stack.
12+
Please read the [RSJF documentation](https://rjsf-team.github.io/react-jsonschema-form/docs/) for information about how the forms and dependencies work.
13+
14+
Changes we made to the original specification:
15+
16+
### 1. Output
17+
18+
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:
19+
20+
```json
21+
"output": {
22+
"type": "string",
23+
"title": "Uitslag",
24+
"default": "Uw toepassing is op basis van uw antwoorden waarschijnlijk een impactvol algoritme."
25+
}
26+
```
27+
28+
This allows us to have multiple different outcomes in one template that each are triggered based on a unique combination of dependencies.
29+
30+
In case a form ends without an `output` question we automatically trigger an error component.
31+
32+
### 2. Intermediate output
633

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.
34+
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:
35+
36+
```json
37+
"outputIntermediate": {
38+
"ui:widget": "textarea",
39+
"ui:classNames": "intermediate-output"
40+
}
41+
```
42+
43+
In this example we trigger this for the input element `outputIntermediate` but this mechanism can be used for any question.
44+
45+
# How to run
846

947
## Prerequisites
1048

@@ -22,20 +60,10 @@ npm -v
2260
##### 1. Clone the repository to your local machine. Open your terminal and run:
2361

2462
```bash
25-
git clone https://github.com/your-username/your-repo-name.git
63+
git clone https://github.com/NGO-Algorithm-Audit/AI-Act-Implementation-Tool.git
2664
cd your-repo-name
2765
```
2866

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-
3967
##### 3. Once inside the project directory, install the necessary packages by running:
4068

4169
```bash
@@ -58,45 +86,6 @@ yarn dev
5886

5987
This command will compile and serve the application. By default, it should be accessible at http://localhost:5173 in your web browser.
6088

61-
# How it works.
62-
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.
66-
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.
68-
69-
Changes we made to the original specification:
70-
71-
### 1. Output
72-
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:
74-
75-
```json
76-
"output": {
77-
"type": "string",
78-
"title": "Uitslag",
79-
"default": "Uw toepassing is op basis van uw antwoorden waarschijnlijk een impactvol algoritme."
80-
}
81-
```
82-
83-
This allows us to have multiple different outcomes in one template that each are triggered based on a unique combination of dependencies.
84-
85-
In case a form ends without an `output` question we automatically trigger an error component.
86-
87-
### 2. Intermediate output
88-
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:
90-
91-
```json
92-
"outputIntermediate": {
93-
"ui:widget": "textarea",
94-
"ui:classNames": "intermediate-output"
95-
}
96-
```
97-
98-
In this example we trigger this for the input element `outputIntermediate` but this mechanism can be used for any question.
99-
10089
# Styling overrides
10190

10291
With these css variables defined in the root where the frontend is injected the default theming can be overriden.

0 commit comments

Comments
 (0)